Backup Resource
Description
This resource is used to start or determine the status of a currently running backup.
GET /backup
If no backup is in progress, the GET request will return a 204 No Content code. If rWeb is processing another major command (e.g. upgrading) this will return a 400 Error.
Otherwise, the GET request will respond with data showing the current status of the backup.
GET Response Values
| Name | Type | Description |
|---|---|---|
| device_id | JSON Number | This will be 0, used to identify rWeb itself. |
| command | JSON String | Should reference the command "rweb_backup". |
| command_parameters | JSON String | The type of backup. Will be either "config" or "full". |
| status | JSON String | A textual description of the current status of the backup |
| device_feedback | JSON String | Will be null |
| finished | JSON Boolean | Whether or not the backup is finished |
| cancelled | JSON Boolean | Whether or not the backup was cancelled |
Example GET Request
GET /backup
Example GET Response
{
"device_id": 0,
"command": "rweb_backup",
"command_parameters": "full",
"status": "backup_started
started rWeb full database backup
created database schema dump file
created full data dump file
successfully backed up license files
successfully backed up pcap files",
"device_feedback": null,
"finished": false,
"cancelled": false,
}
POST /backup
Starts a backup if one is not currently running.
POST Parameters
| Name | Required | Type | Description | Default Value |
|---|---|---|---|---|
| backup_type | Yes | JSON String | The type of backup to be performed. Must be either "full" or "config". |
POST Response Values
| Name | Type | Description |
|---|---|---|
| device_id | JSON Number | This will be 0, used to identify rWeb itself. |
| command | JSON String | Should reference the command "rweb_backup". |
| command_parameters | JSON String | The type of backup. Will be either "config" or "full" based on the POST parameter. |
| status | JSON String | A textual description of the current status of the backup. Following the POST, this will be "request". |
| device_feedback | JSON String | Will be "new" |
| finished | JSON Boolean | Whether or not the backup is finished. |
| cancelled | JSON Boolean | Whether or not the backup was cancelled. |
Example POST Request
POST /backup
JSON Body:
{
“data” :
{
“backup_type”: ”full”
}
}
Example POST Response
{
"device_id": 0,
"command": "rweb_backup",
"command_parameters": "full",
"status": "request",
"device_feedback": "new",
"finished": false,
"cancelled": false
}