查询PolarDB集群日志信息,如主备切换日志。
调试
您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息
操作 |
访问级别 |
资源类型 |
条件关键字 |
关联操作 |
polardb:DescribeDBLogFiles |
list |
*DBCluster
|
无 | 无 |
请求参数
名称 |
类型 |
必填 |
描述 |
示例值 |
DBClusterId |
string |
是 |
集群 ID。 |
pc-************* |
DBNodeId |
string |
否 |
PolarDB 集群中节点的 ID。 |
pi-************* |
PageNumber |
integer |
否 |
页码,取值范围为大于 0 且不超过 Integer 的最大值的整数,默认值为 1。 |
1 |
PageSize |
integer |
否 |
每页记录数,取值:5 ~ 50。默认值:10。 |
10 |
StartTime |
string |
否 |
查询开始时间。格式为 YYYY-MM-DDThh:mm:ssZ(UTC 时间)。查询开始时间需要早于当前时间。 |
2023-08-20T16:00:00Z |
EndTime |
string |
否 |
查询结束时间,需晚于查询开始时间。格式为 YYYY-MM-DDThh:mm:ssZ(UTC 时间)。 |
2023-09-20T16:00:00Z |
LogType |
string |
是 |
日志类型,可选值:
枚举值:
|
HaSwitchLogList |
DescribeSimulateSwitchMode |
string |
否 |
||
SimulateListId |
string |
否 |
||
SimulateStatusList |
string |
否 |
||
SimulateModeList |
string |
否 |
返回参数
名称 |
类型 |
描述 |
示例值 |
object |
|||
TotalRecords |
integer |
总记录数。 |
160 |
ItemsNumbers |
integer |
当前页查询日志列表内的 Item 数量。 |
10 |
PageNumber |
integer |
页码,取值为大于 0 且不超过 Integer 数据类型的最大值,默认值为 1。 |
6 |
DBInstanceName |
string |
实例 ID。 |
pi-**************** |
DBInstanceType |
string |
实例类型,取值说明:
|
polardb_mysql_rw |
HaStatus |
integer |
主备切换记录是否存在。取值说明
|
1 |
HaLogItems |
array<object> |
主备切换日志列表 |
|
object |
|||
SwitchId |
string |
主备切换日志 ID |
e571f897-9b3c-4012-9470-88333832dec4 |
FromDBType |
string |
切换前实例类型,取值说明:
|
|
SwitchCauseCode |
string |
切换原因。 |
|
SwitchCauseDetail |
string |
||
SwitchStartTime |
string |
切换开始时间。 |
|
SwitchFinishTime |
string |
切换结束时间。 |
|
TotalSessions |
integer |
切换时总会话数。 |
|
AffectedSessions |
integer |
切换时影响会话数。 |
|
SwitchType |
integer |
切换类型。 |
0 |
RequestId |
string |
请求 ID。 |
24A1990B-4F6E-482B-B8CB-75C612****** |
PageSize |
integer |
每页记录数,取值:5~50。默认值:10。 |
10 |
SwitchListItems |
array<object> |
||
object |
|||
SimulateListId |
string |
||
SimulateMode |
string |
||
SimulateStatus |
string |
||
StartTime |
string |
||
EndTime |
string |
||
EventStartTime |
string |
||
EventFinishTime |
string |
||
SimulateTaskId |
string |
||
DBNodeCrashList |
array |
||
string |
|||
SwitchLogItems |
array<object> |
||
object |
|||
SimulateListId |
string |
||
SimulateLogId |
string |
||
DBInstanceId |
string |
||
SrcDbType |
string |
||
DstDbType |
string |
||
SimulateStatus |
string |
||
EventStartTime |
string |
||
EventFinishTime |
string |
||
SwitchStepItems |
array<object> |
||
object |
|||
StepName |
string |
||
StartTime |
string |
||
SimulatePhase |
string |
||
EndTime |
string |
||
TimeCost |
string |
||
IsSuccess |
string |
||
SwitchStepItems |
array<object> |
||
object |
|||
SimulatePhase |
string |
||
StepName |
string |
||
StartTime |
string |
||
EndTime |
string |
||
TimeCost |
string |
||
IsSuccess |
string |
||
DBNodeId |
string |
||
FaultInjectionType |
string |
||
SwitchLogItems |
array<object> |
||
object |
|||
SimulateListId |
string |
||
Simulatecode |
string |
||
DBInstanceId |
string |
||
SrcDbType |
string |
||
DstDbType |
string |
||
SimulateStatus |
string |
||
EventStartTime |
string |
||
EventFinishTime |
string |
||
SwitchStepItems |
array<object> |
||
object |
|||
StepName |
string |
||
StepMsg |
string |
||
StartTime |
string |
||
EndTime |
string |
||
TimeCost |
string |
||
IsSuccess |
string |
||
SimulatePhase |
string |
||
DBNodeId |
string |
示例
正常返回示例
JSON
格式
{
"TotalRecords": 160,
"ItemsNumbers": 10,
"PageNumber": 6,
"DBInstanceName": "pi-****************",
"DBInstanceType": "polardb_mysql_rw",
"HaStatus": 1,
"HaLogItems": [
{
"SwitchId": "e571f897-9b3c-4012-9470-88333832dec4",
"FromDBType": "",
"SwitchCauseCode": "",
"SwitchCauseDetail": "",
"SwitchStartTime": "",
"SwitchFinishTime": "",
"TotalSessions": 0,
"AffectedSessions": 0,
"SwitchType": 0
}
],
"RequestId": "24A1990B-4F6E-482B-B8CB-75C612******",
"PageSize": 10,
"SwitchListItems": [
{
"SimulateListId": "",
"SimulateMode": "",
"SimulateStatus": "",
"StartTime": "",
"EndTime": "",
"EventStartTime": "",
"EventFinishTime": "",
"SimulateTaskId": "",
"DBNodeCrashList": [
""
],
"SwitchLogItems": [
{
"SimulateListId": "",
"SimulateLogId": "",
"DBInstanceId": "",
"SrcDbType": "",
"DstDbType": "",
"SimulateStatus": "",
"EventStartTime": "",
"EventFinishTime": "",
"SwitchStepItems": [
{
"StepName": "",
"StartTime": "",
"SimulatePhase": "",
"EndTime": "",
"TimeCost": "",
"IsSuccess": ""
}
]
}
],
"SwitchStepItems": [
{
"SimulatePhase": "",
"StepName": "",
"StartTime": "",
"EndTime": "",
"TimeCost": "",
"IsSuccess": "",
"DBNodeId": ""
}
],
"FaultInjectionType": ""
}
],
"SwitchLogItems": [
{
"SimulateListId": "",
"Simulatecode": "",
"DBInstanceId": "",
"SrcDbType": "",
"DstDbType": "",
"SimulateStatus": "",
"EventStartTime": "",
"EventFinishTime": "",
"SwitchStepItems": [
{
"StepName": "",
"StepMsg": "",
"StartTime": "",
"EndTime": "",
"TimeCost": "",
"IsSuccess": "",
"SimulatePhase": "",
"DBNodeId": ""
}
]
}
]
}
错误码
HTTP status code |
错误码 |
错误信息 |
描述 |
---|---|---|---|
400 | InvalidDBClusterId.Malformed | The specified parameter DBClusterId is not valid. | |
400 | InvalidPageSize.Malformed | The specified parameter PageSize is not valid. | 指定的参数PageSize无效 |
400 | InvalidPageNumber.Malformed | The specified parameter PageNumber is not valid. | 指定的参数PageNumber无效 |
404 | InvalidDBCluster.NotFound | The DBClusterId provided does not exist in our records. | 当前的记录中不存在提供的DBClusterId。 |
访问错误中心查看更多错误码。
变更历史
更多信息,参考变更详情。