backup¶
Summary¶
| Resource | Operation | Description | 
|---|---|---|
| Backup | GET /api/app/v1/backup | Show backups | 
| POST /api/app/v1/backup/create | Create backup | |
| POST /api/app/v1/backup/create/schedule | Create backup schedule | |
| DELETE /api/app/v1/backup/delete | Delete local backup | |
| DELETE /api/app/v1/backup/delete/schedule | Delete backup schedule | |
| PUT /api/app/v1/backup/restore | Restore backup | |
| PUT /api/app/v1/backup/save | Save backup | |
| GET /api/app/v1/backup/schedule | Show backup schedule | 
Details¶
- 
GET/api/app/v1/backup¶
- Show a list of backup files in specified location (local or filestore). - Note - The timestamp displayed will be in UTC time. - New in version 1.0. - Query Parameters: - location (required) – Location to show backups from (local or filestore alias)
- sort (optional) – How to sort the backups, only option is timestamp
 - Response Headers: - Content-Type – application/json
 - Status Codes: - 200 OK – Success - backup list
- 400 Bad Request – Bad Request - invalid parameter
- 401 Unauthorized – Access Denied
- 404 Not Found – Not found - file or filestore did not exist
 - Accepted Authorization: - admin, audit - Example 1 - Request: Show local backups: - GET /api/app/v1/backup?location=local HTTP/1.1 Accept: text/html - Example 1 - Response: Show local backups: - HTTP/1.1 200 OK Content-Type: application/json { "local": { "Full-v10k-web-22-V10KG4-v8.3.0-20170227.bak": { "description": "new_test1", "timestamp": "2017/02/27 11:23:32" }, "Full-v10k-web-22-V10KG4-v8.3.0-20170227-1.bak": { "description": "this is a test", "timestamp": "2017/02/27 11:25:30" }, "Full-v10k-web-22-V10KG4-v8.3.0-20170227-2.bak": { "description": "this is a test2", "timestamp": "2017/02/27 11:27:17" }, "Full-v10k-web-22-V10KG4-v8.3.0-20170227-3.bak": { "description": "this is a test3", "timestamp": "2017/02/27 11:28:45" } } 
- 
POST/api/app/v1/backup/create¶
- Create a backup and save it to specified location (local or filestore). - Note - The timestamp for the backup will be stored in UTC time. - New in version 1.0. - Query Parameters: - location (required) – Location to store the backup file (local or filestore alias)
- bu_type (required) – Type of backup (web, email, full)
- description (optional) – Description for the backup
 - Response Headers: - Content-Type – application/json
 - Status Codes: - 200 OK – Success - backup created
- 400 Bad Request – Bad Request - invalid or missing parameter
- 401 Unauthorized – Access Denied
- 404 Not Found – Not found - file or filestore did not exist
 - Accepted Authorization: - admin - Example 1 - Request: Create local web backup: - POST /api/app/v1/backup/create?location=local&bu_type=web&description=Web HTTP/1.1 Accept: text/html - Example 1 - Response: Create local web backup: - HTTP/1.1 200 OK Content-Type: application/json { "bu_filename": "Web-V10KG4-v8.3.0-20161114-1.bak" } - Example 2 - Request: Create web backup on filestore: - POST /api/app/v1/backup/create?location=myfilestore&bu_type=web&description=Web HTTP/1.1 Accept: text/html - Example 2 - Response: Create web backup on filestore: - HTTP/1.1 200 OK Content-Type: application/json { "bu_filename": "Web-V10KG4-v8.3.0-20161114-2.bak" } - Example 3 - Request: Create full backup to url: - POST /api/app/v1/backup/create?url=ftp://ftp_backup:Firewall1_backup@10.206.6.87/sub1&bu_type=full HTTP/1.1 Accept: text/html - Example 3 - Response: Create full backup to url: - HTTP/1.1 200 OK Content-Type: application/json { "bu_filename": "Full-main-latest-web-86-V5KG4-v8.5.3-20180521155516.bak" } - Example 4 - Request: Create full backup to filestore, with save-path: - POST /api/app/v1/backup/create?url=ftp://ftp_backup:Firewall1_backup@10.206.6.87/sub1&bu_type=full&save-path=sub1 HTTP/1.1 Accept: text/html - Example 4 - Response: Create full backup to filestore, with save-path: - HTTP/1.1 200 OK Content-Type: application/json { "bu_filename": "Full-main-latest-web-86-V5KG4-v8.5.3-20180521155516.bak" } 
- 
POST/api/app/v1/backup/create/schedule¶
- Create a backup schedule. - New in version 1.0. - Query Parameters: - time (required) – Time to perform backup (HH:MM)
- location (required) – Location to store the backup file (local or filestore alias)
- freq (required) – Frequency to perform the backup (daily, weekly, monthly)
- date (optional) – Date of the month to perform backup (1-29), required if freq is set to monthly
- day (optional) – Day of the week to perform backup (mon-sun), required if freq set to weekly
- bu_type (required) – Type of backup (web, email, full)
 - Response Headers: - Content-Type – application/json
 - Status Codes: - 200 OK – Success - backup created
- 400 Bad Request – Bad Request - invalid parameter
- 401 Unauthorized – Access Denied
- 404 Not Found – Not found - file or filestore did not exist
- 409 Conflict – Conflict - Conflicting backup schedule
 - Accepted Authorization: - admin - Example 1 - Request: Create backup schedule: - POST /api/app/v1/backup/create/schedule?location=local&freq=daily&time=12:20&bu_type=full HTTP/1.1 Accept: text/html - Example 1 - Response: Create backup schedule: - HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" } 
- 
DELETE/api/app/v1/backup/delete¶
- Delete one or all local backup files. - New in version 1.0. - Query Parameters: - filename (required) – Name of backup file to delete, or ‘all’ to delete all local backups
 - Response Headers: - Content-Type – application/json
 - Status Codes: - 200 OK – Success - backup deleted
- 400 Bad Request – Bad Request - invalid parameters
- 401 Unauthorized – Access Denied
- 404 Not Found – Not found - file did not exist
 - Accepted Authorization: - admin - Example 1 - Request: Delete a backup file: - POST /api/app/v1/backup/delete?filename=test.back HTTP/1.1 Accept: text/html - Example 1 - Response: Delete a backup file: - HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" } 
- 
DELETE/api/app/v1/backup/delete/schedule¶
- Delete backup schedule. - New in version 1.0. - Query Parameters: - bu_type (required) – Type of backup to delete
 - Response Headers: - Content-Type – application/json
 - Status Codes: - 200 OK – Success - backup schedule deleted
- 400 Bad Request – Bad Request - missing or invalid parameters
- 401 Unauthorized – Access Denied
- 404 Not Found – Not found - backup not found
 - Accepted Authorization: - admin - Example 1 - Request: Delete backup schedule: - DELETE /api/app/v1/backup/schedule?bu_type=full HTTP/1.1 Accept: text/html - Example 1 - Response: Delete backup schedule: - HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" } 
- 
PUT/api/app/v1/backup/restore¶
- Restore a backup from the specified location (local, filestore or url). - New in version 1.0. - Note - After the restore is completed and the appliance reboots, the output is no longer a JSON. Instead, due to the reboot, an http error is encountered. - Query Parameters: - filename (optional) – Backup filename
- location (optional) – Location to store the backup file (local or filestore alias)
- url (optional) – URL of the backup to restore
- no-cert-verification (optional) – Ignore SSL certificate checks (only valid with –url, with scheme https)
 - Response Headers: - Content-Type – application/json
 - Status Codes: - 200 OK – Success
- 400 Bad Request – Bad Request
- 401 Unauthorized – Access Denied
- 404 Not Found – Not found - file or filestore did not exist
 - Accepted Authorization: - admin - Example 1 - Request: Restore backup from a filestore: - PUT /api/app/v1/backup/restore?location=myfilestore&filename=file.bak HTTP/1.1 Accept: text/html - Example 1 - Response: Restore backup from a filestore: - HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" }- Example 2 - Request: Restore backup from an ftp server: - PUT /api/app/v1/backup/restore?location=myfilestore&url=ftp://ftp_user:ftp_passwd@10.206.6.89/backups/my_backup.bak HTTP/1.1 Accept: text/html - Example 2 - Response: Restore backup from an ftp server: - HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" } - Example 3 - Request: Restore backup from an encrypted web server: - PUT /api/app/v1/backup/restore?location=myfilestore&url=https://web_user:web_passwd@10.206.6.89/backup/my_backup.bak HTTP/1.1 Accept: text/html - Example 3 - Response: Restore backup from an encrypted web server: - HTTP/1.1 200 OK Content-Type: application/json { "Status": "Success" } 
