Ndesịta nke sava mbido ị ga-eji, na-eji uru ha na ọnụahịa ha. Kpụga uuid nke mbido dịka plan_uuid mgbe ị na-edezi mọọbụ megharịa nha sava.
Na-eziga n'ihu n'ime usoroiheomume ọbụla dị ọrụ, nke kacha mma n'oge mbụ. Ndesịta ahụ enweghị filtri ma ọ bụ n'oge a ọ na-ahazi na ihuakwụkwọ ọbụla.
Ikikere achọrọ: plans:list
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": ""
}
]
}
| _Òkè | Ụdị | Ndesịta ozi ndị ahụ |
|---|---|---|
uuid |
string | Nkọwapụta usoroiheomume. Jiri ya dịka usoroiheomume_uuid mọọbụ usoroiheomume_uuid ọfụụ. |
cpu |
integer | Nkebi nke vCPUs |
ram, ram_unit |
integer, string | Ogo nchekwa na kọmpụta ya (MB mọọbụ GB) |
disk_space |
integer | Ụhara diski na GB |
disk_space_total |
integer | Ụhara diski na MB |
transfer, transfer_unit |
integer, string | Nhazi data ọnwa na kọmpụta ya (GB mọọbụ TB) |
disk_space_unit |
string | Ụdị nke ebe diski (GB) |
includes_ipv4 |
boolean | Ma ọ bụrụ na usoroiheomume ahụ na-agụnye adreesị IPv4 nke ndị mmadụ. Iheomume nke enweghị otu bụ IPv6 naanị; enwere ike ịgbakwunye adreesị IPv4 maka $2.00/ọnwa. |
monthly_price, price |
string | Nhazi nke ọnwa na USD dịka decimale string. Nhazi bụ uru nke otu. |
hourly_price |
string | Nhazi oge n'ime USD dịka ndezi string |
cpu_type_name |
string | CPU ụdị, dịka ọmụmaatụ, Shared. E wepụrụ ya maka usoroiheomume enweghị CPU ụdị, dịka usoroiheomume GPU. |
is_active |
boolean | Ọbụla eziokwu na ndesịta a, n'ihi na a na-ezigaghị usoroiheomume ndị ahụ na-arụghị ọrụ |
is_gpu, gpu_count, gpu_model |
boolean, integer, string | Ọ bụrụ na usoroiheomume ahụ gụnyere deskitọọpụ GPUs, olee ole, na ụdị olee |
| 200 | Nhazi ndesịta usoroiheomume ahụ ebudatara nke ọma |
| 403 | Ndehie mọọbụ token API adịghị mma, mọọbụ token enweghị ikikembanye achọrọ |
Na-eziga otu usoroiheomume na-arụ ọrụ na mpaghara ebe n'elu. Uuid na-arụ ọrụ ma ọ bụ nke a na-amaghị ama na-eziga 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": ""
}