Manage database backups
Learn how to use the Database API to create, delete, and retrieve database backups.
All the sample requests in this guide include the following path parameters:
Parameter name | Description |
---|---|
tenantId | Your tenant ID. |
projectId | ID of a physical star system in which you want to create or delete a database backup. |
planetId | ID of a planet whose backup you want to create or retrieve. |
backupId | ID of a backup that you want to retrieve or delete. |
Create a backup
To create a backup, send the following POST
request:
curl -X 'POST' \
'{baseURL}/api/v1/tenants/{tenantId}/starsystems/{projectId}/planets/{planetId}/backups' \
-H "accept: application/json" \
-H "Authorization: Bearer {access_token}"\
-H "Content-Type: application/json"\
-d '{body}'
Where {body}
is an object that represents a backup:
{
"mechanism": "logical",
"planetClass": "dev",
"temporary": true,
"retentionPeriodInDays": 10,
"metadata": {
"name": "sample backup",
"description": "This is a sample backup."
}
}
Check if the database backup is ready
To check if a backup is created, send the following GET
request:
curl -X 'GET' \
'{baseURL}/api/v1/tenants/{tenantId}/starsystems/{projectId}/backups/{backupId}' \
-H "accept: application/json" \
-H "Authorization: Bearer {access_token}"
The database backup has been created if the value of status
is succeeded
.
{
"id": 362,
"mechanism": "logical",
"type": "temporary",
"environment": {
"tenant": "example",
"project": "test",
"stage": "dev",
"name": "testbackup"
},
...
},
"status": "succeeded",
"displayStatus": "ready",
"errorMessage": null,
"startedAt": "2024-01-29T09:53:09Z",
"completedAt": "2024-01-29T09:55:20Z",
"expirationDate": "2024-01-30T09:00:00Z",
"databaseToApplicationBuilds": {
...
}
Retrieve database backup details
You can retrieve details of a particular backup or backups from a planet or a star system.
Details of a particular backup
To retrieve the details of a particular database backup, send the following GET
request:
curl -X 'GET' \
'{baseURL}/api/v1/tenants/{tenantId}/starsystems/{projectId}/backups/{backupId}' \
-H "accept: application/json" \
-H "Authorization: Bearer {access_token}"
A response contains a JSON object with details of a particular backup.
Details of backups from a planet
To retrieve the details of backups from a particular planet, send the following GET
request:
curl -X 'GET' \
'{baseURL}/api/v1/tenants/{tenantId}/starsystems/{projectId}/planets/{planetId}/backups' \
-H "accept: application/json" \
-H "Authorization: Bearer {access_token}"
A response contains a JSON object with a list of backups available for this planet.
Details of backups from a star system
To retrieve the details of backups from a star system, send the following GET
reguest:
curl -X 'GET' \
'{baseURL}/api/v1/tenants/{tenantId}/starsystems/{projectId}/backup' \
-H "accept: application/json" \
-H "Authorization: Bearer {access_token}"
A response contains a JSON object with a list of backups available for this star system.
Delete a database backup
To detele a particular database backup, send the following DELETE
request:
curl -X 'DELETE' \
'{baseURL}/api/v1/tenants/{tenantId}/starsystems/{projectId}/backups/{backupId}' \
-H "Authorization: Bearer {access_token}"
For a successful request, you will receive the 200
status code.
Was this page helpful?