DescribeDBInstanceSwitchLog
Queries the primary/secondary switchover logs of an instance.
Operation description
When you call this operation, the instance must meet the following conditions:
-
The instance is a replica set instance or a sharded cluster instance.
-
The instance uses local physical disks.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
dds:DescribeDBInstanceSwitchLog |
list |
*Instance
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| StartTime |
string |
No |
The start time of the query. The time is in the yyyy-mm-ddThh:mmZ format (UTC). |
2023-05-27T02:46Z |
| EndTime |
string |
No |
The end time of the query. The end time must be later than the start time. The time is in the yyyy-mm-ddThh:mmZ format (UTC). |
2023-05-28T02:00Z |
| PageNumber |
integer |
No |
The page number. Valid values: an integer greater than 0 and less than or equal to the maximum value of the INTEGER data type. Default value: 1. |
1 |
| PageSize |
integer |
No |
The number of entries per page. Valid values: 30, 50, and 100. Default value: 30. Valid values:
|
30 |
| DBInstanceId |
string |
No |
The instance ID. |
dds-uf68f1b5a57exxxx |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| RequestId |
string |
The ID of the request. |
ECBCA991-XXXX-XXXX-834C-B3E8007F33AA |
| DBInstanceId |
string |
The instance ID. |
dds-uf68f1b5a57exxxx |
| TotalCount |
integer |
The total number of primary/secondary switchover records returned in the query. |
1 |
| PageSize |
integer |
The number of entries per page. |
30 |
| PageNumber |
integer |
The current page number. |
1 |
| LogItems |
array<object> |
The list of primary/secondary switchover logs. |
|
|
object |
The switchover record. |
||
| SwitchStatus |
string |
The switchover status. Valid values:
|
1 |
| SwitchTime |
string |
The switchover time. The time is in the yyyy-mm-ddThh:mm:ssZ format (UTC). |
2023-02-07T18:00:00Z |
| SwitchCode |
string |
The cause code of the switchover. Valid values:
|
USER_CONSOLE_OPERATION |
| NodeId |
string |
Instance ID of the instance if the instance is a replica set instance, or instance ID of the switched node if the instance is a sharded cluster instance. |
If the instance is a replica set instance: dds-uf68f1b5a57exxxx. If the instance is a sharded cluster instance: d-uf652b73f554xxxx |
Examples
Success response
JSON format
{
"RequestId": "ECBCA991-XXXX-XXXX-834C-B3E8007F33AA",
"DBInstanceId": "dds-uf68f1b5a57exxxx",
"TotalCount": 1,
"PageSize": 30,
"PageNumber": 1,
"LogItems": [
{
"SwitchStatus": "1",
"SwitchTime": "2023-02-07T18:00:00Z",
"SwitchCode": "USER_CONSOLE_OPERATION",
"NodeId": "NodeId-example-id-****"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameterCombination | The end time must be greater than the start time | The start time must be earlier than the end time. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.