Queries 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 DescribeBackupPolicy

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

RegionId String Yes cn-hangzhou

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

DBInstanceName String Yes pxc-********

The name of the PolarDB-X instance whose backup policy you want to query.

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 B87E2AB3-B7C9-4394-9160-7F639F732031

The ID of the request.

Success Boolean true

Indicates whether the request is successful.

Data Array of Account

The data that is returned.

LogLocalRetentionSpace Integer 30

The maximum percentage of storage space that can be consumed by binary log (binlog) files.

DBInstanceName String pxc-xxxxxx

The name of the PolarDB-X instance.

BackupWay String P

The backup method. Valid values are L and P. L indicates logical backup, and P indicates physical backup.

BackupPeriod String 1001000

The backup cycle. Each digit in the value specifies whether backup is performed for the instance on a day of the week. The digit 0 indicates that backup is not performed on the day, and the digit 1 indicates that backup is performed on the day.

ForceCleanOnHighSpaceUsage Integer 1

Indicates whether 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. Valid values:

  • 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.
  • 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.
BackupType String 0

The type of the backup. Valid values:

  • 0: fast backup
  • 1: consistent backup
LocalLogRetention Integer 30

The number of hours for which log backup files can be 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 that the system starts to back up data.

BackupSetRetention Integer 7

The number of days for which the backup set is retained.

IsEnabled Integer 1

Indicates whether the log backup feature is enabled. Valid values:

  • 1: The log backup feature is enabled.
  • 0: The log backup feature is disabled.

Examples

Sample requests

http(s)://[Endpoint]/?Action=DescribeBackupPolicy
&RegionId=cn-hangzhou
&DBInstanceName=pxc-********
&<Common request parameters>

Sample success responses

XML format

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

<DescribeBackupPolicyResponse>
    <Message>success</Message>
    <RequestId>B87E2AB3-B7C9-4394-9160-7F639F732031</RequestId>
    <Success>true</Success>
    <Data>
        <LogLocalRetentionSpace>30</LogLocalRetentionSpace>
        <DBInstanceName>pxc-xxxxxx</DBInstanceName>
        <BackupWay>P</BackupWay>
        <BackupPeriod>1001000</BackupPeriod>
        <ForceCleanOnHighSpaceUsage>1</ForceCleanOnHighSpaceUsage>
        <BackupType>0</BackupType>
        <LocalLogRetention>30</LocalLogRetention>
        <RemoveLogRetention>7</RemoveLogRetention>
        <BackupPlanBegin>03:00Z</BackupPlanBegin>
        <BackupSetRetention>7</BackupSetRetention>
        <IsEnabled>1</IsEnabled>
    </Data>
</DescribeBackupPolicyResponse>

JSON format

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

{
  "Message" : "success",
  "RequestId" : "B87E2AB3-B7C9-4394-9160-7F639F732031",
  "Success" : true,
  "Data" : [ {
    "LogLocalRetentionSpace" : 30,
    "DBInstanceName" : "pxc-xxxxxx",
    "BackupWay" : "P",
    "BackupPeriod" : "1001000",
    "ForceCleanOnHighSpaceUsage" : 1,
    "BackupType" : "0",
    "LocalLogRetention" : 30,
    "RemoveLogRetention" : 7,
    "BackupPlanBegin" : "03:00Z",
    "BackupSetRetention" : 7,
    "IsEnabled" : 1
  } ]
}

Error codes

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