Create a Backup

post

/backupservice/v1/backup

This endpoint is not available on Oracle Cloud Machine.

Schedules a backup immediately using the specified backup configuration. The storage volume that you have specified in the backup configuration is backed up immediately, irrespective of the status of enabled in the specified backup configuration.

Prerequisite: Ensure that you have selected a replication policy for your Oracle Cloud Infrastructure Object Storage Classic instance. See Selecting a Replication Policy for Your Service Instance in Using Oracle Cloud Infrastructure Object Storage Classic.

Required Role: To complete this task, you must have the Compute_Operations role. If this role isn't assigned to you or you're not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Request

Supported Media Types
Body ()
Multi-part name of BackupConfiguration to execute
Root Schema : BackupInput
Type: object
Show Source

Response

Supported Media Types

201 Response

Successfully triggered backup.
Body ()
A Backup Job.
Root Schema : Backup
Type: object
A Backup Job.
Show Source

400 Response

Backup configuration does not exist. Unauthorized or No access to the backup configuration associated with the backup. Volume does not exist or is not online.

401 Response

Unauthorized to create backup.

500 Response

The server encountered an error handling this request.

Examples

cURL Command

The following example shows how to create a backup by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.

Enter the command on a single line. Line breaks are used in this example for readability.

curl -i -X POST
     -H "Cookie: $COMPUTE_COOKIE"
     -H "Content-Type: application/oracle-compute-v3+json"
     -H "Accept: application/oracle-compute-v3+json"
     -d "@requestbody.json"
        https://api-z999.compute.us0.oraclecloud.com/backupservice/v1/backup/
  • COMPUTE_COOKIE is the name of the variable in which you stored the authentication cookie earlier. For information about retrieving the authentication cookie and storing it in a variable, see Authentication.

  • api-z999.compute.us0.oraclecloud.com is an example REST endpoint URL. Change this value to the REST endpoint URL of your Compute Classic site. For information about finding out REST endpoint URL for your site, see Send Requests.

Example of Request Body

The following shows an example of the request body content in the requestbody.json file to immediately backup the storage volume specified in the backup configuration /Compute-acme/jack.jones@example.com/backupConfigVol1.

{
  "backupConfigurationName": "/Compute-acme/jack.jones@example.com/backupConfigVol1",
  "name": "/Compute-acme/jack.jones@example.com/BACKUP-A"
}

Example of Response Body

The following example shows the response body in JSON format.

{
  "uri": "https://api-z999.compute.us0.oraclecloud.com/backupservice/v1/backup/Compute-acme/jack.jones@example.com/BACKUP-A",
  "runAsUser": "/Compute-acme/jack.jones@example.com",
  "name": "/Compute-acme/jack.jones@example.com/BACKUP-A",
  "backupConfigurationName": "/Compute-acme/jack.jones@example.com/backupConfigVol1",
  "volumeUri": "http://api-z999.compute.us0.oraclecloud.com/storage/volume/Compute-acme/jack.jones@example.com/vol1",
  "errorMessage": null,
  "detailedErrorMessage": null,
  "state": "SUBMITTED",
  "description": null,
  "bootable": false,
  "shared": false,
  "snapshotUri": null,
  "snapshotSize": null,
  "tagId": "0d22fec6-fc3c-4987-8021-8f0cf49b8737"
}