သင်သည် VPS ကိုဖြန့်ချိနိုင်သည့်နေရာများစာရင်း။ သင်သည်ဆာဗာတစ်ခုဖန်တီးတဲ့အခါ location_id အဖြစ်နေရာတစ်ခု၏ id ကိုပေးပို့ပါ။
သင် VPS ဆာဗာများဖြန့်ချိနိုင်သည့်နေရာတိုင်းရရှိနိုင် datacenter တည်နေရာများ၏စာရင်းကိုရယူပါ။
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 သည်လိုအပ်သောခွင့်ပြုချက်မရှိပါ |
၎င်း၏ id ကိုအားဖြင့်တစ်ဦးတည်းသောနေရာကိုရယူပါ. တုံ့ပြန်မှုအပေါ်က Fields များနှင့်အတူတစ်နေရာတည်းမှာ object ကိုဖြစ်ပါသည်.
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 server ကိုလက်ရှိကျွန်တော်တို့ရဲ့နယူးဂျာစီမှာ runs, အမေရိကန်နိုင်ငံတည်နေရာ, IPv4 နှင့် IPv6 ကျော်ကမ္ဘာတစ်ဝှမ်းဖောက်သည်များကိုဝန်ဆောင်မှုပေးသော. အမြဲတစ်ဦး id ကို hardcoding ထက်နေရာများ endpoint ကိုဖတ်ပါ, သူတို့ထည့်သွင်းတဲ့အခါသင့်ရဲ့ပေါင်းစည်းမှုအသစ်နေရာများ picks up so.