మీరు VPS ను రికార్డింగ్ చేయగల స్థానములను జాబితాగా చూపుము. మీరు ఒక సెర్వర్ను సృష్టించినప్పుడు స్థానముగా ఒక స్థానముయొక్క ID_ 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 | స్థానము గుర్తింపుదారి. సెర్వర్ను సృష్టించుచున్నప్పుడు దీనిని స్థానము_ IDగా వుపయోగించుము. |
name |
string | మానవుడు చదవలేని స్థానము పేరు |
country_name |
string | దేశము స్థానము వద్ద |
country_code |
string | ISO 3166-1 ఆల్ఫా-2 దేశ కోడ్, పెద్ద అక్షరాలలో. |
is_active |
boolean | స్థానము కొత్త సెర్వర్లను ఆమోదించుచున్నదా |
| 200 | స్థానాల జాబితాను విజయవంతంగా తిరిగి పొందారు |
| 403 | చెల్లని API గుర్తు లేదా అవసరమైన సూచనకు లేదా గుర్తించవలసిన అనుమతి లేదు |
సౌలభ్యంతో ఒక స్థానాన్ని దాని గుర్తింపుతో వెలికితీయుము. స్పందన ఒక స్థానము మాత్రమే పైనున్న క్షేత్రాలతో వుమ్మంటుంది.
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 ద్వారా ప్రపంచవ్యాప్తంగా ఉన్న వినియోగదారులకు సేవలను అందిస్తున్నాయి. మీరు ఐడీలను నేరుగా ప్రోగ్రామ్లో పొందుపరచడానికి బదులుగా, ఎల్లప్పుడూ "స్థానాలు" (locations) అనే ఎండ్పాయింట్ను ఉపయోగించండి. దీనివల్ల, కొత్త స్థానాలు జోడించబడినప్పుడు, మీ అనుసంధానం (integration) వాటిని స్వయంచాలకంగా గుర్తించగలదు.