VPS.org API

REST API 문서화

위치 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 알파-2 국가 코드, 대문자
is_active boolean 위치가 새 서버를 허용하는지 여부

응답 상태 코드

200 위치 목록을 성공적으로 가져왔습니다.
403 API 토큰이 누락되었거나 잘못되었거나 토큰에 필요한 권한이 없습니다.
얻다 /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를 통해 전 세계 고객을 서비스하는 미국 위치. 항상 읽기 위치 엔드 포인트보다는 하드 코딩 id, 그래서 통합이 추가 될 때 새로운 위치를 선택합니다.