Loetlege asukohad, kus saab kasutada VPS- i. Kui luua server, annage asukoha ID asukoha_ id.
Hangi nimekiri kõikidest saadaolevatest andmekeskuse asukohtadest, kus saab kasutada VPS servereid.
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
}
]
}
| Väli | Tüüp | Description |
|---|---|---|
id |
integer | Asukoha identifikaator. Kasuta seda serveri loomisel asukoha_ id- ina. |
name |
string | Inimloetava asukoha nimi |
country_name |
string | Riik, kus asukoht asub |
country_code |
string | ISO 3166-1 alpha-2 country code, uppercase |
is_active |
boolean | Kas asukoht võtab vastu uusi servereid |
| 200 | Asukohtade loend on edukalt alla laaditud |
| 403 | Puuduv või vigane API märgis või märgil puudub nõutav luba |
Otsib ID- ga ühe asukoha. Vastus on üks asukohaobjekt, mille väljad on eespool.
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
}
Iga VPS.org server töötab praegu meie New Jersey, USA asukoht, mis teenindab kliente üle kogu maailma IPv4 ja IPv6. Alati lugeda asukohti tulemusnäitaja asemel hardcoding id, nii oma integratsiooni korjab uusi asukohti, kui nad on lisatud.