VPS.org API

REST API ကိုစာရွက်စာတမ်းများ

အစီအစဉ်များ API

သူတို့ရဲ့အရင်းအမြစ်များနှင့်စျေးနှုန်းများနှင့်အတူသင်ဖြန့်ချိနိုင်သည့် server ကိုအစီအစဉ်များကိုစာရင်းပြုစုပါ။ သင် server ကိုဖန်တီးသို့မဟုတ် resize တဲ့အခါ plan_uuid အဖြစ်အစီအစဉ်၏ uuid ပေးပို့ပါ။

အဆုံးမှတ်များ 2
အခြေခံလမ်းကြောင်း /api/v1/plans
ရယူပါ /api/v1/plans/

အစီအစဉ်အားလုံးကို စာရင်းပြုစုပါ

စာရင်းတွင် filters များမရှိပါနှင့်ယခုတစ်မျက်နှာပေါ်တွင် fits ။

ခွင့်ပြုချက်လိုအပ်သည်: plans:list

နမူနာတောင်းဆိုချက်

cURL
Python
JavaScript
PHP
curl -X GET "https://admin.vps.org/api/v1/plans/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
import requests

url = "https://admin.vps.org/api/v1/plans/"
headers = {"Authorization": "Bearer YOUR_API_TOKEN"}

response = requests.get(url, headers=headers)
for plan in response.json()["results"]:
    print(plan["uuid"], plan["cpu"], plan["ram"], plan["ram_unit"], plan["monthly_price"])
const response = await fetch('https://admin.vps.org/api/v1/plans/', {
  headers: { 'Authorization': 'Bearer YOUR_API_TOKEN' }
});

const data = await response.json();
console.log(data.results);
$ch = curl_init('https://admin.vps.org/api/v1/plans/');
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Authorization: Bearer YOUR_API_TOKEN']);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$plans = json_decode(curl_exec($ch), true);
curl_close($ch);

ဥပမာတုံ့ပြန်မှု

{
  "count": 12,
  "next": null,
  "previous": null,
  "results": [
    {
      "uuid": "ed0ac717-c26c-4d9b-a801-b170c4979028",
      "cpu": 1,
      "ram": 512,
      "ram_unit": "MB",
      "disk_space": 10,
      "disk_space_total": 10240,
      "transfer": 500,
      "transfer_unit": "GB",
      "includes_ipv4": false,
      "price": "2.50",
      "cpu_type_name": "Shared",
      "is_active": true,
      "hourly_price": "0.004",
      "monthly_price": "2.50",
      "is_gpu": false,
      "gpu_count": 0,
      "gpu_model": ""
    },
    {
      "uuid": "14186969-fbaf-43e1-9ab2-b1f1aeb66674",
      "cpu": 1,
      "ram": 2,
      "ram_unit": "GB",
      "disk_space": 25,
      "disk_space_total": 25600,
      "transfer": 1,
      "transfer_unit": "TB",
      "includes_ipv4": true,
      "price": "5.00",
      "cpu_type_name": "Shared",
      "is_active": true,
      "hourly_price": "0.007",
      "monthly_price": "5.00",
      "is_gpu": false,
      "gpu_count": 0,
      "gpu_model": ""
    }
  ]
}

တုံ့ပြန်မှု ကွက်လပ်များ

နယ်မြေ အမျိုးအစား ဖော်ပြချက်
uuid string စီမံကိန်းအမည်. plan_uuid သို့မဟုတ် new_plan_uuid အဖြစ်အသုံးပြုပါ။
cpu integer vCPUs အရေအတွက်
ram, ram_unit integer, string မှတ်ဉာဏ်အရေအတွက်နှင့်၎င်း၏ယူနစ် (MB သို့မဟုတ် GB)
disk_space integer ဒေတာအရွယ်အစား (GB)
disk_space_total integer ခွေအရွယ်အစား (MB)
transfer, transfer_unit integer, string လစဉ်ဒေတာလွှဲပြောင်းခွင့်နှင့် ၎င်း၏ယူနစ် (GB သို့မဟုတ် TB)
disk_space_unit string ဒေတာနေရာ (GB)
includes_ipv4 boolean စီမံကိန်းတစ်ခုပြည်သူ့ IPv4 အမည်ရှိပါသလား. တစ်ခုမရှိဘဲစီမံကိန်းများ IPv6 တစ်ခုတည်းဖြစ်ကြသည်; တစ်ဦး IPv4 အမည်ရှိ $2.00 / လအတွက်ထည့်သွင်းနိုင်ပါသည်။
monthly_price, price string တစ်ဆယ်ရာခိုင်နှုန်း string အဖြစ် USD ကိုလစဉ်စျေးနှုန်း. စျေးနှုန်းတူညီတဲ့တန်ဖိုးကိုဖြစ်ပါသည်.
hourly_price string တစ်ဆယ်ရာခိုင်နှုန်း string အဖြစ် USD ကိုနာရီစျေးနှုန်း
cpu_type_name string CPU type, ဥပမာ Shared. CPU type မရှိဘဲစီမံကိန်းများအတွက်မပါဘဲ, အဖြစ် GPU စီမံကိန်း.
is_active boolean ဤစာရင်းတွင်အမြဲမှန်သည်၊ အကြောင်းမှာမလှုပ်ရှားသောပရောဂျက်များပြန်မလာကြဘူး
is_gpu, gpu_count, gpu_model boolean, integer, string စီမံကိန်းကိုရည်ရွယ် GPUs ပါဝင်သည်မဟုတ်ပါ, ဘယ်လောက်, နှင့်မည်သည့်မော်ဒယ်
512 MB စီမံကိန်းကို IPv6 တစ်ခုတည်းဖြစ်ပါသည်; အခြားလက်ရှိစီမံကိန်းများ IPv4 ပါဝင်သည်. IPv4 ကျော်ရောက်ရှိရမည်ဆိုသော site ကိုများအတွက်စီမံကိန်းကိုရွေးချယ်မတိုင်မီစျေးနှုန်းစာမျက်နှာနှင့်နှိုင်းယှဉ်.

တုံ့ပြန်မှု အခြေအနေ ကုဒ်များ

200 စီမံကိန်းစာရင်းကို အောင်မြင်စွာ ပြန်လည်ရယူ
403 API token မပါဘဲ သို့မဟုတ် မမှန်ကန်ပါ၊ သို့မဟုတ် token သည်လိုအပ်သောခွင့်ပြုချက်မရှိပါ
ရယူပါ /api/v1/plans/{uuid}/

အစီအစဉ်အသေးစိတ်ကို ရယူပါ

အပေါ်က Fields များနှင့်အတူတစ်ဦးအကောင်အထည်ဖော်ရေးအစီအစဉ်ကိုပြန်လာသည်။ 404 ပြန်လာသောမလှုပ်ရှားသောသို့မဟုတ်မသိ uuid ။

curl -X GET "https://admin.vps.org/api/v1/plans/ed0ac717-c26c-4d9b-a801-b170c4979028/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "uuid": "ed0ac717-c26c-4d9b-a801-b170c4979028",
  "cpu": 1,
  "ram": 512,
  "ram_unit": "MB",
  "disk_space": 10,
  "disk_space_total": 10240,
  "transfer": 500,
  "transfer_unit": "GB",
  "includes_ipv4": false,
  "price": "2.50",
  "cpu_type_name": "Shared",
  "is_active": true,
  "hourly_price": "0.004",
  "monthly_price": "2.50",
  "is_gpu": false,
  "gpu_count": 0,
  "gpu_model": ""
}