സെർവർ ബാക്കപ്പുകൾ പ്രോഗ്രമാറ്റിക്കായി കൈകാര്യം ചെയ്യുക. നിങ്ങളുടെ സെർവറുകൾക്കായി ബാക്കപ്പുകൾ ലിസ്റ്റുചെയ്യുക, സൃഷ്ടിക്കുക, പുനഃസ്ഥാപിക്കുക, ഇല്ലാതാക്കുക.
നിങ്ങളുടെ സെർവറുകളിലുടനീളമുള്ള എല്ലാ ബാക്കപ്പുകളുടെയും ഒരു ലിസ്റ്റ് വീണ്ടെടുക്കുക.
| പാരാമീറ്റർ | ടൈപ്പ് ചെയ്യുക | ആവശ്യമാണ് | വിവരണം |
|---|---|---|---|
server_id |
integer | ഇല്ല | സെർവർ ഐഡി പ്രകാരം ബാക്കപ്പുകൾ ഫിൽട്ടർ ചെയ്യുക |
backup_type |
string | ഇല്ല | തരം അനുസരിച്ച് ഫിൽട്ടർ ചെയ്യുക: 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 | ബാക്കപ്പ് ലിസ്റ്റ് വിജയകരമായി വീണ്ടെടുത്തു. |
| 401 | അംഗീകൃതമല്ല - പ്രാമാണീകരണ ടോക്കൺ അസാധുവാണ് അല്ലെങ്കിൽ നഷ്ടപ്പെട്ടിരിക്കുന്നു. |
ഒരു സെർവറിന്റെ ഒരു മാനുവൽ ബാക്കപ്പ് സൃഷ്ടിക്കുക. മാനുവൽ ബാക്കപ്പുകൾ യാന്ത്രികമായി കാലഹരണപ്പെടില്ല.
| പാരാമീറ്റർ | ടൈപ്പ് ചെയ്യുക | ആവശ്യമാണ് | വിവരണം |
|---|---|---|---|
server_id |
integer | അതെ | ബാക്കപ്പ് ചെയ്യേണ്ട സെർവറിന്റെ ഐഡി |
description |
string | ഇല്ല | ബാക്കപ്പിനുള്ള ഓപ്ഷണൽ വിവരണം |
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 | ബാക്കപ്പ് സൃഷ്ടിക്കൽ വിജയകരമായി ആരംഭിച്ചു. |
| 400 | തെറ്റായ അഭ്യർത്ഥന - അസാധുവായ പാരാമീറ്ററുകൾ അല്ലെങ്കിൽ തെറ്റായ അഭ്യർത്ഥന |
| 401 | അംഗീകൃതമല്ല - പ്രാമാണീകരണ ടോക്കൺ അസാധുവാണ് അല്ലെങ്കിൽ നഷ്ടപ്പെട്ടിരിക്കുന്നു. |
| 404 | കണ്ടെത്തിയില്ല - സെർവർ നിലവിലില്ല. |
ഒരു ബാക്കപ്പ് ശാശ്വതമായി ഇല്ലാതാക്കുക. ഈ പ്രവർത്തനം പഴയപടിയാക്കാൻ കഴിയില്ല.
| പാരാമീറ്റർ | ടൈപ്പ് ചെയ്യുക | ആവശ്യമാണ് | വിവരണം |
|---|---|---|---|
backup_id |
integer | അതെ | തനതായ ബാക്കപ്പ് ഐഡി |
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 | ബാക്കപ്പ് വിജയകരമായി ഇല്ലാതാക്കി |
| 401 | അംഗീകൃതമല്ല - പ്രാമാണീകരണ ടോക്കൺ അസാധുവാണ് അല്ലെങ്കിൽ നഷ്ടപ്പെട്ടിരിക്കുന്നു. |
| 404 | കണ്ടെത്തിയില്ല - ബാക്കപ്പ് നിലവിലില്ല. |
ഒരു ബാക്കപ്പിൽ നിന്ന് ഒരു സെർവർ പുനഃസ്ഥാപിക്കാൻ, സെർവേഴ്സ് API പുനഃസ്ഥാപിക്കൽ എൻഡ്പോയിന്റ് ഉപയോഗിക്കുക:
POST /api/v1/servers/{server_id}/restore/
{
"backup_id": 501
}
സെർവർ പുനഃസ്ഥാപനത്തെക്കുറിച്ചുള്ള വിശദമായ വിവരങ്ങൾക്ക്, കാണുക സെർവറുകൾ API ഡോക്യുമെന്റേഷൻ.