Update a Backup Configuration

post

/paas/api/v1.1/instancemgmt/{identityDomainId}/services/MySQLCS/instances/{serviceId}/backupconfig

Updates the backup configuration for a MySQL Cloud Service instance. Specifically, you can update the following details:
  • Schedule for full and incremental backups
  • Default retention time for incremental backups and full on-demand backups; note that full scheduled backups are retained until their last related incremental backup is no longer available, if any
  • Storage Cloud Service URI and user name for the container that is used to store backups

To disable a full or incremental backup, set the fullBackupSchedule or incrementalBackupSchedule value, respectively, to null. For example: {"fullBackupSchedule": null}.

Request

Supported Media Types
Path Parameters
Header Parameters
Body ()
The request body defines the details of the backup configuration update request. Specify only those attributes that you want to update.
Root Schema : backup-config-post-request
Type: object
The request body defines the details of the backup configuration update request.
Show Source
  • Number of days incremental backups and full on-demand backups are retained. This value defaults to 30.

    Full scheduled backups are retained until their last related incremental backup is no longer available, if any.

    Any change to the default retention value will affect new backups as well as existing backups. This means if you change the value to a smaller number, existing backups that meet the updated retention policy will be deleted during the next backup or next scheduled maintenance cycle.

  • backup-config-schedule
    Updated attributes for fullBackupSchedule and incrementalBackupSchedule.
  • backup-config-schedule
    Updated attributes for fullBackupSchedule and incrementalBackupSchedule.
  • Number of days to retain the copies of backup on a dedicated storage volume. Default is 7 days.

    The local retention value cannot be larger than the default retention value (specified by defaultRetention).

    Copies of full scheduled backups are retained until the local copy of their last related incremental backup is no longer available, if any.

    Any change to the local retention value will affect new backup copies as well as existing copies. This means if you change the value to a smaller number, existing backup copies that meet the updated retention policy will be deleted during the next backup or next scheduled maintenance cycle.

Nested Schema : backup-config-schedule
Type: object
Updated attributes for fullBackupSchedule and incrementalBackupSchedule.
Show Source
  • Day of the week. Valid values are: Mon, Tue, Wed, Thu, Fri, Sat, Sun. For full backups, only one value (day) is allowed. For incremental backups, one or more values (days) are allowed. If a value is not specified for incremental backups, the default value is calculated as all days except the day that full backups are initiated.
  • Hours. Valid values are 0 to 23.
  • Minutes. Valid values are 0 to 59.

Response

Supported Media Types

200 Response

OK. See Status Codes for information about other HTTP status codes.
Body ()
The response body includes information about the backup configuration. If an update request was initiated and successfully completed, the response body shows the updated configuration.
Root Schema : backup-config-response
Type: object
The response body includes information about the backup configuration. If an update request was initiated and successfully completed, the response body shows the updated configuration.
Show Source
Nested Schema : backup-schedule
Type: object
Attributes for fullBackupSchedule and incrementalBackupSchedule.
Show Source
  • Day of the month. This value is not configurable. It defaults to all days of the month with is an astrisk (*).
  • Day of the week. Valid values are: Mon, Tue, Wed, Thu, Fri, Sat, Sun. For full backups, only one value (day) is allowed. For incremental backups, one or more values (days) are allowed. If a value is not specified for incremental backups, the default value is calculated as all days except the day that full backups are initiated.
  • Hours. Valid values are 0 to 23.
  • Minutes. Valid values are 0 to 59.
  • Month. This value is not configurable. It defaults to all months with an astrisk (*).
  • Seconds. This value is not configurable. It defaults to 0.
  • Year. This value is not configurable. It defaults to all years (*).

Examples

The following example shows how to modify a backup configuration for a MySQL Cloud Service instance by submitting a POST request on the REST endpoint using cURL.

Note: The command in this example uses the URL structure https://rest_server_url/resource-path, where rest_server_url is the Oracle Public Cloud or Oracle Cloud Machine REST server to contact for your identity domain or tenant name. See Send Requests for the appropriate URL structure to use on Oracle Public Cloud or Oracle Cloud Machine.

cURL Command

curl -i -X POST \
  -u "username:password" \
  -H "X-ID-TENANT-NAME: ExampleIdentityDomain" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"defaultRetention":42,"fullBackupSchedule":{"hour":2,"minute":15,"dayOfWeek":"Sat"},"incrementalBackupSchedule":{"hour":6,"minute":30}}' \
  https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/MySQLCS/instances/MyTestInstance/backupconfig 

The request body passed into curl's -d parameter is:

{  
   "defaultRetention":42,
   "fullBackupSchedule":{  
      "hour":2,
      "minute":15,
      "dayOfWeek":"Sat"
   },
   "incrementalBackupSchedule":{  
      "hour":6,
      "minute":30
   }
}

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 200 OK
Server: Oracle-Application-Server-11g
Content-Language: en
Access-Control-Allow-Headers: Content-Type, api_key, Authorization
Access-Control-Allow-Methods: GET, POST, DELETE, PUT, OPTIONS, HEAD
X-ORACLE-DMS-ECID: u00dVuE900056RX8pL030ig1GaH05Fs70K
X-ORACLE-DMS-ECID: u00dVuE900056RX8pL030ig1GaH05Fs70K
Access-Control-Allow-Origin: *
X-Frame-Options: DENY
Content-Type: application/json
Vary: user-agent
Date: Thu, 15 Dec 2016 01:35:33 GMT
Content-Length: 851
Connection: keep-alive

Example of Response Body

The following shows an example of the response body in JSON format.

{
    "defaultRetention": "42 days",
    "fullBackupSchedule": {
        "second": "0",
        "minute": "15",
        "hour": "2",
        "dayOfMonth": "*",
        "month": "*",
        "dayOfWeek": "Sat",
        "year": "*"
    },
    "incrementalBackupSchedule": {
        "second": "0",
        "minute": "30",
        "hour": "6",
        "dayOfMonth": "*",
        "month": "*",
        "dayOfWeek": "Sun,Mon,Tue,Wed,Thu,Fri",
        "year": "*"
    },
    "scheduledBackups": "ALL",
    "extendedRestoreTypes": "pit",
    "lastBackupDate": "2016-12-15T00:51:44.924+0000",
    "nextFullBackupDate": "2016-12-17T02:15:00.000+0000",
    "nextIncrementalBackupDate": "2016-12-15T06:30:00.000+0000",
    "backupDestination": "BOTH",
    "cloudStorageContainer": "Storage-exampleidentitydomain\/MyBackupContainer",
    "cloudStorageUser": "username",
    "totalCloudStorageContainerUsed": "2.8MB",
    "totalCloudStorageContainerUsedInBytes": 2955038,
    "totalBackupVolumeUsed": "2.8MB",
    "totalBackupVolumeUsedInBytes": 2955038,
    "percentBackupVolumeUsed": 0.0055041871964931
}