រាយទីតាំងដែលអ្នកអាចបញ្ជូន 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.