ဆာဗာအားလုံးကို စာရင်းပြုစုပါ
သင့်အကောင့်ရှိ ဆာဗာအားလုံး၏ စာရင်းကို ရယူပါ။
မေးမြန်းချက် ကန့်သတ်ချက်များ
| ကန့်သတ်ချက် |
အမျိုးအစား |
လိုအပ်သည် |
ဖော်ပြချက် |
status |
ကြိုး |
မဟုတ်ပါ |
ဆာဗာအခြေအနေအလိုက် စစ်ထုတ်ပါ- တက်ကြွသည်၊ ရပ်တန့်သည်၊ ဆိုင်းငံ့ထားသည် |
location |
ကြိုး |
မဟုတ်ပါ |
ဒေတာစင်တာတည်နေရာအလိုက် စစ်ထုတ်ပါ |
နမူနာတောင်းဆိုချက်
cURL
Python
JavaScript
PHP
curl -X GET "https://admin.vps.org/api/v1/servers/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
url = "https://admin.vps.org/api/v1/servers/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/servers/', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const servers = await response.json();
console.log(servers);
$ch = curl_init('https://admin.vps.org/api/v1/servers/');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_TOKEN',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$servers = json_decode($response, true);
curl_close($ch);
ဥပမာတုံ့ပြန်မှု
{
"count": 2,
"results": [
{
"id": 12345,
"name": "web-server-01",
"hostname": "web01.example.com",
"status": "active",
"ip_address": "203.0.113.10",
"location": "us-west",
"plan": {
"id": 1,
"name": "Standard VPS",
"vcpus": 2,
"memory": 4096,
"storage": 80
},
"os": {
"id": 5,
"name": "Ubuntu 22.04 LTS"
},
"created_at": "2025-01-10T14:30:00Z",
"updated_at": "2025-01-15T10:20:00Z"
},
{
"id": 12346,
"name": "db-server-01",
"hostname": "db01.example.com",
"status": "active",
"ip_address": "203.0.113.11",
"location": "us-east",
"plan": {
"id": 2,
"name": "Performance VPS",
"vcpus": 4,
"memory": 8192,
"storage": 160
},
"os": {
"id": 3,
"name": "Debian 12"
},
"created_at": "2025-01-12T09:15:00Z",
"updated_at": "2025-01-16T08:45:00Z"
}
]
}
တုံ့ပြန်မှု အခြေအနေ ကုဒ်များ
| 200 |
ဆာဗာစာရင်းကို အောင်မြင်စွာ ပြန်လည်ရယူပြီးပါပြီ |
| 401 |
ခွင့်ပြုချက်မရှိပါ - API တိုကင် မမှန်ကန်ပါ သို့မဟုတ် ပျောက်ဆုံးနေသည် |
ဆာဗာအသစ် ဖန်တီးပါ
သတ်မှတ်ထားသော configuration ဖြင့် VPS server အသစ်တစ်ခုကို ဖြန့်ကျက်ပါ။
ခန္ဓာကိုယ် ကန့်သတ်ချက်များ တောင်းဆိုပါ
| ကန့်သတ်ချက် |
အမျိုးအစား |
လိုအပ်သည် |
ဖော်ပြချက် |
name |
ကြိုး |
ဟုတ်ကဲ့ |
ဆာဗာအမည် (အက္ခရာနှင့်ဂဏန်းများ၊ hyphen များ ခွင့်ပြုထားသည်) |
plan_id |
ကိန်းပြည့် |
ဟုတ်ကဲ့ |
VPS အစီအစဉ်၏ ID |
os_id |
ကိန်းပြည့် |
ဟုတ်ကဲ့ |
လည်ပတ်မှုစနစ်၏ ID |
location |
ကြိုး |
ဟုတ်ကဲ့ |
ဒေတာစင်တာတည်နေရာကုဒ် |
hostname |
ကြိုး |
မဟုတ်ပါ |
ဆာဗာ ဟို့စ်အမည် (FQDN) |
ssh_key_id |
ကိန်းပြည့် |
မဟုတ်ပါ |
ထည့်သွင်းရန် SSH key ID |
backups_enabled |
ဘူလီယန် |
မဟုတ်ပါ |
အလိုအလျောက် အရန်ကူးယူမှုများကို ဖွင့်ပါ (ပုံသေ- မှားယွင်းသည်) |
နမူနာတောင်းဆိုချက်
cURL
Python
JavaScript
PHP
curl -X POST "https://admin.vps.org/api/v1/servers/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "web-server-02",
"plan_id": 1,
"os_id": 5,
"location": "us-west",
"hostname": "web02.example.com",
"backups_enabled": true
}'
import requests
url = "https://admin.vps.org/api/v1/servers/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {
"name": "web-server-02",
"plan_id": 1,
"os_id": 5,
"location": "us-west",
"hostname": "web02.example.com",
"backups_enabled": True
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/servers/', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'web-server-02',
plan_id: 1,
os_id: 5,
location: 'us-west',
hostname: 'web02.example.com',
backups_enabled: true
})
});
const server = await response.json();
console.log(server);
$data = [
'name' => 'web-server-02',
'plan_id' => 1,
'os_id' => 5,
'location' => 'us-west',
'hostname' => 'web02.example.com',
'backups_enabled' => true
];
$ch = curl_init('https://admin.vps.org/api/v1/servers/');
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);
$server = json_decode($response, true);
curl_close($ch);
ဥပမာတုံ့ပြန်မှု
{
"id": 12347,
"name": "web-server-02",
"hostname": "web02.example.com",
"status": "provisioning",
"ip_address": null,
"location": "us-west",
"plan": {
"id": 1,
"name": "Standard VPS",
"vcpus": 2,
"memory": 4096,
"storage": 80
},
"os": {
"id": 5,
"name": "Ubuntu 22.04 LTS"
},
"backups_enabled": true,
"created_at": "2025-01-16T15:30:00Z",
"updated_at": "2025-01-16T15:30:00Z",
"message": "Server is being provisioned. This may take 2-5 minutes."
}
တုံ့ပြန်မှု အခြေအနေ ကုဒ်များ
| 201 |
ဆာဗာကို အောင်မြင်စွာ ဖန်တီးပြီးပါပြီ |
| 400 |
တောင်းဆိုချက် မှားယွင်းခြင်း - ကန့်သတ်ချက်များ မှားယွင်းနေပါသည် |
| 401 |
ခွင့်ပြုချက်မရှိပါ - API တိုကင် မမှန်ကန်ပါ သို့မဟုတ် ပျောက်ဆုံးနေသည် |
| 402 |
ငွေပေးချေမှု လိုအပ်သည် - ခရက်ဒစ် မလုံလောက်ပါ |
ဆာဗာအသေးစိတ်အချက်အလက်များကို ရယူပါ
သတ်မှတ်ထားသော server တစ်ခုအကြောင်း အသေးစိတ်အချက်အလက်များကို ရယူပါ။
လမ်းကြောင်း ကန့်သတ်ချက်များ
| ကန့်သတ်ချက် |
အမျိုးအစား |
လိုအပ်သည် |
ဖော်ပြချက် |
server_id |
ကိန်းပြည့် |
ဟုတ်ကဲ့ |
ထူးခြားသော ဆာဗာ ID |
နမူနာတောင်းဆိုချက်
curl -X GET "https://admin.vps.org/api/v1/servers/12345/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
const serverId = 12345;
const response = await fetch(`https://admin.vps.org/api/v1/servers/${serverId}/`, {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const server = await response.json();
console.log(server);
ဥပမာတုံ့ပြန်မှု
{
"id": 12345,
"name": "web-server-01",
"hostname": "web01.example.com",
"status": "active",
"ip_address": "203.0.113.10",
"ipv6_address": "2001:0db8::1",
"location": "us-west",
"plan": {
"id": 1,
"name": "Standard VPS",
"vcpus": 2,
"memory": 4096,
"storage": 80,
"bandwidth": 2048
},
"os": {
"id": 5,
"name": "Ubuntu 22.04 LTS"
},
"backups_enabled": true,
"resource_usage": {
"cpu_percent": 23.5,
"memory_used": 2048,
"disk_used": 35,
"bandwidth_used": 450
},
"created_at": "2025-01-10T14:30:00Z",
"updated_at": "2025-01-16T15:45:00Z"
}
တုံ့ပြန်မှု အခြေအနေ ကုဒ်များ
| 200 |
ဆာဗာအသေးစိတ်အချက်အလက်များကို အောင်မြင်စွာရယူပြီးပါပြီ |
| 401 |
ခွင့်ပြုချက်မရှိပါ - API တိုကင် မမှန်ကန်ပါ သို့မဟုတ် ပျောက်ဆုံးနေသည် |
| 404 |
ရှာမတွေ့ပါ - ဆာဗာ မရှိပါ။ |
ဆာဗာကို အပ်ဒိတ်လုပ်ပါ
ဆာဗာ ပြင်ဆင်သတ်မှတ်ချက်ကို အပ်ဒိတ်လုပ်ပါ။ အကွက်အားလုံးကို ဖြည့်ရန် လိုအပ်သည်။
လမ်းကြောင်း ကန့်သတ်ချက်များ
| Parameter |
Type |
Required |
Description |
server_id |
integer |
Yes |
ထူးခြားသော ဆာဗာ ID |
ခန္ဓာကိုယ် ကန့်သတ်ချက်များ တောင်းဆိုပါ
| ကန့်သတ်ချက် |
အမျိုးအစား |
လိုအပ်သည် |
ဖော်ပြချက် |
name |
ကြိုး |
ဟုတ်ကဲ့ |
ဆာဗာအမည် |
hostname |
ကြိုး |
ဟုတ်ကဲ့ |
ဆာဗာ ဟို့စ်အမည် (FQDN) |
backups_enabled |
ဘူလီယန် |
ဟုတ်ကဲ့ |
အလိုအလျောက် အရန်ကူးယူမှုများကို ဖွင့်/ပိတ်ပါ |
နမူနာတောင်းဆိုချက်
curl -X PUT "https://admin.vps.org/api/v1/servers/12345/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "web-server-updated",
"hostname": "web-updated.example.com",
"backups_enabled": true
}'
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {
"name": "web-server-updated",
"hostname": "web-updated.example.com",
"backups_enabled": True
}
response = requests.put(url, headers=headers, json=data)
print(response.json())
တုံ့ပြန်မှု အခြေအနေ ကုဒ်များ
| 200 |
ဆာဗာကို အောင်မြင်စွာ အပ်ဒိတ်လုပ်လိုက်ပါပြီ |
| 400 |
တောင်းဆိုချက် မှားယွင်းခြင်း - ကန့်သတ်ချက်များ မှားယွင်းနေပါသည် |
| 404 |
ရှာမတွေ့ပါ - ဆာဗာ မရှိပါ။ |
ဆာဗာကို တစ်စိတ်တစ်ပိုင်း အပ်ဒိတ်လုပ်ပါ
သတ်မှတ်ထားသော ဆာဗာအကွက်များကို အပ်ဒိတ်လုပ်ပါ။ ပေးထားသော အကွက်များကိုသာ အပ်ဒိတ်လုပ်ပါမည်။
နမူနာတောင်းဆိုချက်
curl -X PATCH "https://admin.vps.org/api/v1/servers/12345/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "new-server-name"
}'
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
data = {"name": "new-server-name"}
response = requests.patch(url, headers=headers, json=data)
print(response.json())
ဆာဗာကို ဖျက်ပါ
ဆာဗာတစ်ခုကို အပြီးအပိုင်ဖျက်ပါ။ ဤလုပ်ဆောင်ချက်ကို ပြန်ပြင်၍မရပါ။
နမူနာတောင်းဆိုချက်
curl -X DELETE "https://admin.vps.org/api/v1/servers/12345/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.delete(url, headers=headers)
print(response.status_code)
တုံ့ပြန်မှု အခြေအနေ ကုဒ်များ
| 204 |
ဆာဗာကို အောင်မြင်စွာ ဖျက်လိုက်ပါပြီ |
| 404 |
ရှာမတွေ့ပါ - ဆာဗာ မရှိပါ။ |
ဆာဗာစတင်ပါ
ရပ်တန့်နေသော server ကိုဖွင့်ပါ။
နမူနာတောင်းဆိုချက်
curl -X POST "https://admin.vps.org/api/v1/servers/12345/start/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/start/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
const serverId = 12345;
const response = await fetch(`https://admin.vps.org/api/v1/servers/${serverId}/start/`, {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const result = await response.json();
console.log(result);
ဥပမာတုံ့ပြန်မှု
{
"status": "success",
"message": "Server is starting",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "starting"
}
}
တုံ့ပြန်မှု အခြေအနေ ကုဒ်များ
| 200 |
ဆာဗာစတင်ရန် အမိန့်ကို အောင်မြင်စွာပေးပို့ပြီးပါပြီ |
| 400 |
တောင်းဆိုချက် မှားယွင်းနေပါသည် - ဆာဗာသည် လည်ပတ်နေပြီဖြစ်သည် |
| 404 |
ရှာမတွေ့ပါ - ဆာဗာ မရှိပါ။ |
ဆာဗာကို ရပ်တန့်ပါ
ဖွင့်ထားတဲ့ server ကို ယဉ်ကျေးစွာ ပိတ်လိုက်ပါ။
နမူနာတောင်းဆိုချက်
curl -X POST "https://admin.vps.org/api/v1/servers/12345/stop/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/stop/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
ဥပမာတုံ့ပြန်မှု
{
"status": "success",
"message": "Server is stopping",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "stopping"
}
}
ဆာဗာကို ပြန်လည်စတင်ပါ
ဖွင့်ထားသော server ကို ယဉ်ကျေးစွာ restart လုပ်ပါ။
နမူနာတောင်းဆိုချက်
curl -X POST "https://admin.vps.org/api/v1/servers/12345/reboot/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
server_id = 12345
url = f"https://admin.vps.org/api/v1/servers/{server_id}/reboot/"
headers = {
"Authorization": "Bearer YOUR_API_TOKEN",
"Content-Type": "application/json"
}
response = requests.post(url, headers=headers)
print(response.json())
ဥပမာတုံ့ပြန်မှု
{
"status": "success",
"message": "Server is rebooting",
"server": {
"id": 12345,
"name": "web-server-01",
"status": "rebooting"
}
}
တုံ့ပြန်မှု အခြေအနေ ကုဒ်များ
| 200 |
ဆာဗာပြန်လည်စတင်ရန် အမိန့်ကို အောင်မြင်စွာပေးပို့ပြီးပါပြီ |
| 400 |
တောင်းဆိုချက် မှားယွင်းနေပါသည် - ဆာဗာ အလုပ်မလုပ်ပါ |
| 404 |
ရှာမတွေ့ပါ - ဆာဗာ မရှိပါ။ |