Listi yfir staðsetningar þar sem þú getur sett upp VPS. Sendu auðkenni staðsetningar sem location_ id þegar þú býrð til miðlara.
Sækja lista yfir alla tiltæka gagnamiðstöðvarstaði þar sem þú getur dreift VPS netþjónum.
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
}
]
}
| Field | Tegund | Lýsing |
|---|---|---|
id |
integer | Staðsetningar auðkenni. Notaðu það sem location_id þegar þú býrð til þjón. |
name |
string | Lesanlegt heiti staðsetningar |
country_name |
string | Land sem staðsetningin er í |
country_code |
string | ISO 3166-1 alfa-2 landsnúmer, hástafir |
is_active |
boolean | Hvort staðsetningin samþykkir nýja þjóna |
| 200 | Listi yfir staðsetningar sóttur |
| 403 | Vantar eða ógilt API tákn, eða táknið hefur ekki nauðsynleg leyfi |
Sækja einn staðsetningu með id þess. Svarið er einn staðsetning hlutur með reiti ofan.
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
}
Sérhver VPS.org netþjónn keyrir nú í New Jersey, Bandaríkjunum staðsetningu okkar, sem þjónar viðskiptavinum um allan heim yfir IPv4 og IPv6. Alltaf lesa staðsetningar endapunktinn frekar en hardcoding auðkenni, þannig að samþætting þín tekur upp nýja staði þegar þeim er bætt við.