Linganisa izindawo lapho ungafaka khona i-VPS. Phatha indawo ye-id njenge-location_id uma kwenza isisebenzisi.
Thola uhlu lwazo zonke izindawo ezikhona zendawo yokugcina idatha lapho ungafaka khona amaseva we-VPS.
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
}
]
}
| Isigaba | Uhlobo | Incazelo |
|---|---|---|
id |
integer | Isibonisi sendawo. Sebenzisa njengendawo_id uma udala isisebenzisi. |
name |
string | Igama lendawo efundeka umuntu |
country_name |
string | Izwe lapho indawo ikhona khona |
country_code |
string | ISO 3166-1 alpha-2 ikhodi lezwe, inombolo enkulu |
is_active |
boolean | Uma ngabe indawo ivuma izisebenzisi ezintsha |
| 200 | Uhlu lwezindawo olutholwe ngempumelelo |
| 403 | I-API token elahlekile noma engasebenziyo, noma i-token ayinayo imvume edingekayo |
Thola indawo eyodwa nge-id yayo. Uphendulo luyindawo eyodwa yezinto ezinomthelela ezimbonini eziphezulu.
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
}
Zonke izisebenzisi VPS.org ngoku zihamba eNew Jersey, USA, indawo yethu, esiza amakhasimende emhlabeni wonke nge-IPv4 ne-IPv6. Khumbula ufunde indawo ekugcineni endaweni ngaphandle kokucofa i-id, ngakho-ke ukuhlanganisa kwakho kuthatha izindawo ezintsha uma zifakwa.