Configure Automated Backups for a Service Instance

You can change the configuration settings of automated backups for an Oracle Java Cloud Service instance using the REST API.

Note:

  • On accounts that are integrated with Oracle Identity Cloud Service, the identity domain ID is the Identity Cloud Service tenant name. This tenant name begins with the characters idcs-followed by a string of number and letters (for example, idcs-98888f7964454b658ac6d2f625b29030). Access the Oracle Identity Cloud Service Console in a browser to find the tenant name in the URL. You can also find the name when you sign in to your Oracle Cloud account, navigate to Identity and then select Federation.

  • The cURL command examples use the URL structure https://rest_server_url/resource-path, where rest_server_url is the REST server to contact for your identity domain. See Send Requests.

Specifically, you can change the schedule of automated backups, the default cloud and local retention times for backups, and where backups are stored. You can also disable and reenable the backup service for the instance.

To configure automated backups for an Oracle Java Cloud Service instance:

  1. Before changing the configuration of automated backups, view the current backup configuration settings.
    curl -i -X GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances/ExampleInstance/backupconfig
    

    Specify the following options on the cURL command line:

    • -i option to include the HTTP header in the output. This option is optional.

    • -X option to indicate the type of request (GET).

    • -u option to specify the user name and password for the Oracle Java Cloud Service account for authentication.

    • -H to define a custom header, X-ID-TENANT-NAME, to identify the identity domain ID.

    For more information, see View the Backup Configuration.

    In the example, the following backup schedules are in effect:

    • Full backups are performed at 11:50:00 PM UTC on Tuesday

    • Incremental backups are performed at 11:50:00 PM UTC daily, excluding Tuesday

    • Retention time for incremental and on-demand backups (in an object storage container or bucket) is set to 30 days; full scheduled backups are retained until their last related incremental backup is no longer available, if any

      For copies of backups on a dedicated storage volume, the local retention time is 7 days; disk copies of full scheduled backups are retained until the local copy of their last related incremental backup is no longer available, if any.

    The following example shows the response body in JSON format.

    {
        "state":"ENABLED",
        "defaultRetention":"30 days",
        "localRetention":"7 days",
        "fullBackupSchedule":
        {
            "second":"0",
            "minute":"50",
            "hour":"23",
            "dayOfMonth":"*",
            "month":"*",
            "dayOfWeek":"Tue",
            "year":"*"
        },
        "incrementalBackupSchedule":
        {
            "second":"0",
            "minute":"50",
            "hour":"23",
            "dayOfMonth":"*",
            "month":"*",
            "dayOfWeek":"Sun,Mon,Wed,Thu,Fri,Sat",
            "year":"*"
        },
        "scheduledBackups":"ALL",
        "extendedRestoreTypes":"NONE",
        "lastBackupDate":"Thu Dec 03 23:50:00 GMT 2015",
        "lastSuccessfulCleanupDate":"Fri Dec 04 01:01:59 GMT 2015",
        "nextFullBackupDate":"Tue Dec 08 23:50:00 GMT 2015",
        "nextIncrementalBackupDate":"Fri Dec 04 23:50:00 GMT 2015",
        "backupDestination":"BOTH",
        "cloudStorageContainer":"Storage-ExampleIdentityDomain\/mybackupcontainer",
        "cloudStorageUser":"username",
        "totalCloudStorageContainerUsed":"1.8GB",
        "totalCloudStorageContainerUsedInBytes":1934445222,
        "totalBackupVolumeUsed":"1.8GB",
        "totalBackupVolumeUsedInBytes":1934445222,
        "percentBackupVolumeUsed":0.9007961750030518
    }
  2. Create a JSON document, backup.json, that defines the details of the backup configuration. Include only those parameters that you want changed.

    Note that you cannot change the backup configuration when the backup service for the specified service instance is in a DISABLED state.

    The following shows an example of the request document in JSON format. In this example, the full backup schedule is set to 5AM UTC on Sunday. The incremental backup schedule is set to 3AM UTC.

    For more information about the request attributes, see Update the Backup Configuration.

    {
       "fullBackupSchedule":
       {
          "hour":"5",
          "dayOfWeek":"Sun"
       },
       "incrementalBackupSchedule":
       {
          "hour":"3"
       }
    }
    
  3. Configure automated backups for an Oracle Java Cloud Service instance, passing the JSON document defined in step 2.
    curl -i -X POST -u username:password -d @backup.json -H "Content-type:application/json" -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/jaas/instances/ExampleInstance/backupconfig
    

    Specify the following options on the cURL command line:

    • -i option to include the HTTP header in the output. This option is optional.

    • -X option to indicate the type of request (POST).

    • -u option to specify the user name and password for the Oracle Java Cloud Service account for authentication.

    • -d option to identify the request document, in JSON format, on the local machine (backup.json).

    • -H to identify the content type as application/json and define a custom header, X-ID-TENANT-NAME, to identify the identity domain ID.

    The following example shows the response.

    HTTP/1.1 202 Accepted
    Date: Sat, 22 Apr 2017 19:38:50 GMT
    Location: https://rest_server_url/paas/api/v1.1/activitylog/ExampleIdentityDomain/job/1882092
    Content-Type: application/json
    
    {
        "operationName":"backup-config-update",
        "target_uri":"https:\/\/rest_server_url\/paas\/api\/v1.1\/instancemgmt\/ExampleIdentityDomain\/services\/jaas\/instances\/ExampleInstance\/backupconfig",
        "job_id":"1882092"
    }
  4. After a while, view the backup configuration as described in step 1.

    The following example shows the response body in JSON format. The new values are in effect. Because dayOfWeek was not specified for incrementalBackupSchedule in the update request, the value defaults to all days excluding the day of the full backup (in this example, every day excluding Sunday). The retention times are not changed.

    {
        "state":"ENABLED",
        "defaultRetention":"30 days",
        "localRetention":"7 days",
        "fullBackupSchedule":
        {
            "second":"0",
            "minute":"0",
            "hour":"5",
            "dayOfMonth":"*",
            "month":"*",
            "dayOfWeek":"Sun",
            "year":"*"
        },
        "incrementalBackupSchedule":
        {
            "second":"0",
            "minute":"0",
            "hour":"3",
            "dayOfMonth":"*",
            "month":"*",
            "dayOfWeek":"Mon,Tue,Wed,Thu,Fri,Sat",
            "year":"*"
        },
        "scheduledBackups":"ALL",
        "extendedRestoreTypes":"NONE",
        "lastBackupDate":"Thu Dec 03 23:50:00 GMT 2015",
        "lastSuccessfulCleanupDate":"Fri Dec 04 01:01:59 GMT 2015",
        "nextFullBackupDate":"Sun Dec 06 05:00:00 GMT 2015",
        "nextIncrementalBackupDate":"Fri Dec 04 03:00:00 GMT 2015",
        "backupDestination":"BOTH",
        "cloudStorageContainer":"Storage-ExampleIdentityDomain\/mybackupcontainer",
        "cloudStorageUser":"username",
        "totalCloudStorageContainerUsed":"1.8GB",
        "totalCloudStorageContainerUsedInBytes":1934445222,
        "totalBackupVolumeUsed":"1.8GB",
        "totalBackupVolumeUsedInBytes":1934445222,
        "percentBackupVolumeUsed":0.9007961750030518
    }