VPS.org API

REST API દસ્તાવેજીકરણ

પ્લાન્સ API

સર્વર યોજનાઓની યાદી કરો કે જે તમે તેમના સ્ત્રોતો અને કિંમતો સાથે સ્થાપિત કરી શકો છો. યોજનાનું uuid plan_uuid તરીકે પસાર કરો જ્યારે તમે સર્વર બનાવો અથવા માપ બદલો.

અંતિમ બિંદુઓ 2
બેઝ પાથ /api/v1/plans
મેળવો /api/v1/plans/

બધા પ્લાનની યાદી બનાવો

દરેક સક્રિય યોજના પાછી આપે છે, સૌથી સસ્તું પહેલા. યાદી પાસે ગાળકો નથી અને હાલમાં એક પાના પર બંધબેસે છે.

જરૂરી પરવાનગી: 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) (_m)
includes_ipv4 boolean શું યોજના જાહેર IPv4 સરનામાંને સમાવે છે. એક વગરની યોજનાઓ ફક્ત IPv6 છે; IPv4 સરનામું $2.00/મહિના માટે ઉમેરી શકાય છે.
monthly_price, price string દશાંશ શબ્દમાળા તરીકે USD માં માસિક કિંમત. કિંમત એ જ કિંમત છે.
hourly_price string દશાંશ શબ્દમાળા તરીકે USD માં કલાકની કિંમત
cpu_type_name string CPU પ્રકાર, ઉદાહરણ તરીકે વહેંચાયેલ. CPU પ્રકાર વગરની યોજનાઓ માટે અવગણાયેલ છે, જેમ કે GPU યોજના.
is_active boolean આ યાદીમાં હંમેશા સાચું છે, કારણ કે અસક્રિય યોજનાઓ પાછી આપવામાં આવતી નથી
is_gpu, gpu_count, gpu_model boolean, integer, string શું યોજના સમર્પિત GPUs સમાવે છે, કેટલી, અને કયું મોડેલ
જવાબ કહેતો નથી કે શું યોજના IPv4 સરનામાં સમાવે છે. 512 MB યોજના માત્ર IPv6 છે; અન્ય વર્તમાન યોજનાઓ IPv4 સમાવે છે. સાઇટ માટે યોજના પસંદ કરતા પહેલા કિંમત પાના સાથે સરખામણી કરો કે જે IPv4 પર પહોંચી શકાય તેવુ હોવુ જોઇએ.

પ્રતિભાવ સ્થિતિ કોડ્સ

200 સફળતાપૂર્વક મેળવેલ યોજનાઓની યાદી
403 ગુમ થયેલ અથવા અયોગ્ય API ટોકન, અથવા ટોકન પાસે જરૂરી પરવાનગી નથી
મેળવો /api/v1/plans/{uuid}/

યોજનાની વિગતો મેળવો

ઉપરના ક્ષેત્રો સાથે એક સક્રિય યોજના પાછી આપે છે. અસક્રિય અથવા અજ્ઞાત uuid 404 પાછી આપે છે.

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": ""
}