VPS.org API

REST API ದಸ್ತಾವೇಜೀಕರಣ

ಬ್ಯಾಕಪ್‌ಗಳ API

ಸರ್ವರ್ ಬ್ಯಾಕಪ್‌ಗಳನ್ನು ಪ್ರೋಗ್ರಾಮ್ಯಾಟಿಕ್ ಆಗಿ ನಿರ್ವಹಿಸಿ. ನಿಮ್ಮ ಸರ್ವರ್‌ಗಳಿಗಾಗಿ ಬ್ಯಾಕಪ್‌ಗಳನ್ನು ಪಟ್ಟಿ ಮಾಡಿ, ರಚಿಸಿ, ಮರುಸ್ಥಾಪಿಸಿ ಮತ್ತು ಅಳಿಸಿ.

ಅಂತ್ಯಬಿಂದುಗಳು 3 endpoints
ಬೇಸ್ ಪಾತ್ /api/v1/backups
ಪಡೆಯಿರಿ /api/v1/backups/

ಎಲ್ಲಾ ಬ್ಯಾಕಪ್‌ಗಳನ್ನು ಪಟ್ಟಿ ಮಾಡಿ

ನಿಮ್ಮ ಸರ್ವರ್‌ಗಳಾದ್ಯಂತ ಎಲ್ಲಾ ಬ್ಯಾಕಪ್‌ಗಳ ಪಟ್ಟಿಯನ್ನು ಹಿಂಪಡೆಯಿರಿ.

ಪ್ರಶ್ನೆ ನಿಯತಾಂಕಗಳು

ಪ್ಯಾರಾಮೀಟರ್ ಪ್ರಕಾರ ಅಗತ್ಯವಿದೆ ವಿವರಣೆ
server_id integer ಇಲ್ಲ ಸರ್ವರ್ ಐಡಿ ಮೂಲಕ ಬ್ಯಾಕಪ್‌ಗಳನ್ನು ಫಿಲ್ಟರ್ ಮಾಡಿ
backup_type string ಇಲ್ಲ ಪ್ರಕಾರದ ಪ್ರಕಾರ ಫಿಲ್ಟರ್ ಮಾಡಿ: manual , automatic

ಉದಾಹರಣೆ ವಿನಂತಿ

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

url = "https://admin.vps.org/api/v1/backups/"
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/backups/?server_id=12345', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

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

ಉದಾಹರಣೆ ಪ್ರತಿಕ್ರಿಯೆ

{
  "count": 3,
  "results": [
    {
      "id": 501,
      "server": {
        "id": 12345,
        "name": "web-server-01"
      },
      "backup_type": "automatic",
      "status": "completed",
      "size_mb": 4523,
      "created_at": "2025-01-16T03:00:00Z",
      "expires_at": "2025-02-16T03:00:00Z",
      "description": "Automatic daily backup"
    },
    {
      "id": 499,
      "server": {
        "id": 12345,
        "name": "web-server-01"
      },
      "backup_type": "manual",
      "status": "completed",
      "size_mb": 4456,
      "created_at": "2025-01-14T10:30:00Z",
      "expires_at": null,
      "description": "Pre-update backup"
    },
    {
      "id": 495,
      "server": {
        "id": 12345,
        "name": "web-server-01"
      },
      "backup_type": "automatic",
      "status": "completed",
      "size_mb": 4389,
      "created_at": "2025-01-15T03:00:00Z",
      "expires_at": "2025-02-15T03:00:00Z",
      "description": "Automatic daily backup"
    }
  ]
}

ಪ್ರತಿಕ್ರಿಯೆ ಸ್ಥಿತಿ ಕೋಡ್‌ಗಳು

200 ಬ್ಯಾಕಪ್ ಪಟ್ಟಿಯನ್ನು ಯಶಸ್ವಿಯಾಗಿ ಹಿಂಪಡೆಯಲಾಗಿದೆ.
401 ಅನಧಿಕೃತ - ಅಮಾನ್ಯ ಅಥವಾ ಕಾಣೆಯಾದ ದೃಢೀಕರಣ ಟೋಕನ್
ಪೋಸ್ಟ್ /api/v1/backups/

