Kulemba malo kumene mungagwiritse ntchito VPS. Kupita id malo monga location_id pamene inu mupange server.
Pezani mnda wa ma datacenter onse omwe alipo komwe mungagwiritse ntchito ma seva a 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
}
]
}
| Kuwala | Mtundu | Kufotokozera |
|---|---|---|
id |
integer | Kudziwitsa komwe kuli. Ikani monga location_id pamene mukupanga server. |
name |
string | dzina la malo lowerengeka ndi munthu |
country_name |
string | Kuchokera ku dziko |
country_code |
string | ISO 3166-1 alpha-2 code ya dziko, malemba akulu |
is_active |
boolean | Ngati malowa akulandiranso ma seva atsopano |
| 200 | Ndapeza bwino mnda wa malo |
| 403 | Kukayika kapena ayi API token, kapena token alibe zofunika chilolezo |
Kupeza malo amodzi ndi id yake. Kuyankha ndi malo amodzi chinthu ndi nyanja pamwamba.
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
}
Zonse VPS.org server pano amayenda m'dera lathu la New Jersey, USA, lomwe limathandizira makasitomala padziko lonse lapansi pa IPv4 ndi IPv6. Nthawi zonse onani malo omaliza osati hardcoding id, kotero kuphatikizidwa kwanu kumatenga malo atsopano pamene akuwonjezedwa.