ဆာဗာ အရန်ကူးယူမှုများကို ပရိုဂရမ်ဖြင့် စီမံခန့်ခွဲပါ။ သင့်ဆာဗာများအတွက် အရန်ကူးယူမှုများကို စာရင်းပြုစုခြင်း၊ ဖန်တီးခြင်း၊ ပြန်လည်ရယူခြင်းနှင့် ဖျက်ခြင်း။
သင့်ဆာဗာများတစ်လျှောက်ရှိ အရန်ကူးယူမှုအားလုံး၏ စာရင်းကို ရယူပါ။
| ကန့်သတ်ချက် | အမျိုးအစား | လိုအပ်သည် | ဖော်ပြချက် |
|---|---|---|---|
server_id |
integer | မဟုတ်ပါ | ဆာဗာ ID အလိုက် အရန်ကူးယူမှုများကို စစ်ထုတ်ပါ |
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 | ဟုတ်ကဲ့ | အရန်ကူးယူရန် ဆာဗာ၏ ID |
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 | ဟုတ်ကဲ့ | ထူးခြားသော အရန် ID |
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 | မတွေ့ပါ - အရန်ကူးယူထားခြင်း မရှိပါ။ |
backup တစ်ခုမှ server တစ်ခုကို restore လုပ်ရန်အတွက် Servers API restore endpoint ကိုသုံးပါ။
POST /api/v1/servers/{server_id}/restore/
{
"backup_id": 501
}
ဆာဗာပြန်လည်ထူထောင်ရေးအကြောင်း အသေးစိတ်အချက်အလက်များအတွက်၊ ကြည့်ပါ ဆာဗာများ API စာရွက်စာတမ်းများ.