VPS.org API

REST API ഡോക്യുമെന്റേഷൻ

സ്നാപ്പ്ഷോട്ട് API

വേഗത്തിലുള്ള പോയിന്റ്-ഇൻ-ടൈം പുനഃസ്ഥാപനത്തിനായി സെർവർ സ്നാപ്പ്ഷോട്ടുകൾ കൈകാര്യം ചെയ്യുക. സ്നാപ്പ്ഷോട്ടുകൾ നിങ്ങളുടെ സെർവറിന്റെ പൂർണ്ണമായ അവസ്ഥ പകർത്തുന്നു.

എൻഡ്‌പോയിന്റുകൾ 4 endpoints
ബേസ് പാത്ത് /api/v1/snapshots
നേടുക /api/v1/snapshots/

എല്ലാ സ്നാപ്പ്ഷോട്ടുകളും ലിസ്റ്റുചെയ്യുക

നിങ്ങളുടെ സെർവറുകളിലുടനീളമുള്ള എല്ലാ സ്നാപ്പ്ഷോട്ടുകളുടെയും ഒരു ലിസ്റ്റ് വീണ്ടെടുക്കുക.

അന്വേഷണ പാരാമീറ്ററുകൾ

പാരാമീറ്റർ ടൈപ്പ് ചെയ്യുക ആവശ്യമാണ് വിവരണം
server_id integer ഇല്ല സെർവർ ഐഡി പ്രകാരം സ്നാപ്പ്ഷോട്ടുകൾ ഫിൽട്ടർ ചെയ്യുക

ഉദാഹരണ അഭ്യർത്ഥന

cURL
Python
JavaScript
curl -X GET "https://admin.vps.org/api/v1/snapshots/?server_id=12345" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
import requests

url = "https://admin.vps.org/api/v1/snapshots/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
params = {"server_id": 12345}

response = requests.get(url, headers=headers, params=params)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/snapshots/?server_id=12345', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

const snapshots = await response.json();
console.log(snapshots);

ഉദാഹരണ പ്രതികരണം

{
  "count": 2,
  "results": [
    {
      "id": 801,
      "server": {
        "id": 12345,
        "name": "web-server-01"
      },
      "name": "pre-migration-snapshot",
      "status": "completed",
      "size_mb": 5120,
      "created_at": "2025-01-15T18:30:00Z",
      "description": "Before major migration"
    },
    {
      "id": 798,
      "server": {
        "id": 12345,
        "name": "web-server-01"
      },
      "name": "weekly-snapshot-2025-01-08",
      "status": "completed",
      "size_mb": 4856,
      "created_at": "2025-01-08T12:00:00Z",
      "description": "Weekly snapshot"
    }
  ]
}

പ്രതികരണ സ്റ്റാറ്റസ് കോഡുകൾ

200 സ്നാപ്പ്ഷോട്ട് ലിസ്റ്റ് വിജയകരമായി വീണ്ടെടുത്തു.
401 അംഗീകൃതമല്ല - പ്രാമാണീകരണ ടോക്കൺ അസാധുവാണ് അല്ലെങ്കിൽ നഷ്ടപ്പെട്ടിരിക്കുന്നു.
പോസ്റ്റ് /api/v1/snapshots/

സ്നാപ്പ്ഷോട്ട് സൃഷ്ടിക്കുക

Create a snapshot of a server's current state. Snapshots are point-in-time copies of the entire server.

ബോഡി പാരാമീറ്ററുകൾ അഭ്യർത്ഥിക്കുക

പാരാമീറ്റർ ടൈപ്പ് ചെയ്യുക ആവശ്യമാണ് വിവരണം
server_id integer അതെ സ്നാപ്പ്ഷോട്ട് എടുക്കേണ്ട സെർവറിന്റെ ഐഡി
name string അതെ സ്നാപ്പ്ഷോട്ടിന്റെ പേര് (ആൽഫാന്യൂമെറിക്, ഹൈഫനുകൾ, അണ്ടർസ്കോറുകൾ)
description string ഇല്ല സ്നാപ്പ്ഷോട്ടിനുള്ള ഓപ്ഷണൽ വിവരണം

ഉദാഹരണ അഭ്യർത്ഥന

cURL
Python
JavaScript
curl -X POST "https://admin.vps.org/api/v1/snapshots/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "server_id": 12345,
    "name": "before-update-snapshot",
    "description": "Snapshot before system update"
  }'
import requests

url = "https://admin.vps.org/api/v1/snapshots/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "server_id": 12345,
    "name": "before-update-snapshot",
    "description": "Snapshot before system update"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/snapshots/', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    server_id: 12345,
    name: 'before-update-snapshot',
    description: 'Snapshot before system update'
  })
});

const snapshot = await response.json();
console.log(snapshot);

ഉദാഹരണ പ്രതികരണം

{
  "id": 802,
  "server": {
    "id": 12345,
    "name": "web-server-01"
  },
  "name": "before-update-snapshot",
  "status": "in_progress",
  "size_mb": null,
  "created_at": "2025-01-16T16:15:00Z",
  "description": "Snapshot before system update",
  "message": "Snapshot is being created. This may take 3-10 minutes depending on server size."
}

പ്രതികരണ സ്റ്റാറ്റസ് കോഡുകൾ

