Queries the automatic backup policy of a PolarDB cluster.

Debugging

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

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

DBClusterId String Yes pc-*************

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query information about all clusters that are deployed in a specified region, such as the cluster ID.

Response parameters

Parameter Type Example Description
BackupFrequency String Normal

The backup frequency. Valid values:

  • Normal (default): standard backup. The system backs up data once a day.
  • 2/24H: enhanced backup. The system backs up data every 2 hours.
  • 3/24H: The enhanced backup. The system backs up data every 3 hours.
  • 4/24H: The enhanced backup. The system backs up data every 4 hours.
Note
  • After you enable enhanced backup, all backups are retained for 24 hours. Backups are automatically deleted when the retention period expires. However, the system permanently retains the first backup that is created after 00:00:00 every day.
  • After you enable enhanced backup, the PreferredBackupPeriod parameter is automatically set to all days in a week (from Monday to Sunday).
BackupRetentionPolicyOnClusterDeletion String NONE

Specifies whether to retain backups when you delete a cluster. Valid values:

  • ALL: permanently retains all backups.
  • LATEST: permanently retains the last backup.
  • NONE: does not retain backups.
DataLevel1BackupRetentionPeriod String 7

The retention period of level-1 backups. Valid values: 3 to 14. Unit: days.

DataLevel2BackupRetentionPeriod String 0

The retention period of level-2 backups. Valid values:

  • 0: The level-2 backup feature is disabled.
  • 30 to 7300: Level-2 backups are retained for 30 to 7,300 days.
  • -1: Level-2 backups are permanently retained.
    Note The default value is 0. By default, the level-2 backup feature is disabled when you create a cluster.
PreferredBackupPeriod String Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday

The backup cycle. Valid values:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
PreferredBackupTime String 07:00Z-08:00Z

The time period during which automatic backup was performed. The start time and the end time are displayed in UTC.

PreferredNextBackupTime String 2020-11-16T07:30Z

The start time for the next backup. The time is displayed in UTC.

RequestId String EADFCE0F-9FB5-4685-B395-1440B******

The ID of the request.

Examples

Sample requests

http(s)://polardb.aliyuncs.com/? Action=DescribeBackupPolicy
&DBClusterId=pc-*************
&<Common request parameters>

Sample success responses

XML format

<DescribeBackupPolicyResponse>
      <PreferredBackupPeriod>Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday</PreferredBackupPeriod>
      <DataLevel1BackupRetentionPeriod>7</DataLevel1BackupRetentionPeriod>
      <RequestId>1CB29F6D-2FFE-49F5-B8D9-D3469F******</RequestId>
      <BackupRetentionPolicyOnClusterDeletion>NONE</BackupRetentionPolicyOnClusterDeletion>
      <PreferredBackupTime>07:00Z-08:00Z</PreferredBackupTime>
      <BackupFrequency>Normal</BackupFrequency>
      <PreferredNextBackupTime>2020-11-16T07:30Z</PreferredNextBackupTime>
      <BackupRetentionPeriod>7</BackupRetentionPeriod>
      <DataLevel2BackupRetentionPeriod>0</DataLevel2BackupRetentionPeriod>
</DescribeBackupPolicyResponse>

JSON format

{
	"PreferredBackupPeriod": "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
	"DataLevel1BackupRetentionPeriod": 7,
	"RequestId": "1CB29F6D-2FFE-49F5-B8D9-D3469F******",
	"BackupRetentionPolicyOnClusterDeletion": "NONE",
    "PreferredBackupTime": "07:00Z-08:00Z",
    "BackupFrequency": "Normal",
	"PreferredNextBackupTime": "2020-11-16T07:30Z",
    "BackupRetentionPeriod": 7,
	"DataLevel2BackupRetentionPeriod": 0
}

Error codes

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