Bhala Zonke Izifinyezo
Thola uhlu lwazo zonke izithombe kuwo wonke amaseva akho.
Amapharamitha Ombuzo
Amapharamitha
Uhlobo
Kuyadingeka
Incazelo
server_id
integer
Akukho
Hlunga izithombe nge-ID yeseva
Isicelo Sesibonelo
curl -X GET "https://admin.vps.org/api/v1/snapshots/?server_id=12345" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Kopela
import requests
url = "https://admin.vps.org/api/v1/snapshots/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
params = {"server_id": 12345}
response = requests.get(url, headers=headers, params=params)
print(response.json())
Kopela
const response = await fetch('https://admin.vps.org/api/v1/snapshots/?server_id=12345', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const snapshots = await response.json();
console.log(snapshots);
Kopela
Impendulo Yesibonelo
{
"count": 2,
"results": [
{
"id": 801,
"server": {
"id": 12345,
"name": "web-server-01"
},
"name": "pre-migration-snapshot",
"status": "completed",
"size_mb": 5120,
"created_at": "2025-01-15T18:30:00Z",
"description": "Before major migration"
},
{
"id": 798,
"server": {
"id": 12345,
"name": "web-server-01"
},
"name": "weekly-snapshot-2025-01-08",
"status": "completed",
"size_mb": 4856,
"created_at": "2025-01-08T12:00:00Z",
"description": "Weekly snapshot"
}
]
}
Amakhodi Esimo Sempendulo
200
Uhlu lwezifinyezo lubuyiselwe ngempumelelo
401
Akugunyaziwe - Ithokheni yokuqinisekisa engavumelekile noma engekho
Dala Isifinyezo
Dala isithombe-skrini sesimo samanje somhlinzeki. Izithombe-skrini ziyikopi zesikhathi sendawo yekhasimende lonke.
Cela Amapharamitha Omzimba
Amapharamitha
Uhlobo
Kuyadingeka
Incazelo
server_id
integer
Yebo
I-ID yeseva okufanele uyithathe isithombe
name
string
Yebo
Igama lesithombe (izinhlamvu zamagama, ama-hyphen, ama-underscore)
description
string
Akukho
Incazelo ongayikhetha yesithombe-skrini
Isicelo Sesibonelo
curl -X POST "https://admin.vps.org/api/v1/snapshots/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"server_id": 12345,
"name": "before-update-snapshot",
"description": "Snapshot before system update"
}'
Kopela
import requests
url = "https://admin.vps.org/api/v1/snapshots/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {
"server_id": 12345,
"name": "before-update-snapshot",
"description": "Snapshot before system update"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
Kopela
const response = await fetch('https://admin.vps.org/api/v1/snapshots/', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
server_id: 12345,
name: 'before-update-snapshot',
description: 'Snapshot before system update'
})
});
const snapshot = await response.json();
console.log(snapshot);
Kopela
Impendulo Yesibonelo
{
"id": 802,
"server": {
"id": 12345,
"name": "web-server-01"
},
"name": "before-update-snapshot",
"status": "in_progress",
"size_mb": null,
"created_at": "2025-01-16T16:15:00Z",
"description": "Snapshot before system update",
"message": "Snapshot is being created. This may take 3-10 minutes depending on server size."
}
Amakhodi Esimo Sempendulo
201
Ukudalwa kwesithombe-skrini kuqalwe ngempumelelo
400
Bad Request - Invalid parameters or snapshot limit reached
401
Akugunyaziwe - Ithokheni yokuqinisekisa engavumelekile noma engekho
404
Not Found - Server does not exist
Isibonelo: You can have a maximum of 5 snapshots per server. Creating a snapshot while the server is running may result in filesystem inconsistencies. For best results, stop the server before creating a snapshot.
Buyisela kusuka ku-Snapshot
Buyisela umsekeli endaweni ethathwe kwisithombe-skrini. Lokhu kuzobhala ngaphezulu yonke idatha yamanje kumsekeli.
Amapharamitha Endlela
Amapharamitha
Uhlobo
Kuyadingeka
Incazelo
snapshot_id
integer
Yebo
I-ID yesifinyezo esiyingqayizivele
Isicelo Sesibonelo
curl -X POST "https://admin.vps.org/api/v1/snapshots/801/restore/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Kopela
import requests
snapshot_id = 801
url = f"https://admin.vps.org/api/v1/snapshots/{snapshot_id}/restore/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
Kopela
const snapshotId = 801;
const response = await fetch(`https://admin.vps.org/api/v1/snapshots/${snapshotId}/restore/`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const result = await response.json();
console.log(result);
Kopela
Impendulo Yesibonelo
{
"status": "success",
"message": "Server is being restored from snapshot. This may take 5-15 minutes.",
"snapshot": {
"id": 801,
"name": "pre-migration-snapshot",
"created_at": "2025-01-15T18:30:00Z"
},
"server": {
"id": 12345,
"name": "web-server-01",
"status": "restoring"
}
}
Amakhodi Esimo Sempendulo
200
Ukubuyisela kuqalwe ngempumelelo
400
Bad Request - Server is not in a valid state for restoration
401
Akugunyaziwe - Ithokheni yokuqinisekisa engavumelekile noma engekho
404
Akutholakali - Isithombe-skrini asikho
Isexwayiso: Restoring from a snapshot will overwrite all current data on the server. This action cannot be undone. The server will be automatically stopped before restoration begins.
Susa Isifinyezo
Susa isithombe unomphela. Lesi senzo asikwazi ukuhlehliswa.
Amapharamitha Endlela
Amapharamitha
Uhlobo
Kuyadingeka
Incazelo
snapshot_id
integer
Yebo
I-ID yesifinyezo esiyingqayizivele
Isicelo Sesibonelo
curl -X DELETE "https://admin.vps.org/api/v1/snapshots/801/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
Kopela
import requests
snapshot_id = 801
url = f"https://admin.vps.org/api/v1/snapshots/{snapshot_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.delete(url, headers=headers)
print(response.status_code)
Kopela
Amakhodi Esimo Sempendulo
204
Isifinyezo sisuswe ngempumelelo
401
Akugunyaziwe - Ithokheni yokuqinisekisa engavumelekile noma engekho
404
Akutholakali - Isithombe-skrini asikho
Snapshots vs Backups
Ukuqonde ukuthi kusetshenziswa kanjani izithombe ezingenalutho versus izilungiselelo zokugcina:
I-Snapshots API
Inhloso: Quick point-in-time recovery
Isivinini: Faster to create and restore (3-15 min)
Icala Lokusebenzisa: Before risky operations (updates, config changes)
Isitoreji: Stored on same infrastructure
Ilimi: 5 snapshots per server
Okuhle Kakhulu Ku: Short-term rollback capability
I-API Yezipele
Inhloso: Long-term data protection
Isivinini: Slower to create and restore (varies)
Icala Lokusebenzisa: Regular automated data protection
Isitoreji: Separate backup storage
Ilimi: 10 manual + automatic backups
Okuhle Kakhulu Ku: Disaster recovery and compliance
Ukusebenza okuhle
Phambi kokuvuselelwa: Dala isithonjana ngaphambi kokuhlaziywa okukhulu kwesistimu
Ukuvavanya: Sebenzisa izithonjana uma uhlola ushintsho lokumiswa
Izindlela ezixhumene: Sebenzisa ama-snapshots (aphakathi) kanye nama-backup (aphakathi)
Cisha: Cisha izithombe ezidala ngemuva kokuqedela ukuhlaziywa
Isisebenzisi: Qaphela ukuvala isisebenzisi ngaphambi kokwenza izithombe ezibalulekile