You can call the DescribeBackupPolicy operation to query the backup settings of an ApsaraDB RDS 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 type of backup that you want to perform. Valid values:
|
CompressType | String | No | 1 |
The format 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 |
---|---|---|---|
BackupRetentionPeriod | Integer | 7 |
The number of days for which data backup files are retained. |
PreferredBackupTime | String | 15:00Z-16:00Z |
The time when a backup is performed. The time follows the ISO 8601 standard in the HH:mmZ-HH:mmZ format. The time is displayed in UTC. |
PreferredBackupPeriod | String | Monday,Wednesday,Friday,Sunday |
The cycle based on which backups are performed. If more than one day of the week is specified, the days of the week are separated by commas (,). Valid values:
|
BackupLog | String | Enable |
Indicates whether the log backup feature is enabled. Value values: Enable and Disabled. |
LogBackupRetentionPeriod | Integer | 7 |
The number of days for which log backup files are retained. |
Duplication | String | Enable |
Indicates whether backup files are dumped to Object Storage Service (OSS) buckets. Valid values: Enable and Disabled. |
DuplicationContent | String | DATA&LOG |
The type of backup file that is dumped to OSS buckets. Valid values:
Note This parameter must be specified when you set the Duplication parameter to Enable.
|
DuplicationLocation | Struct |
The location where backup files are stored. |
|
Location | Struct |
The information about the location. |
|
Bucket | String | mybucket |
The name of the OSS bucket to which backup files are dumped. |
Endpoint | String | oss-cn-shanghai.aliyuncs.com |
The endpoint of the OSS bucket. |
Sotrage | String | OSS |
The media that is used to store backup files. In most cases, backup files are stored in OSS buckets. |
EnableBackupLog | String | 1 |
Indicates whether the log backup feature is enabled. Valid values:
|
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 log backup files. Valid values:
|
LocalLogRetentionHours | Integer | 0 |
The number of hours for which log backup files are retained on the instance. |
LocalLogRetentionSpace | String | 30 |
The maximum disk usage that is allowed for log backup files on the instance. |
LogBackupFrequency | String | LogInterval |
The frequency at which log backups are performed. Valid values:
Note The LogBackupFrequency parameter is supported only when the instance runs SQL Server
|
PreferredNextBackupTime | String | 2018-01-19T15:15Z |
The time when the next backup will be performed. The time follows the ISO 8601 standard in the yyyy-MM-ddTHH:mmZ format. The time is displayed in UTC. |
RequestId | String | B87E2AB3-B7C9-4394-9160-7F639F732031 |
The ID of the request. |
ArchiveBackupKeepCount | String | 1 |
The number of archived backup files that can be retained. |
ArchiveBackupKeepPolicy | String | ByMonth |
The cycle based on which archived backup files are retained. |
ArchiveBackupRetentionPeriod | String | 365 |
The number of days for which archived backup files are retained. |
BackupInterval | String | 30 |
The interval at which backups are performed.
|
Category | String | HighAvailability |
The RDS edition of the instance. Valid values:
|
CompressType | String | 1 |
The format that is used to compress backup data. Valid values:
|
LogBackupLocalRetentionNumber | Integer | 60 |
The number of log backup files that can be retained on the instance. |
ReleasedKeepPolicy | String | None |
The policy that is used to retain archived backup files if the instance is released. Valid values:
|
SupportReleasedKeep | Integer | 0 |
A hidden parameter. |
Examples
Sample requests
http(s)://rds.aliyuncs.com/? Action=DescribeBackupPolicy
&DBInstanceId=rm-uf6wjk5xxxxxxxxxx
&<Common request parameters>
Sample success responses
XML
format
<DescribeBackupPolicyResponse>
<Category>Standard</Category>
<ArchiveBackupRetentionPeriod>0</ArchiveBackupRetentionPeriod>
<RequestId>292884FE-D689-47A2-9829-C05E63366201</RequestId>
<Duplication></Duplication>
<ReleasedKeepPolicy>None</ReleasedKeepPolicy>
<ArchiveBackupKeepPolicy>ByMonth</ArchiveBackupKeepPolicy>
<PreferredBackupTime>00:00Z-01:00Z</PreferredBackupTime>
<LocalLogRetentionHours>18</LocalLogRetentionHours>
<PreferredNextBackupTime>2021-01-07T00:40Z</PreferredNextBackupTime>
<DuplicationLocation>
<Sotrage>OSS</Sotrage>
<Location>
<Endpoint></Endpoint>
<Bucket></Bucket>
</Location>
</DuplicationLocation>
<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>
<LocalLogRetentionSpace>30</LocalLogRetentionSpace>
<BackupRetentionPeriod>10</BackupRetentionPeriod>
<DuplicationContent></DuplicationContent>
<BackupInterval>30</BackupInterval>
</DescribeBackupPolicyResponse>
JSON
format
{
"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",
"DuplicationLocation": {
"Sotrage": "OSS",
"Location": {
"Endpoint": "",
"Bucket": ""
}
},
"HighSpaceUsageProtection": "Enable",
"CompressType": "1",
"LogBackupFrequency": "LogInterval",
"PreferredBackupPeriod": "Tuesday,Thursday,Saturday",
"ArchiveBackupKeepCount": 1,
"LogBackupRetentionPeriod": "7",
"LogBackupLocalRetentionNumber": 60,
"BackupLog": "Enable",
"EnableBackupLog": "1",
"SupportReleasedKeep": 0,
"LocalLogRetentionSpace": "30",
"BackupRetentionPeriod": 10,
"DuplicationContent": "",
"BackupInterval": "30"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
404 | InvalidDBInstance.NotFound | Specified instance does not exist or not support. | The error message returned because the specified instance does not exist. |
For a list of error codes, visit the API Error Center.