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

ParameterTypeRequiredExampleDescription
ActionStringYesDescribeBackupPolicy

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

DBClusterIdStringYespc-*************

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query information about all your PolarDB clusters that are deployed in a specified region. The returned information includes the ID of each cluster.

Response parameters

ParameterTypeExampleDescription
PreferredBackupPeriodStringMonday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday

The backup cycle. Valid values:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
DataLevel1BackupRetentionPeriodString7

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

RequestIdStringEADFCE0F-9FB5-4685-B395-1440B******

The ID of the request.

PreferredBackupTimeString07:00Z-08:00Z

The time period when automatic backups are performed. The format is HH:mmZ-HH:mmZ. The time is displayed in UTC.

BackupRetentionPolicyOnClusterDeletionStringNONE

Indicates whether backups are retained when you delete a cluster. Valid values:

  • ALL: permanently retains all backups.
  • LATEST: permanently retains only the last backup.
  • NONE: does not retain backups.
PreferredNextBackupTimeString2020-11-16T07:30Z

The time point when the next automatic backup will be performed. The format is YYYY-MM-DDThh:mmZ. The time is displayed in UTC.

DataLevel2BackupRetentionPeriodString0

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 when a cluster is created. The default value 0 indicates that the level-2 backup feature is disabled.
BackupFrequencyStringNormal

The backup frequency. Valid values:

  • Normal: standard backup. The system backs up data once a day.
  • 2/24H: enhanced backup. The system backs up data every 2 hours.
  • 3/24H: enhanced backup. The system backs up data every 3 hours.
  • 4/24H: enhanced backup. The system backs up data every 4 hours.
Note
  • When enhanced backup is enabled, 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 every day.
  • When enhanced backup is enabled, the PreferredBackupPeriod parameter is automatically set to all days in a week (from Monday to Sunday).
DataLevel1BackupFrequencyStringNormal

The frequency of level-1 backups. Valid values:

  • Normal: standard backup. The system backs up data once a day.
  • 2/24H: enhanced backup. The system backs up data every 2 hours.
  • 3/24H: enhanced backup. The system backs up data every 3 hours.
  • 4/24H: enhanced backup. The system backs up data every 4 hours.
Note
  • If your cluster is a PolarDB for PostgreSQL(Compatible with Oracle) cluster or a PolarDB for PostgreSQL cluster, this parameter is not returned.
  • This parameter is returned only if the region where your PolarDB for MySQL cluster is deployed supports the cross-region backup feature. For information about regions that support the cross-region backup feature, see Overview.
DataLevel1BackupPeriodStringMonday,Tuesday

The backup cycle of level-1 backups. Valid values:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
Note
  • At least two values are returned. Multiple values are separated by commas (,).
  • If your cluster is a PolarDB for PostgreSQL(Compatible with Oracle) cluster or a PolarDB for PostgreSQL cluster, this parameter is not returned.
  • This parameter is returned only if the region where your PolarDB for MySQL cluster is deployed supports the cross-region backup feature. For information about regions that support the cross-region backup feature, see Overview.
DataLevel1BackupTimeString15:00Z-16:00Z

The time period during which automatic backup for level-1 backup is performed. The format is hh:mmZ-hh:mmZ format. The time is displayed in UTC. The start time and end time are on the hour and with an interval of one hour. Example: 14:00Z-15:00Z.

Note
  • If your cluster is a PolarDB for PostgreSQL(Compatible with Oracle) cluster or a PolarDB for PostgreSQL cluster, this parameter is not returned.
  • This parameter is returned only if the region where your PolarDB for MySQL cluster is deployed supports the cross-region backup feature. For information about regions that support the cross-region backup feature, see Overview.
DataLevel2BackupPeriodStringMonday,Tuesday

The backup cycle of level-2 backups. Valid values:

  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
  • Sunday
Note
  • At least two values are returned. Multiple values are separated by commas (,).
  • If your cluster is a PolarDB for PostgreSQL(Compatible with Oracle) cluster or a PolarDB for PostgreSQL cluster, this parameter is not returned.
  • This parameter is returned only if the region where your PolarDB for MySQL cluster is deployed supports the cross-region backup feature. For information about regions that support the cross-region backup feature, see Overview.
DataLevel2BackupAnotherRegionRetentionPeriodString30

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

  • 0: The cross-region level-2 backup feature is disabled.
  • 30 to 7300: Cross-region level-2 backups are retained for 30 to 7,300 days.
  • 1: Cross-region level-2 backups are permanently retained.
    Note The default value is 0 after you create a cluster. The default value 0 indicates that the level-2 backup feature is disabled.
DataLevel2BackupAnotherRegionRegionStringcn-hangzhou

The region where the cross-region level-2 backup is stored. For information about regions that support the cross-region backup feature, see Overview.

Examples

Sample requests

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

Sample success responses

XML format

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

<DescribeBackupPolicyResponse>
    <PreferredBackupPeriod>Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday</PreferredBackupPeriod>
    <DataLevel1BackupRetentionPeriod>7</DataLevel1BackupRetentionPeriod>
    <RequestId>EADFCE0F-9FB5-4685-B395-1440B******</RequestId>
    <PreferredBackupTime>07:00Z-08:00Z</PreferredBackupTime>
    <BackupRetentionPolicyOnClusterDeletion>NONE</BackupRetentionPolicyOnClusterDeletion>
    <PreferredNextBackupTime>2020-11-16T07:30Z</PreferredNextBackupTime>
    <DataLevel2BackupRetentionPeriod>0</DataLevel2BackupRetentionPeriod>
    <BackupFrequency>Normal</BackupFrequency>
    <DataLevel1BackupFrequency>Normal</DataLevel1BackupFrequency>
    <DataLevel1BackupPeriod>Monday,Tuesday</DataLevel1BackupPeriod>
    <DataLevel1BackupTime>15:00Z-16:00Z</DataLevel1BackupTime>
    <DataLevel2BackupPeriod>Monday,Tuesday</DataLevel2BackupPeriod>
    <DataLevel2BackupAnotherRegionRetentionPeriod>30</DataLevel2BackupAnotherRegionRetentionPeriod>
    <DataLevel2BackupAnotherRegionRegion>cn-hangzhou</DataLevel2BackupAnotherRegionRegion>
</DescribeBackupPolicyResponse>

JSON format

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

{
  "PreferredBackupPeriod" : "Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
  "DataLevel1BackupRetentionPeriod" : "7",
  "RequestId" : "EADFCE0F-9FB5-4685-B395-1440B******",
  "PreferredBackupTime" : "07:00Z-08:00Z",
  "BackupRetentionPolicyOnClusterDeletion" : "NONE",
  "PreferredNextBackupTime" : "2020-11-16T07:30Z",
  "DataLevel2BackupRetentionPeriod" : "0",
  "BackupFrequency" : "Normal",
  "DataLevel1BackupFrequency" : "Normal",
  "DataLevel1BackupPeriod" : "Monday,Tuesday",
  "DataLevel1BackupTime" : "15:00Z-16:00Z",
  "DataLevel2BackupPeriod" : "Monday,Tuesday",
  "DataLevel2BackupAnotherRegionRetentionPeriod" : "30",
  "DataLevel2BackupAnotherRegionRegion" : "cn-hangzhou"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidDBClusterId.MalformedThe specified parameter DBClusterId is not valid.The error message returned because the specified DBClusterId parameter is invalid.
404InvalidDBCluster.NotFoundThe DBClusterId provided does not exist in our records.The error message returned because the specified DBClusterId does not exist in the current record.

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