VPS.org API

ማስረጃ

የአካባቢዎች ኤፒአይ

VPSን ሊያስተላልፉ የሚችሉበትን ቦታዎች ዝርዝር ያሳያል። ሰርቨር ሲፈጥሩ የቦታውን id እንደ location_id አድርገው ይለጥፉ።

የመጨረሻ ነጥቦች 2 endpoints
የመሠረት መንገድ /api/v1/locations
አግኝ /api/v1/locations/

ሁሉንም ቦታዎች ዘርዝር

የሁሉም የተገኙ የዳታ ማዕከል ቦታዎች ዝርዝር ማግኘት VPS ሰርቨሮችን ማሰራጨት ይችላሉ.

የምሳሌ ጥያቄ

cURL
Python
JavaScript
PHP
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 country code, uppercase
is_active boolean ቦታው አዲስ ሰርቨሮችን እንደሚቀበል

የምላሽ ሁኔታ ኮዶች

200 የአካባቢዎች ዝርዝር በተሳካ ሁኔታ ተገኝቷል
403 የጠፋ ወይም ያልሆነ API Token ወይም Token የተጠየቀውን ፈቃድ የሌለው ነው
አግኝ /api/v1/locations/{id}/

ቦታ

አንድ ቦታ በIDው ተመልከት። መልሱ በላይ ያሉትን መስኮቶች የያዘ አንድ ቦታ ነው

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 አንድ id አንብብ, ስለዚህ አንድነትዎ አዲስ ቦታዎች እነርሱ ተጨመሩ ጊዜ ይይዛል.