ಹಸ್ತಚಾಲಿತ ಬ್ಯಾಕಪ್ ರಚಿಸಿ

ಸರ್ವರ್‌ನ ಹಸ್ತಚಾಲಿತ ಬ್ಯಾಕಪ್ ಅನ್ನು ರಚಿಸಿ. ಹಸ್ತಚಾಲಿತ ಬ್ಯಾಕಪ್‌ಗಳು ಸ್ವಯಂಚಾಲಿತವಾಗಿ ಅವಧಿ ಮೀರುವುದಿಲ್ಲ.

ವಿನಂತಿಯ ಮುಖ್ಯ ನಿಯತಾಂಕಗಳು

ಪ್ಯಾರಾಮೀಟರ್ ಪ್ರಕಾರ ಅಗತ್ಯವಿದೆ ವಿವರಣೆ
server_id integer ಹೌದು ಬ್ಯಾಕಪ್ ಮಾಡಲು ಸರ್ವರ್‌ನ ಐಡಿ
description string ಇಲ್ಲ ಬ್ಯಾಕಪ್‌ಗಾಗಿ ಐಚ್ಛಿಕ ವಿವರಣೆ

ಉದಾಹರಣೆ ವಿನಂತಿ

cURL
Python
JavaScript
PHP
curl -X POST "https://admin.vps.org/api/v1/backups/" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "server_id": 12345,
    "description": "Pre-deployment backup"
  }'
import requests

url = "https://admin.vps.org/api/v1/backups/"
headers = {
    "Authorization": "Bearer YOUR_API_TOKEN",
    "Content-Type": "application/json"
}
data = {
    "server_id": 12345,
    "description": "Pre-deployment backup"
}

response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch('https://admin.vps.org/api/v1/backups/', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    server_id: 12345,
    description: 'Pre-deployment backup'
  })
});

const backup = await response.json();
console.log(backup);
$data = [
    'server_id' => 12345,
    'description' => 'Pre-deployment backup'
];

$ch = curl_init('https://admin.vps.org/api/v1/backups/');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_TOKEN',
    'Content-Type: application/json'
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
$backup = json_decode($response, true);
curl_close($ch);

ಉದಾಹರಣೆ ಪ್ರತಿಕ್ರಿಯೆ

{
  "id": 502,
  "server": {
    "id": 12345,
    "name": "web-server-01"
  },
  "backup_type": "manual",
  "status": "in_progress",
  "size_mb": null,
  "created_at": "2025-01-16T15:45:00Z",
  "expires_at": null,
  "description": "Pre-deployment backup",
  "message": "Backup is being created. This may take several minutes depending on server size."
}

ಪ್ರತಿಕ್ರಿಯೆ ಸ್ಥಿತಿ ಕೋಡ್‌ಗಳು

201 ಬ್ಯಾಕಪ್ ರಚನೆಯನ್ನು ಯಶಸ್ವಿಯಾಗಿ ಪ್ರಾರಂಭಿಸಲಾಗಿದೆ.
400 ಕೆಟ್ಟ ವಿನಂತಿ - ಅಮಾನ್ಯ ಪ್ಯಾರಾಮೀಟರ್‌ಗಳು ಅಥವಾ ದೋಷಪೂರಿತ ವಿನಂತಿ
401 ಅನಧಿಕೃತ - ಅಮಾನ್ಯ ಅಥವಾ ಕಾಣೆಯಾದ ದೃಢೀಕರಣ ಟೋಕನ್
404 ಕಂಡುಬಂದಿಲ್ಲ - ಸರ್ವರ್ ಅಸ್ತಿತ್ವದಲ್ಲಿಲ್ಲ.
ಸೂಚನೆ: ನೀವು ಪ್ರತಿ ಸರ್ವರ್‌ಗೆ ಗರಿಷ್ಠ 10 ಹಸ್ತಚಾಲಿತ ಬ್ಯಾಕಪ್‌ಗಳನ್ನು ಹೊಂದಬಹುದು. ನಿಮ್ಮ ಯೋಜನೆಯ ಬ್ಯಾಕಪ್ ಧಾರಣ ನೀತಿಯ ಆಧಾರದ ಮೇಲೆ (ಸಾಮಾನ್ಯವಾಗಿ 7-30 ದಿನಗಳು) ಸ್ವಯಂಚಾಲಿತ ಬ್ಯಾಕಪ್‌ಗಳನ್ನು ಉಳಿಸಿಕೊಳ್ಳಲಾಗುತ್ತದೆ.
ಅಳಿಸಿ /api/v1/backups/{backup_id}/