201 സ്നാപ്പ്ഷോട്ട് സൃഷ്ടിക്കൽ വിജയകരമായി ആരംഭിച്ചു.
400 Bad Request - Invalid parameters or snapshot limit reached
401 അംഗീകൃതമല്ല - പ്രാമാണീകരണ ടോക്കൺ അസാധുവാണ് അല്ലെങ്കിൽ നഷ്ടപ്പെട്ടിരിക്കുന്നു.
404 Not Found - Server does not exist
കുറിപ്പ്: You can have a maximum of 5 snapshots per server. Creating a snapshot while the server is running may result in filesystem inconsistencies. For best results, stop the server before creating a snapshot.
പോസ്റ്റ് /api/v1/snapshots/{snapshot_id}/restore/

സ്നാപ്പ്ഷോട്ടിൽ നിന്ന് പുനഃസ്ഥാപിക്കുക

Restore a server to the state captured in a snapshot. This will overwrite all current data on the server.

പാത പാരാമീറ്ററുകൾ

പാരാമീറ്റർ ടൈപ്പ് ചെയ്യുക ആവശ്യമാണ് വിവരണം
snapshot_id integer അതെ തനതായ സ്നാപ്പ്ഷോട്ട് ഐഡി

ഉദാഹരണ അഭ്യർത്ഥന

cURL
Python
JavaScript
curl -X POST "https://admin.vps.org/api/v1/snapshots/801/restore/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
import requests

snapshot_id = 801
url = f"https://admin.vps.org/api/v1/snapshots/{snapshot_id}/restore/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers)
print(response.json())
const snapshotId = 801;
const response = await fetch(`https://admin.vps.org/api/v1/snapshots/${snapshotId}/restore/`, {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

const result = await response.json();
console.log(result);

ഉദാഹരണ പ്രതികരണം

{
  "status": "success",
  "message": "Server is being restored from snapshot. This may take 5-15 minutes.",
  "snapshot": {
    "id": 801,
    "name": "pre-migration-snapshot",
    "created_at": "2025-01-15T18:30:00Z"
  },
  "server": {
    "id": 12345,
    "name": "web-server-01",
    "status": "restoring"
  }
}

പ്രതികരണ സ്റ്റാറ്റസ് കോഡുകൾ

200 പുനഃസ്ഥാപിക്കൽ വിജയകരമായി ആരംഭിച്ചു.
400 Bad Request - Server is not in a valid state for restoration
401 അംഗീകൃതമല്ല - പ്രാമാണീകരണ ടോക്കൺ അസാധുവാണ് അല്ലെങ്കിൽ നഷ്ടപ്പെട്ടിരിക്കുന്നു.
404 കണ്ടെത്തിയില്ല - സ്നാപ്പ്ഷോട്ട് നിലവിലില്ല.
മുന്നറിയിപ്പ്: Restoring from a snapshot will overwrite all current data on the server. This action cannot be undone. The server will be automatically stopped before restoration begins.
ഇല്ലാതാക്കുക /api/v1/snapshots/{snapshot_id}/

സ്നാപ്പ്ഷോട്ട് ഇല്ലാതാക്കുക

ഒരു സ്നാപ്പ്ഷോട്ട് ശാശ്വതമായി ഇല്ലാതാക്കുക. ഈ പ്രവർത്തനം പഴയപടിയാക്കാൻ കഴിയില്ല.

പാത പാരാമീറ്ററുകൾ

പാരാമീറ്റർ ടൈപ്പ് ചെയ്യുക ആവശ്യമാണ് വിവരണം
snapshot_id integer അതെ തനതായ സ്നാപ്പ്ഷോട്ട് ഐഡി

ഉദാഹരണ അഭ്യർത്ഥന

cURL
Python
curl -X DELETE "https://admin.vps.org/api/v1/snapshots/801/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json"
import requests

snapshot_id = 801
url = f"https://admin.vps.org/api/v1/snapshots/{snapshot_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}

response = requests.delete(url, headers=headers)
print(response.status_code)

പ്രതികരണ സ്റ്റാറ്റസ് കോഡുകൾ

204 സ്നാപ്പ്ഷോട്ട് വിജയകരമായി ഇല്ലാതാക്കി
401 അംഗീകൃതമല്ല - പ്രാമാണീകരണ ടോക്കൺ അസാധുവാണ് അല്ലെങ്കിൽ നഷ്ടപ്പെട്ടിരിക്കുന്നു.
404 കണ്ടെത്തിയില്ല - സ്നാപ്പ്ഷോട്ട് നിലവിലില്ല.

Snapshots vs Backups

Understanding when to use snapshots versus backups:

സ്നാപ്പ്ഷോട്ട് API

  • ഉദ്ദേശ്യം: Quick point-in-time recovery
  • വേഗത: Faster to create and restore (3-15 min)
  • കേസ് ഉപയോഗിക്കുക: Before risky operations (updates, config changes)
  • സംഭരണം: Stored on same infrastructure
  • പരിധി: 5 snapshots per server
  • ഏറ്റവും മികച്ചത്: Short-term rollback capability

ബാക്കപ്പുകൾ API

  • ഉദ്ദേശ്യം: Long-term data protection
  • വേഗത: Slower to create and restore (varies)
  • കേസ് ഉപയോഗിക്കുക: Regular automated data protection
  • സംഭരണം: Separate backup storage
  • പരിധി: 10 manual + automatic backups
  • ഏറ്റവും മികച്ചത്: Disaster recovery and compliance

Best Practices