Pulea fa'amaumauga fa'ale-polokalame a le 'au'aunaga. Lisi, fatuina, toe fa'afo'isia, ma tape fa'amaumauga fa'ale-polokalame mo au 'au'aunaga.
Toe aumai se lisi o faʻamaumauga uma i au 'auʻaunaga.
| Fa'atulagaga | Ituaiga | Mana'omia | Fa'amatalaga |
|---|---|---|---|
server_id |
integer | Leai | Fa'amama fa'amaumauga fa'aleoleo e ala i le ID o le 'au'aunaga |
backup_type |
string | Leai | Fa'amama e tusa ai ma le ituaiga: manual , automatic |
curl -X GET "https://admin.vps.org/api/v1/backups/?server_id=12345" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
url = "https://admin.vps.org/api/v1/backups/"
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())
const response = await fetch('https://admin.vps.org/api/v1/backups/?server_id=12345', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const backups = await response.json();
console.log(backups);
{
"count": 3,
"results": [
{
"id": 501,
"server": {
"id": 12345,
"name": "web-server-01"
},
"backup_type": "automatic",
"status": "completed",
"size_mb": 4523,
"created_at": "2025-01-16T03:00:00Z",
"expires_at": "2025-02-16T03:00:00Z",
"description": "Automatic daily backup"
},
{
"id": 499,
"server": {
"id": 12345,
"name": "web-server-01"
},
"backup_type": "manual",
"status": "completed",
"size_mb": 4456,
"created_at": "2025-01-14T10:30:00Z",
"expires_at": null,
"description": "Pre-update backup"
},
{
"id": 495,
"server": {
"id": 12345,
"name": "web-server-01"
},
"backup_type": "automatic",
"status": "completed",
"size_mb": 4389,
"created_at": "2025-01-15T03:00:00Z",
"expires_at": "2025-02-15T03:00:00Z",
"description": "Automatic daily backup"
}
]
}
| 200 | Ua manuia le toe maua mai o le lisi o faaleoleo |
| 401 | E le'i Fa'atagaina - Fa'ailoga fa'amaonia e le aoga pe ua misi |
Fausia se fa'amaumauga fa'ale-tusitusiga a se 'au'aunaga. E lē otometi lava ona muta le aoga o fa'amaumauga fa'ale-tusitusiga.
| Fa'atulagaga | Ituaiga | Mana'omia | Fa'amatalaga |
|---|---|---|---|
server_id |
integer | Ioe | ID o le 'au'aunaga e fai ai le faaleoleo |
description |
string | Leai | Fa'amatalaga fa'aopoopo mo le fa'aleoleo |
curl -X POST "https://admin.vps.org/api/v1/backups/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"server_id": 12345,
"description": "Pre-deployment backup"
}'
import requests
url = "https://admin.vps.org/api/v1/backups/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {
"server_id": 12345,
"description": "Pre-deployment backup"
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/backups/', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
server_id: 12345,
description: 'Pre-deployment backup'
})
});
const backup = await response.json();
console.log(backup);
$data = [
'server_id' => 12345,
'description' => 'Pre-deployment backup'
];
$ch = curl_init('https://admin.vps.org/api/v1/backups/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_TOKEN',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$backup = json_decode($response, true);
curl_close($ch);
{
"id": 502,
"server": {
"id": 12345,
"name": "web-server-01"
},
"backup_type": "manual",
"status": "in_progress",
"size_mb": null,
"created_at": "2025-01-16T15:45:00Z",
"expires_at": null,
"description": "Pre-deployment backup",
"message": "Backup is being created. This may take several minutes depending on server size."
}
| 201 | Ua amata manuia le faia o se faaleoleo |
| 400 | Talosaga Leaga - Fa'atulagaga le aoga pe talosaga le sa'o |
| 401 | E le'i Fa'atagaina - Fa'ailoga fa'amaonia e le aoga pe ua misi |
| 404 | E le'i Maua - E leai se 'Au'aunaga |
Tape tumau se fa'amaumauga fa'aleoleo. E le mafai ona toe fa'aleaogaina lenei gaioiga.
| Fa'atulagaga | Ituaiga | Mana'omia | Fa'amatalaga |
|---|---|---|---|
backup_id |
integer | Ioe | ID faaleoleo tulaga ese |
curl -X DELETE "https://admin.vps.org/api/v1/backups/501/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
backup_id = 501
url = f"https://admin.vps.org/api/v1/backups/{backup_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.delete(url, headers=headers)
print(response.status_code)
const backupId = 501;
const response = await fetch(`https://admin.vps.org/api/v1/backups/${backupId}/`, {
method: 'DELETE',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
console.log(response.status);
| 204 | Ua manuia le tapeina o le faaleoleo |
| 401 | E le'i Fa'atagaina - Fa'ailoga fa'amaonia e le aoga pe ua misi |
| 404 | E Le'i Maua - E leai se fa'amaumauga faaleoleo |
Ina ia toe fa'afo'isia se 'au'aunaga mai se fa'amaumauga fa'aleoleo, fa'aaoga le Servers API restore endpoint:
POST /api/v1/servers/{server_id}/restore/
{
"backup_id": 501
}
Mo nisi fa'amatalaga auiliili e uiga i le toe fa'aleleia o le 'au'aunaga, taga'i i le Pepa fa'amaumauga o le API o 'Au'aunaga.