ಬ್ಯಾಕಪ್ ಅಳಿಸಿ

ಬ್ಯಾಕಪ್ ಅನ್ನು ಶಾಶ್ವತವಾಗಿ ಅಳಿಸಿ. ಈ ಕ್ರಿಯೆಯನ್ನು ರದ್ದುಗೊಳಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ.

ಮಾರ್ಗ ನಿಯತಾಂಕಗಳು

ಪ್ಯಾರಾಮೀಟರ್ ಪ್ರಕಾರ ಅಗತ್ಯವಿದೆ ವಿವರಣೆ
backup_id integer ಹೌದು ಅನನ್ಯ ಬ್ಯಾಕಪ್ ಐಡಿ

ಉದಾಹರಣೆ ವಿನಂತಿ

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

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

response = requests.delete(url, headers=headers)
print(response.status_code)
const backupId = 501;
const response = await fetch(`https://admin.vps.org/api/v1/backups/${backupId}/`, {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_API_TOKEN',
    'Content-Type': 'application/json'
  }
});

console.log(response.status);

ಪ್ರತಿಕ್ರಿಯೆ ಸ್ಥಿತಿ ಕೋಡ್‌ಗಳು

204 ಬ್ಯಾಕಪ್ ಅನ್ನು ಯಶಸ್ವಿಯಾಗಿ ಅಳಿಸಲಾಗಿದೆ
401 ಅನಧಿಕೃತ - ಅಮಾನ್ಯ ಅಥವಾ ಕಾಣೆಯಾದ ದೃಢೀಕರಣ ಟೋಕನ್
404 ಕಂಡುಬಂದಿಲ್ಲ - ಬ್ಯಾಕಪ್ ಅಸ್ತಿತ್ವದಲ್ಲಿಲ್ಲ.
ಎಚ್ಚರಿಕೆ: ಬ್ಯಾಕಪ್ ಅಳಿಸುವುದು ಶಾಶ್ವತ ಮತ್ತು ಅದನ್ನು ರದ್ದುಗೊಳಿಸಲು ಸಾಧ್ಯವಿಲ್ಲ. ಅದನ್ನು ಅಳಿಸುವ ಮೊದಲು ನಿಮಗೆ ಈ ಬ್ಯಾಕಪ್ ಇನ್ನು ಮುಂದೆ ಅಗತ್ಯವಿಲ್ಲ ಎಂದು ಖಚಿತಪಡಿಸಿಕೊಳ್ಳಿ.

ಬ್ಯಾಕಪ್‌ಗಳಿಂದ ಮರುಸ್ಥಾಪಿಸಲಾಗುತ್ತಿದೆ

ಬ್ಯಾಕಪ್‌ನಿಂದ ಸರ್ವರ್ ಅನ್ನು ಮರುಸ್ಥಾಪಿಸಲು, ಸರ್ವರ್‌ಗಳ API ಮರುಸ್ಥಾಪನೆ ಎಂಡ್‌ಪಾಯಿಂಟ್ ಬಳಸಿ:

POST /api/v1/servers/{server_id}/restore/
{
  "backup_id": 501
}

ಸರ್ವರ್ ಮರುಸ್ಥಾಪನೆಯ ಕುರಿತು ವಿವರವಾದ ಮಾಹಿತಿಗಾಗಿ, ನೋಡಿ ಸರ್ವರ್‌ಗಳ API ದಸ್ತಾವೇಜನ್ನು.

ಬ್ಯಾಕಪ್ ಅತ್ಯುತ್ತಮ ಅಭ್ಯಾಸಗಳು