Elenka l-postijiet fejn inti tista ’tpoġġi VPS. Pass id post bħala location_id meta toħloq server.
Iġbor lista tal-postijiet kollha disponibbli taċ-ċentru tad-data fejn tista' tuża servers 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
}
]
}
| Qasam | Tip | Deskrizzjoni |
|---|---|---|
id |
integer | Identifikatur tal-lokazzjoni. Użah bħala location_id meta toħloq server. |
name |
string | Isem tal-lokazzjoni li jinqara mill-bniedem |
country_name |
string | Pajjiż li fih tinsab il-lokalità |
country_code |
string | ISO 3166-1 alpha-2 kodiċi tal-pajjiż, każ kapitali |
is_active |
boolean | Jekk il-post qed jaċċetta servers ġodda |
| 200 | Lista ta' postijiet irkuprata b'suċċess |
| 403 | Token tal-API nieqes jew invalidu, jew it-token ma għandux il-permess meħtieġ |
Iġbor lokazzjoni waħda mill id tagħha. It-tweġiba hija oġġett lokazzjoni wieħed mal-oqsma hawn fuq.
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
}
Kull server VPS.org bħalissa jimxi fil-post tagħna New Jersey, USA, li jservi lill-klijenti madwar id-dinja fuq IPv4 u IPv6 Dejjem aqra l-postijiet endpoint pjuttost milli hardcoding id, sabiex integrazzjoni tiegħek picks up postijiet ġodda meta dawn huma miżjuda.