Naijacloud
Docs

Backups

Every /v1 route for backups. This page is generated from the API's OpenAPI contract, so it always matches what the API accepts and returns.

Authentication, pagination, errors and idempotency work the same on every route. They are described once, in the API overview.

Get a restore

GET /v1/restores/{restoreId}

Key scopes: READ and DATABASES.

Path parameters

NameTypeRequiredNotes
restoreIdstringyesThe restore's id.

Returns

bash
curl "https://api.naijacloud.com/v1/restores/$RESTORE_ID" \ -H "Authorization: Bearer $NC_API_KEY"

Restore a backup over its database

POST /v1/backups/{backupId}/restore

Destructive: replaces the live data, after taking a safety backup first (its id is on the restore). Requires ADMIN.

Key scopes: WRITE and DATABASES.

Path parameters

NameTypeRequiredNotes
backupIdstringyesThe backup's id.

Headers

NameTypeRequiredNotes
Idempotency-KeystringnoAny unique string (1–255 printable characters). A retry with the same key and body returns the first response instead of acting twice, for 24 hours.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/backups/$BACKUP_ID/restore" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)"

List a database's backups, newest first

GET /v1/services/{serviceId}/backups

Key scopes: READ and DATABASES.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Query parameters

NameTypeRequiredNotes
limitintegernoRows per page. Ignored when a cursor is given.
cursorstringnoThe nextCursor of the previous page, unchanged.

Returns

  • 200 with a page: { data: V1Backup[], nextCursor }, where each item is V1Backup.
bash
curl "https://api.naijacloud.com/v1/services/$SERVICE_ID/backups" \ -H "Authorization: Bearer $NC_API_KEY"

Back a database up now

POST /v1/services/{serviceId}/backups

Returns the backup in PENDING; poll it until COMPLETED.

Key scopes: WRITE and DATABASES.

Path parameters

NameTypeRequiredNotes
serviceIdstringyesThe service's id.

Headers

NameTypeRequiredNotes
Idempotency-KeystringnoAny unique string (1–255 printable characters). A retry with the same key and body returns the first response instead of acting twice, for 24 hours.

Returns

bash
curl -X POST "https://api.naijacloud.com/v1/services/$SERVICE_ID/backups" \ -H "Authorization: Bearer $NC_API_KEY" \ -H "Idempotency-Key: $(uuidgen)"

Types

V1Backup

FieldTypeNotes
idstring (uuid)
serviceIdstring (uuid)
statusPENDING, RUNNING, COMPLETED, FAILED
triggerHOURLY, DAILY, WEEKLY, MANUAL, PRE_RESTORE
sizeBytesnumber, or null
regionstring, or nullStorage region, e.g. "eu".
errorstring, or null
errorCodeDATABASE_NOT_RUNNING, DATABASE_NOT_FOUND, NOT_PROVISIONED, NOT_SUPPORTED, DUMP_FAILED, RESTORE_FAILED, DISK_FULL, OUT_OF_MEMORY, UPLOAD_FAILED, DOWNLOAD_FAILED, BACKUP_FILE_MISSING, STORAGE_NOT_CONFIGURED, SERVER_UNREACHABLE, TIMEOUT, SERVER_NEEDS_UPDATE, ALREADY_RUNNING, NO_LONGER_EXISTS, SAFETY_BACKUP_FAILED, UNKNOWN, or null
createdAtstring (date-time)
startedAtstring (date-time), or null
completedAtstring (date-time), or null
expiresAtstring (date-time), or nullWhen retention deletes it.

V1Restore

FieldTypeNotes
idstring (uuid)
serviceIdstring (uuid)
backupIdstring (uuid)
safetyBackupIdstring (uuid), or nullThe backup taken of the database just before restoring, to undo with.
statusPENDING, RUNNING, COMPLETED, FAILED
errorstring, or null
errorCodeDATABASE_NOT_RUNNING, DATABASE_NOT_FOUND, NOT_PROVISIONED, NOT_SUPPORTED, DUMP_FAILED, RESTORE_FAILED, DISK_FULL, OUT_OF_MEMORY, UPLOAD_FAILED, DOWNLOAD_FAILED, BACKUP_FILE_MISSING, STORAGE_NOT_CONFIGURED, SERVER_UNREACHABLE, TIMEOUT, SERVER_NEEDS_UPDATE, ALREADY_RUNNING, NO_LONGER_EXISTS, SAFETY_BACKUP_FAILED, UNKNOWN, or null
createdAtstring (date-time)
startedAtstring (date-time), or null
completedAtstring (date-time), or null