You can call the DescribeBackupPolicy operation to query the backup settings of an instance.
Debugging
Request parameters
| Parameter | Type | Required | Example | Description |
|---|---|---|---|---|
| Action | String | Yes | DescribeBackupPolicy |
The operation that you want to perform. Set the value to DescribeBackupPolicy. |
| DBInstanceId | String | Yes | rm-uf6wjk5xxxxxxx |
The ID of the instance. |
| BackupPolicyMode | String | No | DataBackupPolicy |
The backup type. Valid values:
|
| CompressType | String | No | 1 |
The method that is used to compress backup data. Valid values:
|
| ReleasedKeepPolicy | String | No | Lastest |
The policy that is used to retain archived backup files if the instance is released. Valid values:
|
Response parameters
| Parameter | Type | Example | Description |
|---|---|---|---|
| LogBackupRetentionPeriod | Integer | 7 |
The number of days for which log backup files are retained. |
| ArchiveBackupKeepPolicy | String | ByMonth |
The cycle based on which archived backup files are retained. |
| ArchiveBackupKeepCount | String | 1 |
The number of archived backup files that are retained. |
| LocalLogRetentionHours | Integer | 0 |
The number of hours for which log backup files are retained on the instance. |
| BackupRetentionPeriod | Integer | 7 |
The number of days for which data backup files are retained. |
| RequestId | String | B87E2AB3-B7C9-4394-9160-7F639F732031 |
The ID of the request. |
| PreferredBackupPeriod | String | Monday,Wednesday,Friday,Sunday |
The cycle based on which you want to perform a backup. Separate multiple values with commas (,). Valid values:
|
| CompressType | String | 1 |
The method that is used to compress backup data. Valid values:
|
| SupportReleasedKeep | Integer | 0 |
A reserved parameter. |
| LocalLogRetentionSpace | String | 30 |
The maximum disk usage that is allowed for log backup files on the instance. |
| SupportVolumeShadowCopy | Integer | 1 |
Indicates whether the instance supports snapshot backups. Valid values:
Note This parameter is returned only when the instance runs SQL Server.
|
| BackupMethod | String | Physical |
The backup method of the instance. Valid values:
Note This parameter is returned only when the instance runs SQL Server and uses standard
SSDs or enhanced SSDs (ESSDs).
|
| LogBackupFrequency | String | LogInterval |
The backup frequency of logs. Valid values:
Note The LogBackupFrequency parameter is returned only when the instance runs SQL Server.
|
| PreferredNextBackupTime | String | 2018-01-19T15:15Z |
The time when the next backup is performed. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC. |
| HighSpaceUsageProtection | String | Enable |
Indicates whether the log backup deletion feature is enabled. If the disk usage exceeds 80% or the remaining disk space is less than 5 GB on the instance, this feature deletes binary log files. Valid values:
|
| ArchiveBackupRetentionPeriod | String | 365 |
The number of days for which archived backup files are retained. |
| BackupInterval | String | 30 |
The backup interval. Unit: minutes.
|
| ReleasedKeepPolicy | String | None |
The policy that is used to retain archived backup files if the instance is released. Valid values:
|
| PreferredBackupTime | String | 15:00Z-16:00Z |
The time when a data backup is performed. The time follows the ISO 8601 standard in the HH:mmZ-HH:mmZ format. The time is displayed in UTC. |
| LogBackupLocalRetentionNumber | Integer | 60 |
The number of binary log files that are retained on the instance. |
| Category | String | Standard |
Indicates whether to enable the single-digit second backup feature. This feature allows ApsaraDB RDS to complete a backup within single-digit seconds. Valid values:
Note This parameter takes effect only when you set the BackupPolicyMode parameter to DataBackupPolicy.
|
| EnableBackupLog | String | 1 |
Indicates whether the log backup feature is enabled. Valid values:
|
| BackupLog | String | Enable |
Indicates whether the log backup feature is enabled. Valid values:
|
| EnableIncrementDataBackup | Boolean | True |
Indicates whether incremental backup is enabled. Valid values:
|
Examples
Sample requests
http(s)://rds.aliyuncs.com/?Action=DescribeBackupPolicy
&DBInstanceId=rm-uf6wjk5xxxxxxxxxx
&<Common request parameters>
Sample success responses
XML format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeBackupPolicyResponse>
<Category>Standard</Category>
<ArchiveBackupRetentionPeriod>0</ArchiveBackupRetentionPeriod>
<RequestId>292884FE-D689-47A2-9829-C05E63366201</RequestId>
<Duplication/>
<ReleasedKeepPolicy>None</ReleasedKeepPolicy>
<ArchiveBackupKeepPolicy>ByMonth</ArchiveBackupKeepPolicy>
<PreferredBackupTime>00:00Z-01:00Z</PreferredBackupTime>
<LocalLogRetentionHours>18</LocalLogRetentionHours>
<PreferredNextBackupTime>2021-01-07T00:40Z</PreferredNextBackupTime>
<HighSpaceUsageProtection>Enable</HighSpaceUsageProtection>
<CompressType>1</CompressType>
<LogBackupFrequency>LogInterval</LogBackupFrequency>
<PreferredBackupPeriod>Tuesday,Thursday,Saturday</PreferredBackupPeriod>
<ArchiveBackupKeepCount>1</ArchiveBackupKeepCount>
<LogBackupRetentionPeriod>7</LogBackupRetentionPeriod>
<LogBackupLocalRetentionNumber>60</LogBackupLocalRetentionNumber>
<BackupLog>Enable</BackupLog>
<EnableBackupLog>1</EnableBackupLog>
<SupportReleasedKeep>0</SupportReleasedKeep>
<SupportVolumeShadowCopy>1</SupportVolumeShadowCopy>
<LocalLogRetentionSpace>30</LocalLogRetentionSpace>
<BackupRetentionPeriod>10</BackupRetentionPeriod>
<DuplicationContent/>
<BackupInterval>30</BackupInterval>
</DescribeBackupPolicyResponse>
JSON format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Category" : "Standard",
"ArchiveBackupRetentionPeriod" : 0,
"RequestId" : "292884FE-D689-47A2-9829-C05E63366201",
"Duplication" : "",
"ReleasedKeepPolicy" : "None",
"ArchiveBackupKeepPolicy" : "ByMonth",
"PreferredBackupTime" : "00:00Z-01:00Z",
"LocalLogRetentionHours" : "18",
"PreferredNextBackupTime" : "2021-01-07T00:40Z",
"HighSpaceUsageProtection" : "Enable",
"CompressType" : "1",
"LogBackupFrequency" : "LogInterval",
"PreferredBackupPeriod" : "Tuesday,Thursday,Saturday",
"ArchiveBackupKeepCount" : 1,
"LogBackupRetentionPeriod" : "7",
"LogBackupLocalRetentionNumber" : 60,
"BackupLog" : "Enable",
"EnableBackupLog" : "1",
"SupportReleasedKeep" : 0,
"SupportVolumeShadowCopy" : 1,
"LocalLogRetentionSpace" : "30",
"BackupRetentionPeriod" : 10,
"DuplicationContent" : "",
"BackupInterval" : "30"
}
Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | IO.Exception | IO exception, retry later. | The error message returned because I/O errors occurred. |
| 400 | InternalFailure | Internal failure, retry later. | The error message returned because the request failed. Try again later. |
| 400 | InvalidParameter.OwnerAccount | The specified parameter OwnerAccount is not valid. | The error message returned because the value of the OwnerAccount parameter is invalid. Check the value. |
| 404 | InvalidDBInstance.NotFound | Specified instance does not exist or not support. | The error message returned because the instance cannot be found, is deleted, or does not support the operation. |
For a list of error codes, visit the API Error Center.