Liste die Orte auf, an denen du einen VPS bereitstellen kannst. Lege die ID eines Standorts als location_id vor, wenn du einen Server erstellst.
Rufen Sie eine Liste aller verfügbaren Rechenzentrumsstandorte auf, an denen Sie VPS-Server bereitstellen können.
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
}
]
}
| Feld | Typ | Description |
|---|---|---|
id |
integer | Standortkennung. Verwenden Sie es als location_id beim Erstellen eines Servers. |
name |
string | Name des lesbaren Ortes |
country_name |
string | Land ist der Standort in |
country_code |
string | ISO 3166-1 Alpha-2-Ländercode, Großbuchstaben |
is_active |
boolean | Ob der Standort neue Server akzeptiert |
| 200 | Liste der Standorte erfolgreich abgerufen |
| 403 | Fehlendes oder ungültiges API-Token oder dem Token fehlt die erforderliche Berechtigung |
Abrufen eines einzigen Standorts durch seine ID. Die Antwort ist ein Standortobjekt mit den oben genannten Feldern.
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
}
Jeder VPS.org Server läuft derzeit in unserem Standort New Jersey, USA, der Kunden weltweit über IPv4 und IPv6 bedient. Lesen Sie immer den Endpunkt der Standorte statt einer Hardcodierung einer ID, so dass Ihre Integration neue Standorte aufnimmt, wenn sie hinzugefügt werden.