Modifies the backup policy of a PolarDB-X instance.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes UpdateBackupPolicy

The operation that you want to perform. Set the value to UpdateBackupPolicy.

RegionId String Yes cn-hangzhou

The ID of the region where the PolarDB-X instance is deployed.

DBInstanceName String Yes pxc-hzjasdyuoo

The name of the PolarDB-X instance.

BackupPeriod String No 1001000

The backup cycle. The value must be string of seven digits to specify that backup is performed on at least two days in each week. Each digit specifies whether the system performs backup for the instance on a day of the week. The digit 0 specifies that backup is not performed on the day and the digit 1 specifies that the system performs backup for the instance on the day.

  • The first digit from the left side specifies whether the system performs backup for the instance on Monday.
  • The second digit from the left side specifies whether the system performs backup for the instance on Tuesday.
  • The third digit from the left side specifies whether the system performs backup for the instance on Wednesday.
  • The fourth digit from the left side specifies whether the system performs backup for the instance on Thursday.
  • The fifth digit from the left side specifies whether the system performs backup for the instance on Friday.
  • The sixth digit from the left side specifies whether the system performs backup for the instance on Saturday.
  • The seventh digit from the left side specifies whether the system performs backup for the instance on Sunday.
BackupPlanBegin String No 03:00Z

The point in time when the system starts to back up data on the specified days of the week. The value must be in the UTC time format.

BackupSetRetention Integer No 30

The period of time for which backup files are retained. Unit: day.

BackupType String No 0

The type of the backup. Set the value to 0. The value 0 specifies fast backup.

BackupWay String No P

The backup method. Valid values:

  • P: physical backup
  • L: logical backup
ForceCleanOnHighSpaceUsage Integer No 1

Specifies whether the system automatically deletes binary log (binlog) files when the space usage of the instance exceeds 80% or the remaining space of the instance is less than 50 GB. When the space usage of the instance exceeds 80% or the remaining space of the instance is less than 50 GB, the system can delete binlog files that are retained for the longest period of time till the total space usage drops below 80% and the remaining space is more than 50 GB. Valid values:

  • 1: The system automatically deletes binlog files when the space usage of the instance exceeds 80% or the remaining space of the instance is less than 50 GB.
  • 0: The system does not automatically delete binlog files when the space usage of the instance exceeds 80% or the remaining space of the instance is less than 50 GB.
IsEnabled Integer No 1

Specifies whether to enable the backup feature. Set the value to 1.

LocalLogRetention Integer No 7

The number of hours for which log backup files can be retained on the storage nodes of the PolarDB-X instance.

The value must be in the range of 0 to 168. The default value is 7. The unit is hour. If you set the value to 0, log backup files are not retained on the storage nodes of the PolarDB-X instance.

RemoveLogRetention Integer No 7

The number of days for which log backup files can be retained in the backup storage space that is provided by Alibaba Cloud. Valid values range from 7 to 730. The default value is 7.

LogLocalRetentionSpace Integer No 30

The maximum percentage of storage space that can be consumed by binlog files. Valid values range from 0 to 50. The default value is 30. When the specified percentage of space is fully occupied by binlog files, the system can delete the binlog files that are retained for the longest period of time till the space usage of binlog files drops to a value that is less than the specified value.

Response parameters

Parameter Type Example Description
Message String success

The message that is returned. If the request is successful, "success" is returned. If the request fails, an error code is returned.

RequestId String FEA5DC20-6D8A-5979-97AA-FC57546ADC20

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

Data Array of Account

The details of the backup policy.

LogLocalRetentionSpace Integer 30

The maximum percentage of storage space that can be consumed by binlog files. Valid values range from 0 to 50. The default value is 30. When the specified percentage of space is fully occupied by binlog files, the system can delete the binlog files that are retained for the longest period of time till the space usage of binlog files drops to a value that is less than the specified value.

DBInstanceName String pxc-hzjasdyuoo

The name of the PolarDB-X instance.

BackupWay String P

The backup method. The returned value is P or L.

  • P: physical backup
  • L: logical backup
BackupPeriod String 1001000

The backup cycle.

ForceCleanOnHighSpaceUsage Integer 1

Indicates whether the system automatically deletes binlog files.

BackupType String 0

The type of the backup. The value is 0. The value 0 indicates fast backup.

LocalLogRetention Integer 7

The number of hours for which log backup files are retained on the storage nodes of the PolarDB-X instance. Valid values range from 0 to 168. The default value is 7. If the value is 0, log backup files are not retained on the storage nodes of the PolarDB-X instance.

RemoveLogRetention Integer 7

The number of days for which log backup files can be retained in the backup storage space that is provided by Alibaba Cloud. Valid values range from 7 to 730. The default value is 7.

BackupPlanBegin String 03:00Z

The point in time when the system starts to back up data on the specified days of the week. The value is in the UTC time format.

BackupSetRetention Integer 30

The number of days for which backup files are retained.

IsEnabled Integer 1

Indicates whether the backup feature is enabled. The value is 1.

Examples

Sample requests

http(s)://[Endpoint]/?Action=UpdateBackupPolicy
&RegionId=cn-hangzhou
&DBInstanceName=pxc-hzjasdyuoo
&BackupPeriod=1001000
&BackupPlanBegin=03:00Z
&BackupSetRetention=30
&BackupType=0
&BackupWay=P
&ForceCleanOnHighSpaceUsage=1
&IsEnabled=1
&LocalLogRetention=7
&RemoveLogRetention=7
&LogLocalRetentionSpace=30
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<UpdateBackupPolicyResponse>
    <Message>success</Message>
    <RequestId>FEA5DC20-6D8A-5979-97AA-FC57546ADC20</RequestId>
    <Success>true</Success>
    <Data>
        <LogLocalRetentionSpace>30</LogLocalRetentionSpace>
        <DBInstanceName>pxc-hzjasdyuoo</DBInstanceName>
        <BackupWay>P</BackupWay>
        <BackupPeriod>1001000</BackupPeriod>
        <ForceCleanOnHighSpaceUsage>1</ForceCleanOnHighSpaceUsage>
        <BackupType>0</BackupType>
        <LocalLogRetention>7</LocalLogRetention>
        <RemoveLogRetention>7</RemoveLogRetention>
        <BackupPlanBegin>03:00Z</BackupPlanBegin>
        <BackupSetRetention>30</BackupSetRetention>
        <IsEnabled>1</IsEnabled>
    </Data>
</UpdateBackupPolicyResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Message" : "success",
  "RequestId" : "FEA5DC20-6D8A-5979-97AA-FC57546ADC20",
  "Success" : true,
  "Data" : [ {
    "LogLocalRetentionSpace" : 30,
    "DBInstanceName" : "pxc-hzjasdyuoo",
    "BackupWay" : "P",
    "BackupPeriod" : "1001000",
    "ForceCleanOnHighSpaceUsage" : 1,
    "BackupType" : "0",
    "LocalLogRetention" : 7,
    "RemoveLogRetention" : 7,
    "BackupPlanBegin" : "03:00Z",
    "BackupSetRetention" : 30,
    "IsEnabled" : 1
  } ]
}

Error codes

For a list of error codes, visit the API Error Center.