ລາຍຊື່ສະຖານທີ່ທີ່ທ່ານສາມາດຈັດຕັ້ງໃຊ້ VPS ໄດ້. ສົ່ງລະຫັດຕົວຕົນຂອງສະຖານທີ່ເປັນ location_ id ເມື່ອທ່ານສ້າງເຊີບເວີ.
ເອົາລາຍຊື່ຂອງສະຖານທີ່ສູນຂໍ້ມູນທີ່ໃຊ້ໄດ້ທັງຫມົດທີ່ທ່ານສາມາດນໍາໃຊ້ 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
}
]
}
| ແຄມເປນ | ປະເພດ | ຄໍາອະທິບາຍ |
|---|---|---|
id |
integer | ຕົວລະບຸສະຖານທີ່. ໃຊ້ມັນເປັນ location_id ເມື່ອສ້າງເຊີບເວີ. |
name |
string | ຊື່ທີ່ຕັ້ງທີ່ສາມາດອ່ານໄດ້ໂດຍມະນຸດ |
country_name |
string | ສະຖານທີ່ທີ່ຕັ້ງຢູ່ |
country_code |
string | ລະຫັດປະເທດ ISO 3166- 1 alpha-2, ຕົວອັກສອນໃຫຍ່ |
is_active |
boolean | ວ່າສະຖານທີ່ຈະຮັບເອົາເຄື່ອງເຊີບເວີໃໝ່ ຫຼື ບໍ່ |
| 200 | ດຶງຂໍ້ມູນລາຍຊື່ສະຖານທີ່ສຳເລັດແລ້ວ |
| 403 | API token ຂາດ ຫຼື ບໍ່ຖືກຕ້ອງ, ຫຼື token ບໍ່ມີສິດທີ່ຕ້ອງການ |
ເກັບເອົາສະຖານທີ່ດຽວໂດຍຜ່ານລະຫັດຕົວຕົນຂອງມັນ. ການຕອບຮັບແມ່ນສິ່ງຂອງສະຖານທີ່ດຽວກັບພື້ນທີ່ຂ້າງເທິງ.
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
}
ທຸກໆ VPS.org ເຊີເວີປະຈຸບັນແລ່ນໃນນິວເຈີຊີຂອງພວກເຮົາ, ສະຫະລັດອາເມລິກາສະຖານທີ່, ເຊິ່ງໃຫ້ບໍລິການລູກຄ້າທົ່ວໂລກຜ່ານ IPv4 ແລະ IPv6. ອ່ານຈຸດສຸດທ້າຍສະຖານທີ່ເປັນປົກກະຕິແທນທີ່ຈະເປັນ hardcoding ລະຫັດ, ດັ່ງນັ້ນການລວມຕົວຂອງທ່ານ picks up new locations when they are added.