List the locations where you can deploy a VPS. Pass a location's id as location_id when you create a server.
Retrieve a list of all available datacenter locations where you can deploy 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
}
]
}
| _Firi | Rudzi | Kutaura |
|---|---|---|
id |
integer | Mufananidzo wenzvimbo. Usaishandisa selocation_id paunenge uchigadzira server. |
name |
string | Chinyorwa chenzvimbo |
country_name |
string | Country the location is in |
country_code |
string | ISO 3166-1 alpha-2 country code, uppercase |
is_active |
boolean | Kana nzvimbo iri kugamuchira maserver matsva |
| 200 | Ndakabudirira kuwana runyorwa rwenzvimbo |
| 403 | Kukanganisa kweAPI Token kana kuti Token haina mvumo yakakodzera |
Retrieve imwe nzvimbo neID yake. Mubvunzo ndeimwe nzvimbo chinhu nemadziro pamusoro.
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
}
Every VPS.org server ikozvino rinofamba muNew Jersey, USA nzvimbo, iyo inoshandira vatengi pasi rese pamusoro IPv4 uye IPv6. Always kuverenga nzvimbo endpoint kupfuura hardcoding id, saka yako kubatanidzwa anotora pamusoro matsva nzvimbo apo vawedzera.