Liston pozicionet ku mund të instaloni një VPS. Përcille id-në e një pozicioni si location_id kur krijon një server.
Merr një listë gjitha vendeve të disponueshme të qendrave të të dhënave ku mund të vendosësh serverët 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
}
]
}
| Fusha | Lloji | Përshkrimi |
|---|---|---|
id |
integer | Identifikuesi i pozicionit. Përdoret si location_id kur krijohet një server. |
name |
string | Emri i pozicionit në mënyrë të lexueshme |
country_name |
string | Vendi ku ndodhet pozicioni |
country_code |
string | Kodi i vendit ISO 3166-1 alfa-2, shkronja e madhe |
is_active |
boolean | Nëse pozicioni pranon serverë të rinj |
| 200 | Lista e vendndodhjeve u mor me sukses |
| 403 | Token i munguar apo i pavlefshëm API, ose token nuk ka të drejtat e kërkuara |
Merr një pozicion të vetëm sipas id-së së tij. Përgjigjia është një objekt pozicioni me fushat e mësipërme.
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
}
Çdo server VPS.org aktualisht rrjedh në pozicionin tonë në New Jersey, SHBA, i cili u shërben klientëve në mbarë botën nëpërmjet IPv4 dhe IPv6. Gjithmonë lexon pozicionet e pikës së fundit në vend të kodimit të id-së, kështu që integrimi juaj merr pozicionet e reja kur ato shtohen.