Liiska meelaha aad ku soo bandhigi kartaa VPS. Pass id meel sida location_id marka aad abuurto server.
Soo celinta liiska dhammaan goobaha datacenter ee jira oo aad ku isticmaali karto VPS servers.
curl -X GET "https://admin.vps.org/api/v1/locations/" \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json"
import requests
url = "https://admin.vps.org/api/v1/locations/"
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/locations/', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_API_TOKEN',
'Content-Type': 'application/json'
}
});
const locations = await response.json();
console.log(locations);
$ch = curl_init('https://admin.vps.org/api/v1/locations/');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer YOUR_API_TOKEN',
'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$locations = json_decode($response, true);
curl_close($ch);
{
"count": 1,
"next": null,
"previous": null,
"results": [
{
"id": 1,
"name": "New Jersey",
"country_name": "United States",
"country_code": "US",
"is_active": true
}
]
}
| Isku-darka | Nooca | Tilmaamaha |
|---|---|---|
id |
integer | Magaca goobta. U isticmaal sida location_id marka aad abuurto server. |
name |
string | Magaca meelaha la akhrin karo |
country_name |
string | Dalka meesha ku taal |
country_code |
string | ISO 3166-1 alpha-2 koodka waddanka, xarfo waaweyn |
is_active |
boolean | Haddii goobta ay aqbali doonto servers cusub |
| 200 | Liiska goobaha si guul leh ayaa loo soo ceshaday |
| 403 | Xiran ama aan sharci ahayn API token, ama token ka maqan oggolaanshaha loo baahan yahay |
Ka soo kabsado meel kaliya by id-kiisa. jawaabta waa mid meel wax la goobaha kor ku xusan.
curl -X GET "https://admin.vps.org/api/v1/locations/1/" \
-H "Authorization: Bearer YOUR_API_TOKEN"
{
"id": 1,
"name": "New Jersey",
"country_name": "United States",
"country_code": "US",
"is_active": true
}
Server kasta VPS.org hadda socda in New Jersey, USA goobta, oo ka adeega macaamiisha adduunka oo dhan IPv4 iyo IPv6. Mar kasta akhri goobaha endpoint ka badan hardcoding id, sidaas darteed integration aad u qaado goobaha cusub marka ay la daray.