调用DescribeBinlogFiles接口查询Binlog日志。
- 当DownloadLink为NULL时,表示RDS没有提供下载链接URL;
- 当DownloadLink不为NULL时,用户可以根据此URL下载备份文件,此URL已设置过期时间LinkExpiredTime,请在过期时间之前下载。
- 返回的日志列表中包含日志记录结束时间在查询开始时间之后,并且日志记录开始时间在查询结束时间之前的所有日志。
本接口不适用于SQL Server实例。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。
请求参数
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|
名称 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeBinlogFiles |
系统规定参数,取值:DescribeBinlogFiles。 |
DBInstanceId | String | 是 | rm-uf6wjk5xxxxxxx |
实例ID。 |
EndTime | String | 是 | 2011-06-20T15:00:00Z |
查询结束时间,大于查询开始时间。格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。 |
StartTime | String | 是 | 2011-06-01T15:00:00Z |
查询开始时间。格式:yyyy-MM-ddTHH:mm:ssZ(UTC时间)。 |
PageSize | Integer | 否 | 30 |
每页记录数,取值:30~100。默认值:30。 |
PageNumber | Integer | 否 | 1 |
页码,取值:大于0且不超过Integer的最大值。 默认值:1。 |
返回数据
示例
请求示例
http(s)://rds.aliyuncs.com/?Action=DescribeBinlogFiles
&DBInstanceId=rm-uf6wjk5xxxxxxx
&StartTime=2011-06-01T15:00:00Z
&EndTime=2011-06-20T15:00:00Z
&<公共请求参数>
正常返回示例
XML
格式
<DescribeBinlogFilesResponse>
<?xml version="1.0" encoding="UTF-8" ?>
<TotalRecordCount>1</TotalRecordCount>
<PageRecordCount>1</PageRecordCount>
<RequestId>C91A2FEA-DDBE-5BE1-9944-9C8DA6E45334</RequestId>
<PageNumber>1</PageNumber>
<TotalFileSize>439562</TotalFileSize>
<Items>
<BinLogFile>
<DownloadLink>http://rdslog********.aliyuncs.com/mysql-bin.000071</DownloadLink>
<LogBeginTime>2021-10-13T07:44:37Z</LogBeginTime>
<LinkExpiredTime>2021-10-17T03:16:50Z</LinkExpiredTime>
<Checksum>261972378**********</Checksum>
<LogEndTime>2021-10-13T13:44:39Z</LogEndTime>
<IntranetDownloadLink>http://rdslog********.aliyuncs.com/mysql-bin.000071</IntranetDownloadLink>
<RemoteStatus>Completed</RemoteStatus>
<HostInstanceID>1947****</HostInstanceID>
<LogFileName>mysql-bin.000071</LogFileName>
<FileSize>439562</FileSize>
</BinLogFile>
</Items>
</DescribeBinlogFilesResponse>
JSON
格式
{
"TotalRecordCount": 1,
"PageRecordCount": 1,
"RequestId": "C91A2FEA-DDBE-5BE1-9944-9C8DA6E45334",
"PageNumber": 1,
"TotalFileSize": "439562",
"Items": {
"BinLogFile": [
{
"DownloadLink": "http://rdslog********.aliyuncs.com/mysql-bin.000071",
"LogBeginTime": "2021-10-13T07:44:37Z",
"LinkExpiredTime": "2021-10-17T03:16:50Z",
"Checksum": "261972378**********",
"LogEndTime": "2021-10-13T13:44:39Z",
"IntranetDownloadLink": "http://rdslog********.aliyuncs.com/mysql-bin.000071",
"RemoteStatus": "Completed",
"HostInstanceID": 1947****,
"LogFileName": "mysql-bin.000071",
"FileSize": 439562
}
]
}
}
错误码
HttpCode | 错误码 | 错误信息 | 描述 |
---|
HttpCode | 错误码 | 错误信息 | 描述 |
---|---|---|---|
400 | ParameterLeastAssociate | Must input at least one optional parameter. | 还原时间或备份集不能同时为空,请设置后重试。 |
404 | InvalidDBInstance.NotFound | Specified instance does not exist or not support. | 指定的实例不存在指定的实例被删除或者实例不支持当前操作。 |
400 | ParameterAbsence | Necessary parameter is absence. | 必要的参数未传。 |
403 | IncorrectDBInstanceEngine | Current DB Instance engine does not support this operation. | 操作失败,数据库引擎不支持。 |
403 | IncorrectDBInstanceState | Current DB instance state does not support this operation. | 操作失败,该实例状态下不支持此操作。 |
403 | IncorrectDBInstanceLockMode | Current DB instance lock mode does not support this operation. | 操作失败,实例处于锁定状态。 |
访问错误中心查看更多错误码。