VPS.org API

Àwọn Àkọsílẹ̀ API REST

Àwọn fọ́tò ìfàsẹ́yìn API

Gba àwọn àwòrán àìdálẹ̀ tí a tí àmì-ìwé kọ̀ǹpútà, ṣàfihàn àwọn náà àti pa àwọn tí o kò fẹ́.

Àwọn ìparí 4
Ipa-ọna Ipilẹ /api/v1/snapshots
GBÀ /api/v1/snapshots/

Ṣe àkójọ gbogbo àwọn fọ́tò ìkọ̀wé

Returns the snapshots in your account, newest first, 25 per page.

Àwọn ìkúndùǹ tí a fẹ́: snapshots:list

Àpẹẹrẹ Ìbéèrè

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);

Àpẹẹrẹ Ìdáhùn

{
  "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
    }
  ]
}

Àwọn Ààyè Ìdáhùn

Àwọn Ààyè-iṣẹ́ Irú Àwọn Àkọlé
uuid string Àtòjọ-ètò ìṣàfihàn (àwọn àbùdá hexadecimal 32, kò ní àwọn àgbèwọlé)
label string Àwọn àmì-ìwé tí a fì pamọ́ láti ìṣàmúlò-ètò náà
server_hostname string Hostname of the server the snapshot was taken from, or null if that server no longer exists
ready boolean Àwọn àwọn ààtò àwọn ààtò àwọn ààtò
deleting boolean Àwọn àwọn ààtò àwọn ààtò àwọn ààtò àwọn ààtò
created_at datetime Creation time (ISO 8601, UTC)
size_gb number Ìwọ̀n àwọn ààyè-iṣẹ́ nínú gigabaiti
GBÀ /api/v1/snapshots/{uuid}/

Gba àwòrán

Ń pàtó àwọn ààyè-iṣẹ́ àwọn ààyè-iṣẹ́ inú àwọn ààyè-iṣẹ́ inú àwọn ààyè-iṣẹ́ inú. Lò láti fi àwọn ààyè-iṣẹ́ pamọ́ láti sé ìṣàfarawé àwọn ààyè-iṣẹ́ láti inú àwọn ààyè-iṣẹ́.

curl -X GET "https://admin.vps.org/api/v1/snapshots/3f9a1c0e5b7d4e2f8a6c1b3d5e7f9a0b/" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
Àwọn Àkọlé /api/v1/servers/{uuid}/snapshot/

Ṣẹ̀dà Àwọn Àwòrán

Queues a snapshot of a deployed server and returns the new snapshot's uuid. The snapshot is listed straight away with ready set to false.

Àwọn ìkúndùǹ tí a fẹ́: servers:snapshot

Ìbéèrè fún Àwọn Ìwọ̀n Ara

Àwọn Àtòjọ-ẹ̀yàn Irú Ti a nilo Àwọn Àkọlé
action string Bẹ́ẹ̀ni Ò yẹ ki o jẹ́ àwòrán
snapshot_label string Bẹ́ẹ̀ni Àwọn àmì-ìwé láti mọ́ àwòrán
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"])

Àpẹẹrẹ Ìdáhùn

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

Àwọn Kóòdù Ipò Ìdáhùn

200 Àwọn ìṣàmúlò-ètò
400 Àwọn ìṣàmúlò-ètò àti àwọn àmì-ìwé àwọn ìṣàmúlò-ètò kò wa, tàbí àwọn sáà kò tí a fi pamọ́
402 Kò ní ìṣàmúlò-ètò pàtó fún ìṣàmúlò-ètò nínú fáìlì, tàbí àwọn fátìrì tí a kò pà
404 Kò rí, tàbí ò jẹ́ àwọn
PARÍPÁRÁ /api/v1/snapshots/{uuid}/

Pa Àwòrán Paṣẹ

Fi àwọn àwòrán pamọ́ sínú ìṣàmúlò-ètò fún ìpàsẹ́ ìpele. ìpàsẹ́ jẹ́ òótọ́ titi tí o tì kù.

Àwọn ìkúndùǹ tí a fẹ́: snapshots:delete

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

Àwọn Kóòdù Ipò Ìdáhùn

202 A gba: àkóónú náà tí a fi pamọ́
404 Kò rí, tàbí ò jẹ́ àwọn

Àwọn Àmì-ìwé