- 
PUT/api/app/v1/backup/save¶
- save a local backup to the specified filestore location. - New in version 1.0. - Query Parameters: - filename (required) – Local backup filename
- location (optional) – Location to store the backup file (filestore alias)
- save-path (optional) – directory under location to store the file
- url (optional) – The url of the filestore
 - Response Headers: - Content-Type – application/json
 - Status Codes: - 200 OK – Success
- 401 Unauthorized – Access Denied
- 404 Not Found – Bad Request - file or filestore does not exist
 - Accepted Authorization: - admin - Example 1 - Request: Save a local backup to filestore: - PUT /api/app/v1/backup/save?location=myfilestore&filename=file.bak HTTP/1.1 Accept: text/html - Example 1 - Response: Save a local backup to filestore: - HTTP/1.1 200 OK Content-Type: application/json { "Info": "'Web-hostname-v8.4.0-20170720201913.bak' has been saved to ftp://anonymous@10.206.6.131/." } - Example 2 - Request: Save a local backup to URL: - PUT api/app/v1/backup/save?url=ftp%3A%2F%2Fftp_backup%3Aftp_backup%4010.206.6.87%2F&file=Full-travis-latest-email-85-V5KG4-v8.5.3-20180430160249.bak Accept: text/html - Example 2 - Response: Save a local backup to URL: - HTTP/1.1 200 OK Content-Type: application/json { "Info": "'Full-travis-latest-email-85-V5KG4-v8.5.3-20180430160249.bak' has been saved to ftp://ftp_backup@10.206.6.87/" } 
- 
GET/api/app/v1/backup/schedule¶
- Show backup schedule. - New in version 1.0. - Response Headers: - Content-Type – application/json
 - Status Codes: - 200 OK – Success - backup schedule
- 401 Unauthorized – Access Denied
 - Accepted Authorization: - admin, audit - Example 1 - Request: Show backup schedule: - GET /api/app/v1/backup/schedule HTTP/1.1 Accept: text/html - Example 1 - Response: Show backup schedule: - HTTP/1.1 200 OK Content-Type: application/json { "Last Scheduled Backup": "Successfully completed backup on 2016-11-14 12:21", "Location": "local", "Next Scheduled Backup": "Wed, Nov 23 2016, 12:20 ", "Schedule Frequency": "monthly", "Type": "full" }