Backups

Show #

URL Parameters

This endpoint does not accept any parameters
                            GET
                            /v1/backups/{backup_id}
                        
                           
curl https://api.snapshooter.com/v1/backups/{backup_id} \
-X GET \
--header 'Authorization: Bearer API_TOKEN_HERE'
HTTP/2 200
{
"data": {
"id": "596c5046-1bd8-4664-9a3f-6208526c3b87",
"job_id": "6f7c5f07-bd49-49a5-8416-27b8de037ddc",
"status": "completed",
"tags": {
"manual": true,
"hourly": false,
"daily": false,
"weekly": false,
"monthly": false
},
"s3_directory": "snapshooter/5d32e6da-docker-mysql-ssh/2023/07/06/21-01",
"created_at": "2023-07-06T21:01:58.000000Z",
"started_at": "2023-07-06T21:02:18.000000Z",
"completed_at": "2023-07-06T21:02:49.000000Z",
"monitoring_available": true,
"encryption_key": "LS0tLS1CRU...URSBLRVktLS0tLQ==",
"files": [
{
"id": "045c31f2-234c-4c12-ae69-b6188b37412d",
"name": "snapshooter\/5d32e6da-docker-mysql-ssh\/2023\/07\/06\/21-01\/test.sql.gz",
"size": "744 bytes",
"url": "..."
}
]
}
}

Errors


Delete #

Parameters

This endpoint does not accept any parameters
                            DELETE
                            /v1/backups/{backup_id}
                        
                           
curl https://api.snapshooter.com/v1/backups/{backup_id} \
-X DELETE \
--header 'Authorization: Bearer API_TOKEN_HERE'
HTTP/2 204
//Empty Response Body

Errors


Download Backup Files #

Parameters

This endpoint does not accept any parameters
                            POST
                            /v1/backups/{backup_id}/download
                        
                           
curl https://api.snapshooter.com/v1/backups/{backup_id}/download \
-X POST \
--header 'Authorization: Bearer API_TOKEN_HERE'
HTTP/2 200
{
"data": {
"run.sh": "https://snapshooter-test.s3.eu-west-1.scw.cloud/aut?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=key%2F20220614%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T133438Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=11a077e91564dc8997a4c868419b75f51a7967b7c9b010404c200ec7f6191096",
"app.js": "https://snapshooter-test.s3.eu-west-1.amazonaws.com/qui?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=key%2F20220614%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T133438Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=8dfadf49bfe58d45c452b2796460254ad6ec08ab0ac4a76704eb5110672685bc",
"app.css": "https://snapshooter-test.s3.filebase.com/libero?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=key%2F20220614%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T133438Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=42e833c15a49cd75c88b13fcb869887c062dcf0a1873e8b6d0dca770f1959f28",
"dashboard.js": "https://s3.amazonaws.com/snapshooter-test/id?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=key%2F20220614%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T133438Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=bd079f2e8fa51f7de5c76dfadd3291c3144916565d20c66d25282e9724d82a08",
"admin.js": "https://snapshooter.eu-west-1.upcloudobjects.com/test/rerum?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=key%2F20220614%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T133438Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=88623b03fb58ee192ac03990dc44a24badbb721248a5f1c7f8843821eaf75d23",
"admin.css": "https://s3.eu-west-1.backblazeb2.com/snapshooter-test/commodi?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=key%2F20220614%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T133438Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=60f1401609c20c293d6ed30622bd9ec767dc94963a46a54170947f37a1fe9176",
"guest.js": "https://snapshooter-test.s3.filebase.com/asperiores?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=key%2F20220614%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20220614T133438Z&X-Amz-SignedHeaders=host&X-Amz-Expires=3600&X-Amz-Signature=7b601b7f2c6f46228dced2c3fec4c63f9a33ccae4c276b54a427b985da638516"
}
}

Errors


Restore

Restore #

Parameters


array files (optional)

Array of file ids to restore. If parameter is ommitted, all available files will be restored.


object compute (optional)

Allows to change the resource in which the Backup Restore will be processed. This option is not available when using Serverless Compute to perform the Backup. The object must contain the "type" and "server_id" parameters.


string restore_key (encrypted backups only)

Backup-specific (symmetric) key can be found in the Backup API endpoint and must be base64 decoded first, then decrypted using OpenSSL. The result must be provided in this field.


object restore_wizard (optional)

Allows to override specific backup configuration fields at the restore process (just like the UI). These fields can be found via Backup Job API endpoint.

                            POST
                            /v1/backups/{backup_id}/restore
                        
                           
curl https://api.snapshooter.com/v1/backups/{backup_id}/restore \
-X POST \
--header 'Authorization: Bearer API_TOKEN_HERE' \
HTTP/2 201
{
"data": {
"id": "ed6ca4f1-6047-4deb-a69d-8c42ba7e745f",
"job_id": "5d32e6da-7d64-40c7-9e7f-6f16080a13c4",
"backup_id": "70bf81d5-bf19-4a09-b0e0-c10b140d712e",
"compute": {
"id": 3,
"type": "server",
"server": {
"id": 3,
"host": "...",
"user": "root",
"port": 22,
"name": "WordPress Blog",
"created_at": "2023-04-25T14:16:59.000000Z",
"last_used": "2023-07-06T21:02:49.000000Z",
"status": "success"
}
},
"status": "pending",
"created_at": "2023-07-21T15:36:39.000000Z",
"started_at": null,
"completed_at": null,
"files": [
{
"id": "045c31f2-234c-4c12-ae69-b6188b37412d",
"name": "snapshooter\/5d32e6da-docker-mysql-ssh\/2023\/07\/06\/21-01\/test.sql.gz",
"size": "744 bytes",
"url": "..."
}
]
}
}

Examples

curl -X POST https://api.snapshooter.com/v1/backups/{backup_id}/restore \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-binary @- <<DATA
{}
DATA
curl -X POST https://api.snapshooter.com/v1/backups/{backup_id}/restore \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-binary @- <<DATA
{
"files": ["f7a4b142-5aa8-4b42-8896-62455f696e5a"]
}
DATA
curl -X POST https://api.snapshooter.com/v1/backups/{backup_id}/restore \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-binary @- <<DATA
{
"compute": {
"type": "ss_agent",
"server_id": 9362
}
}
DATA
curl -X POST https://api.snapshooter.com/v1/backups/{backup_id}/restore \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-binary @- <<DATA
{
"restore_key": "[redacted]"
}
DATA
curl -X POST https://api.snapshooter.com/v1/backups/{backup_id}/restore \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
--data-binary @- <<DATA
{
"restore_wizard": {
"mysql_host": "my-staging-db.example.com",
"mysql_username": "staging",
"mysql_password": "***************",
}
}
DATA

Errors


Was this page helpful?

Thank you for helping us improve!