همهٔ سیستم‌ها عملیاتی‌اند

مرجع API · نسخهٔ v1

API پشتیبان‌گیری سرور

فهرست، ساخت، حذف و بازگردانی بکاپ هر سرور. این گروه با شناسهٔ backup در فایل OpenAPI آمده و ۴ endpoint دارد.

نمونه‌های curl توکن را از متغیر محیطی IRANCLAUD_TOKEN می‌خوانند؛ ساخت توکن و تنظیم این متغیر در راهنمای شروع سریع آمده است.

GET /api/v1/vms/{uuid}/backups #

List backups of a server (newest first)

دسترسی لازم: backup:read محدودیت نرخ: خواندن
پارامترهای مسیر (۱)
uuid string
الزامی Server UUID
پاسخ‌ها (۶)
  • 200 Backups data[]: volidsizectimeformat
  • 401 unauthenticated — Authorization header missing or not "Bearer …"; token_invalid — token unknown, expired, revoked or the account is not active
  • 403 scope_missing — the token lacks backup:read (details.required_scope)
  • 404 not_found — unknown server or owned by another account
  • 429 rate_limited — read limit reached; wait Retry-After seconds (details.retry_after_sec)
  • 503 backend_error — backup storage temporarily unavailable; retry
نمونهٔ curl
curl
curl \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/vms/YOUR_UUID/backups"

بازگشت به فهرست این بخش

POST /api/v1/vms/{uuid}/backups #

Start a backup of a running server (asynchronous)

دسترسی لازم: backup:write محدودیت نرخ: تغییر
پارامترهای مسیر (۱)
uuid string
الزامی Server UUID
فیلدهای بدنه (JSON) (۱)
note string
اختیاری Optional label stored with the backup
نمونهٔ بدنهٔ درخواست (JSON)
application/json
{
    "note": "before upgrade"
}
پاسخ‌ها (۶)
  • 200 Backup started. data.volid is a job label, not yet a backup id — poll the list endpoint until the new backup appears. data: volid
  • 401 unauthenticated — Authorization header missing or not "Bearer …"; token_invalid — token unknown, expired, revoked or the account is not active
  • 403 scope_missing — the token lacks backup:write (details.required_scope)
  • 404 not_found — unknown server or owned by another account
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
  • 503 backend_error — backup could not be started; retry
نمونهٔ curl
curl
curl -X POST \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"note":"before upgrade"}' \
  "https://iranclaud.ir/api/v1/vms/YOUR_UUID/backups"

بازگشت به فهرست این بخش

DELETE /api/v1/vms/{uuid}/backups/{volid} #

Delete a backup (irreversible)

دسترسی لازم: backup:write محدودیت نرخ: تغییر
پارامترهای مسیر (۲)
uuid string
الزامی Server UUID
volid string
الزامی Backup id from the list endpoint (characters A-Z a-z 0-9 . _ : / -)
پاسخ‌ها (۶)
  • 200 Deleted data: deleted
  • 401 unauthenticated — Authorization header missing or not "Bearer …"; token_invalid — token unknown, expired, revoked or the account is not active
  • 403 scope_missing — the token lacks backup:write (details.required_scope)
  • 404 not_found — unknown server or owned by another account
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
  • 503 backend_error — delete failed; retry
نمونهٔ curl
curl
curl -X DELETE \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  "https://iranclaud.ir/api/v1/vms/YOUR_UUID/backups/BACKUP_ID_FROM_LIST"

بازگشت به فهرست این بخش

POST /api/v1/vms/{uuid}/backups/restore #

Restore a backup in place (current disk contents are replaced)

دسترسی لازم: backup:write محدودیت نرخ: تغییر
پارامترهای مسیر (۱)
uuid string
الزامی Server UUID
فیلدهای بدنه (JSON) (۱)
volid string
الزامی Backup id from GET /api/v1/vms/{uuid}/backups
نمونهٔ بدنهٔ درخواست (JSON)
application/json
{
    "volid": "BACKUP_ID_FROM_LIST"
}
پاسخ‌ها (۸)
  • 200 Restored; the server is started again data: restored
  • 401 unauthenticated — Authorization header missing or not "Bearer …"; token_invalid — token unknown, expired, revoked or the account is not active
  • 403 scope_missing — the token lacks backup:write (details.required_scope)
  • 404 not_found — unknown server or owned by another account
  • 409 not_supported — dedicated servers are restored by support (open a ticket with the backup date); suspended_unpaid — the server is suspended for an unpaid balance (restore would start it); it starts automatically after a wallet top-up
  • 422 validation_failed — volid missing
  • 429 rate_limited — write limit reached; wait Retry-After seconds (details.retry_after_sec)
  • 503 backend_error — restore failed; retry or contact support with the request_id
نمونهٔ curl
curl
curl -X POST \
  -H "Authorization: Bearer $IRANCLAUD_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"volid":"BACKUP_ID_FROM_LIST"}' \
  "https://iranclaud.ir/api/v1/vms/YOUR_UUID/backups/restore"

بازگشت به فهرست این بخش

همهٔ گروه‌های API