Backups

List backup configurations

List backup configurations on a server.

GET /api/server/{id}/backups

Example request :

curl "https://cloud.boxydev.com/api/server/1/backups" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "data": [
        {
            "id": 1,
            "name": "backup",
            "frequency": "0 0 * * *",
            "hold": 15,
            "directory": "backups/server/",
            "status": "installed",
            "storage_provider_id": 1,
            "type": "database",
            "backupable": {
                "id": 1,
                "name": "cloud",
                "status": "installed",
                "created_at": "2022-08-23T16:54:12.000000Z"
            },
            "last_backup": {
                "id": 1,
                "path": "...",
                "size": 512,
                "output": "output",
                "status": "finished",
                "restore_output": null,
                "restore_status": null,
                "started_at": "2022-08-23T16:34:13.000000Z",
                "ended_at": "2022-08-23T16:54:13.000000Z",
                "restored_at": null,
                "duration": "20 minutes"
            },
            "last_backup_at": "2022-08-23T16:54:13.000000Z",
            "backups": [
                {
                    "id": 1,
                    "path": "...",
                    "size": 512,
                    "output": "output",
                    "status": "finished",
                    "restore_output": null,
                    "restore_status": null,
                    "started_at": "2022-08-23T16:34:13.000000Z",
                    "ended_at": "2022-08-23T16:54:13.000000Z",
                    "restored_at": null,
                    "duration": "20 minutes"
                }
            ]
        }
    ],
    "links": {
        "first": "https://cloud.boxydev.com/api/server/1/backups?page=1",
        "last": "https://cloud.boxydev.com/api/server/1/backups?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://cloud.boxydev.com/api/server/1/backups",
        "per_page": 20,
        "to": 1,
        "total": 1
    }
}

Get backup configuration

Show a backup configuration.

GET /api/backup-configuration/{id}

Example request :

curl "https://cloud.boxydev.com/api/backup-configuration/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "id": 1,
    "name": "backup",
    "frequency": "0 0 * * *",
    "hold": 15,
    "directory": "backups/server/",
    "status": "installed",
    "storage_provider_id": 1,
    "type": "database",
    "backupable": {
        "id": 1,
        "name": "cloud",
        "status": "installed",
        "created_at": "2022-08-23T16:54:12.000000Z"
    },
    "last_backup": {
        "id": 1,
        "path": "...",
        "size": 512,
        "output": "output",
        "status": "finished",
        "restore_output": null,
        "restore_status": null,
        "started_at": "2022-08-23T16:34:13.000000Z",
        "ended_at": "2022-08-23T16:54:13.000000Z",
        "restored_at": null,
        "duration": "20 minutes"
    },
    "last_backup_at": "2022-08-23T16:54:13.000000Z",
    "backups": [
        {
            "id": 1,
            "path": "...",
            "size": 512,
            "output": "output",
            "status": "finished",
            "restore_output": null,
            "restore_status": null,
            "started_at": "2022-08-23T16:34:13.000000Z",
            "ended_at": "2022-08-23T16:54:13.000000Z",
            "restored_at": null,
            "duration": "20 minutes"
        }
    ]
}

Create backup configuration

Create a backup configuration.

POST /api/server/{id}/backup-configuration

You can get storage provider list here. You can manage all your storage providers on your account.

Parameters :

Parameter Description
name The backup name.
frequency The backup frequency.
hold The number of backups to retain (Optional).
directory The directory where to put backups (Optional).
storage_provider_id Storage provider ID.
backupable_type The type of backup: database or site.
backupable_id Database ID or Site ID.

Example request :

curl "https://cloud.boxydev.com/api/server/1/backup-configuration" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "name": "backup",
        "frequency": "0 0 * * *",
        "hold": 3,
        "directory": "backups/server/",
        "storage_provider_id": 1,
        "backupable_type": "database",
        "backupable_id": 1
    }'

Example response :

{
    "id": 1,
    "name": "backup",
    "frequency": "0 0 * * *",
    "hold": 3,
    "directory": "backups/server/",
    "status": "installing",
    "storage_provider_id": 1,
    "type": "database",
    "backupable": {
        "id": 1,
        "name": "cloud",
        "status": "installed",
        "created_at": "2022-08-23T18:38:42.000000Z"
    },
    "last_backup": null,
    "last_backup_at": null,
    "backups": []
}

Update backup configuration

Update a backup configuration.

PUT /api/backup-configuration/{id}

Parameters :

Parameter Description
name The backup name.
frequency The backup frequency.
hold The number of backups to retain (Optional).
directory The directory where to put backups (Optional).
storage_provider_id Storage provider ID.

Example request :

curl -X PUT "https://cloud.boxydev.com/api/backup-configuration/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -d '{
        "name": "backup",
        "frequency": "0 0 * * *",
        "hold": 3,
        "directory": "backups/server/",
        "storage_provider_id": 1
    }'

Example response :

{
    "id": 1,
    "name": "backup",
    "frequency": "0 0 * * *",
    "hold": 3,
    "directory": "backups/server/",
    "status": "installed",
    "storage_provider_id": 1,
    "type": "database",
    "backupable": {
        "id": 1,
        "name": "cloud",
        "status": "installed",
        "created_at": "2022-08-23T18:38:42.000000Z"
    },
    "last_backup": {
        "id": 1,
        "path": "...",
        "size": 512,
        "output": "output",
        "status": "finished",
        "restore_output": null,
        "restore_status": null,
        "started_at": "2022-08-23T16:34:13.000000Z",
        "ended_at": "2022-08-23T16:54:13.000000Z",
        "restored_at": null,
        "duration": "20 minutes"
    },
    "last_backup_at": "2022-09-04T10:19:10.000000Z",
    "backups": [
        {
            "id": 1,
            "path": "...",
            "size": 512,
            "output": "output",
            "status": "finished",
            "restore_output": null,
            "restore_status": null,
            "started_at": "2022-08-23T16:34:13.000000Z",
            "ended_at": "2022-08-23T16:54:13.000000Z",
            "restored_at": null,
            "duration": "20 minutes"
        }
    ]
}

Delete backup configuration

Delete a backup configuration.

DELETE /api/backup-configuration/{id}

Example request :

curl -X DELETE "https://cloud.boxydev.com/api/backup-configuration/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Get backup

Show a backup.

GET /api/backup/{id}

Example request :

curl "https://cloud.boxydev.com/api/backup/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Example response :

{
    "id": 1,
    "path": "...",
    "size": 512,
    "output": "output",
    "status": "finished",
    "restore_output": null,
    "restore_status": null,
    "started_at": "2022-08-23T16:34:13.000000Z",
    "ended_at": "2022-08-23T16:54:13.000000Z",
    "restored_at": null,
    "duration": "20 minutes"
}

Run backup

Run a backup.

POST /api/backup/{backupConfigurationId}

Example request :

curl -X POST "https://cloud.boxydev.com/api/backup/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Restore backup

Restore a backup.

PUT /api/backup/{id}

Example request :

curl -X PUT "https://cloud.boxydev.com/api/backup/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"

Delete backup

Delete a backup.

DELETE /api/backup/{id}

Example request :

curl -X DELETE "https://cloud.boxydev.com/api/backup/1" \
    -H "Authorization: Bearer {token}" \
    -H "Accept: application/json" \
    -H "Content-Type: application/json"