Ilista ang mga lokasyon kung saan maaari mong i-deploy ang isang VPS. Magpasa ng isang lokasyon ng id bilang location_id kapag lumikha ka ng isang server.
Bumuo ng isang listahan ng lahat ng mga magagamit na datacenter lokasyon kung saan maaari mong i-deploy VPS server.
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
}
]
}
| Patlang | Uri | Paglalarawan |
|---|---|---|
id |
integer | Location identifier. Gamitin ito bilang location_id kapag lumilikha ng isang server. |
name |
string | Human-mababasa pangalan ng lokasyon |
country_name |
string | Bansa ang lokasyon ay sa |
country_code |
string | ISO 3166-1 alpha-2 code ng bansa, uppercase |
is_active |
boolean | Kung ang lokasyon ay tumatanggap ng mga bagong server |
| 200 | Matagumpay na nakuha ang listahan ng mga lokasyon |
| 403 | Walang o hindi wastong API token, o ang token ay kulang ang kinakailangang pahintulot |
Bumuo ng isang solong lokasyon sa pamamagitan ng kanyang id. Ang tugon ay isang lokasyon bagay sa mga patlang sa itaas.
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
}
Ang bawat VPS.org server ay kasalukuyang tumatakbo sa aming New Jersey, USA lokasyon, na nagsisilbi sa mga customer sa buong mundo sa IPv4 at IPv6. Palaging basahin ang mga lokasyon endpoint sa halip na hardcoding ng isang id, kaya ang iyong pagsasama picks up bagong lokasyon kapag sila ay idinagdag.