VPS.org API

REST API 문서화

스냅샷 API

서버의 라벨이 있는 스냅샷을 찍고, 나열하고, 더 이상 필요하지 않은 스냅샷을 삭제합니다.

엔드포인트 4
기본 경로 /api/v1/snapshots
얻다 /api/v1/snapshots/

모든 스냅샷 목록 보기

계정의 스냅샷을 최신 부터 페이지 당 25개까지 반환합니다.

필요한 권한: snapshots:list

예시 요청

cURL
Python
JavaScript
curl -X GET "https://admin.vps.org/api/v1/snapshots/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
import requests

url = "https://admin.vps.org/api/v1/snapshots/"
headers = {"Authorization": "Bearer YOUR_API_TOKEN"}

response = requests.get(url, headers=headers)
for snapshot in response.json()["results"]:
    print(snapshot["uuid"], snapshot["label"], snapshot["ready"])
const response = await fetch('https://admin.vps.org/api/v1/snapshots/', {
  headers: { 'Authorization': 'Bearer YOUR_API_TOKEN' }
});

const data = await response.json();
console.log(data.results);

예시 답변

{
  "count": 1,
  "next": null,
  "previous": null,
  "results": [
    {
      "uuid": "3f9a1c0e5b7d4e2f8a6c1b3d5e7f9a0b",
      "label": "before-upgrade",
      "server_hostname": "web-01",
      "ready": true,
      "deleting": false,
      "created_at": "2026-09-14T18:30:00.000000Z",
      "size_gb": 3.4
    }
  ]
}

응답 필드

필드 유형 설명
uuid string 스냅샷 식별자(32개의 16진수 문자, 하이픈 없음)
label string 스냅샷을 만드는 동안 주어진 레이블
server_hostname string 스냅샷을 찍은 서버의 호스트 이름, 서버가 더 이상 존재하지 않는 경우에는 null
ready boolean 스냅샷이 끝나면 True
deleting boolean 삭제가 진행 중일 때 True
created_at datetime 생성 시간 (ISO 8601, UTC)
size_gb number 기가바이트 단위의 압축 크기
얻다 /api/v1/snapshots/{uuid}/

스냅샷 얻기

위의 필드를 가진 스냅샷 객체를 반환합니다. 스냅샷을 만든 후에 준비된 폴링을 위해 이것을 사용합니다.

curl -X GET "https://admin.vps.org/api/v1/snapshots/3f9a1c0e5b7d4e2f8a6c1b3d5e7f9a0b/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
메시지 /api/v1/servers/{uuid}/snapshot/

스냅샷 만들기

배포된 서버의 스냅샷을 대기열에 넣고 새 스냅샷의 uuid를 반환합니다. ready 를 false로 설정한 상태에서 스냅샷이 즉시 나열됩니다.

필요한 권한: servers:snapshot

요청 본문 매개변수

파라미터 유형 필수의 설명
action string 예 스냅샷이어야 합니다
snapshot_label string 예 스냅샷을 인식하는 레이블
cURL
Python
curl -X POST "https://admin.vps.org/api/v1/servers/8c4f2a1e-5b3d-4e6f-9a7b-1c2d3e4f5a6b/snapshot/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"action": "snapshot", "snapshot_label": "before-upgrade"}'
import requests

server_uuid = "8c4f2a1e-5b3d-4e6f-9a7b-1c2d3e4f5a6b"
url = f"https://admin.vps.org/api/v1/servers/{server_uuid}/snapshot/"
headers = {"Authorization": "Bearer YOUR_API_TOKEN"}
data = {"action": "snapshot", "snapshot_label": "before-upgrade"}

response = requests.post(url, headers=headers, json=data)
print(response.json()["snapshot_uuid"])

예시 답변

{
  "message": "Snapshot queued successfully",
  "snapshot_uuid": "3f9a1c0e5b7d4e2f8a6c1b3d5e7f9a0b"
}

응답 상태 코드

200 동작이 대기열에 올랐습니다
400 action 또는 snapshot_label이 없거나 서버가 아직 배포되지 않았습니다.
402 파일에 결제 방법이 없거나 미지급 청구서
404 찾을 수 없거나 다른 계정에 속합니다.
삭제 /api/v1/snapshots/{uuid}/

스냅샷 삭제

영구 삭제를 위해 스냅샷을 줄 서게 합니다. 삭제가 끝날 때까지 참입니다.

필요한 권한: snapshots:delete

curl -X DELETE "https://admin.vps.org/api/v1/snapshots/3f9a1c0e5b7d4e2f8a6c1b3d5e7f9a0b/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "message": "Snapshot deletion queued"
}

응답 상태 코드

202 승인됨: 요청이 대기열에 올랐습니다
404 찾을 수 없거나 다른 계정에 속합니다.

메모