Queries the information about the slow query logs of a PolarDB cluster.
Operation description
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
polardb:DescribeSlowLogs | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
RegionId | string | Yes | The region ID of the cluster. | cn-hangzhou |
DBClusterId | string | Yes | The ID of cluster. | pc-**************** |
StartTime | string | Yes | The beginning of the time range to query. Specify the time in the yyyy-MM-ddZ format. The time must be in UTC. | 2021-05-01Z |
EndTime | string | Yes | The end of the time range to query. The end time must be later than the start time. The time span between the start time and the end time cannot exceed 31 days. Specify the time in the yyyy-MM-ddZ format. The time must be in UTC. | 2021-05-30Z |
DBName | string | No | The name of the database. | PolarDB_MySQL |
PageSize | integer | No | The number of entries to return on each page. Valid values: 30 to 100. Default value: 30. | 30 |
PageNumber | integer | No | The number of the page to return. Valid values: any non-zero positive integer. Default value: 1. | 1 |
Response parameters
Examples
Sample success responses
JSON
format
{
"TotalRecordCount": 5,
"PageRecordCount": 6,
"EndTime": "2021-05-30Z",
"RequestId": "2553A660-E4EB-4AF4-A402-8AFF70A49143",
"PageNumber": 3,
"StartTime": "2021-05-01Z",
"DBClusterId": "pc-****************",
"Items": {
"SQLSlowLog": [
{
"SQLText": "select id,name from tb_table",
"ReturnMaxRowCount": 3,
"CreateTime": "2021-05-30Z",
"MaxExecutionTime": 60,
"ParseTotalRowCounts": 2,
"TotalLockTimes": 1,
"TotalExecutionTimes": 2,
"DBNodeId": "pi-***************",
"SQLHASH": "U2FsdGVkxxxx",
"ParseMaxRowCount": 1,
"MaxLockTime": 1,
"ReturnTotalRowCounts": 1,
"DBName": "PolarDB_MySQL",
"TotalExecutionCounts": 2
}
]
},
"Engine": "polardb_mysql"
}
Error codes
HTTP status code | Error code | Error message | Description |
---|---|---|---|
400 | InvalidStartTime.Malformed | The specified parameter StartTime is not valid. | The specified StartTime parameter is invalid. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation | ||||
---|---|---|---|---|---|---|
2023-06-12 | The Error code has changed | see changesets | ||||
| ||||||
2022-04-21 | Add Operation | see changesets |