调用DescribeBackupPolicy接口查询实例备份设置。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeBackupPolicy | 系统规定参数,取值:DescribeBackupPolicy。 |
DBInstanceId | String | 是 | rm-uf6wjk5xxxxxxx | 实例ID。 |
BackupPolicyMode | String | 否 | DataBackupPolicy | 备份类型,取值:
|
CompressType | String | 否 | 1 | 备份压缩方式,取值:
|
ReleasedKeepPolicy | String | 否 | Lastest | 已删除实例的归档备份保留策略。取值:
|
返回数据
名称 | 类型 | 示例值 | 描述 |
---|---|---|---|
BackupRetentionPeriod | Integer | 7 | 数据备份保留天数。 |
PreferredBackupTime | String | 15:00Z-16:00Z | 数据备份时间,格式:HH:mmZ-HH:mmZ(UTC时间)。 |
PreferredBackupPeriod | String | Monday,Wednesday,Friday,Sunday | 数据备份周期,多个取值用英文逗号(,)隔开,取值:
|
BackupLog | String | Enable | 日志备份开关,取值:Enable | Disabled |
LogBackupRetentionPeriod | Integer | 7 | 日志备份保留天数。 |
Duplication | String | Enable | 是否将备份文件转储至OSS,取值:Enable | Disabled |
DuplicationContent | String | DATA&LOG | 转储数据备份或者日志备份,取值:
说明 当
Duplication=
Enable时,本参数必填。
|
DuplicationLocation | Struct | 备份文件的存储位置。 |
|
Location | Struct | 位置信息。 |
|
Bucket | String | mybucket | 转储的目标OSS Bucket的名称。 |
Endpoint | String | oss-cn-shanghai.aliyuncs.com | 转储目的域的名称。 |
Sotrage | String | OSS | 备份存储的介质。通常保存在OSS上。 |
EnableBackupLog | String | 1 | 是否开启日志备份,取值:
|
HighSpaceUsageProtection | String | Enable | 实例使用空间大于80%,或者剩余空间小于5GB时,是否强制清理Binlog:
|
LocalLogRetentionHours | Integer | 0 | 本地日志备份保留小时数。 |
LocalLogRetentionSpace | String | 30 | 本地日志最大空间使用率。 |
LogBackupFrequency | String | LogInterval | 日志备份频率,取值:
说明 参数
LogBackupFrequency仅适用于SQL Server。
|
PreferredNextBackupTime | String | 2018-01-19T15:15Z | 下次备份时间。格式:yyyy-MM-ddTHH:mmZ(UTC时间)。 |
RequestId | String | B87E2AB3-B7C9-4394-9160-7F639F732031 | 请求ID。 |
ArchiveBackupKeepCount | String | 1 | 归档备份的保留个数。 |
ArchiveBackupKeepPolicy | String | ByMonth | 归档备份的保留周期。 |
ArchiveBackupRetentionPeriod | String | 365 | 归档备份的保留天数。 |
BackupInterval | String | 30 | 备份间隔:
|
BackupMethod | String | Physical | 实例的备份方式。返回值:
说明 仅SQL Server云盘版实例会返回本参数。
|
Category | String | HighAvailability | 实例系列,取值:
|
CompressType | String | 1 | 备份压缩方式,取值:
|
LogBackupLocalRetentionNumber | Integer | 60 | 本地Binlog保留个数。 |
ReleasedKeepPolicy | String | None | 已删除实例的归档备份保留策略。取值:
|
SupportReleasedKeep | Integer | 0 | 备用参数。 |
SupportVolumeShadowCopy | Integer | 1 | 实例是否支持快照备份。返回值:
|
示例
请求示例
http(s)://rds.aliyuncs.com/?Action=DescribeBackupPolicy &DBInstanceId=rm-uf6wjk5xxxxxxxxxx &<公共请求参数>
正常返回示例
XML
格式
<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> <SupportVolumeShadowCopy>1</SupportVolumeShadowCopy> <LocalLogRetentionSpace>30</LocalLogRetentionSpace> <BackupRetentionPeriod>10</BackupRetentionPeriod> <DuplicationContent></DuplicationContent> <BackupInterval>30</BackupInterval> </DescribeBackupPolicyResponse>
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", "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, "SupportVolumeShadowCopy": 1, "LocalLogRetentionSpace": "30", "BackupRetentionPeriod": 10, "DuplicationContent": "", "BackupInterval": "30" }
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
404 | InvalidDBInstance.NotFound | Specified instance does not exist or not support. | 指定的实例不存在 |
400 | InvalidParameter.OwnerAccount | The specified parameter OwnerAccount is not valid. | 参数OwnerAccount不合法 |
访问错误中心查看更多错误码。