Queries a list of SQL patterns for an AnalyticDB for MySQL cluster within a period of time.
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 |
---|---|---|---|---|
adb:DescribeSQLPatterns | get |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBClusterId | string | Yes | The cluster ID. Note
You can call the DescribeDBClusters operation to query the information about all AnalyticDB for MySQL clusters in a region, including cluster IDs.
| am-bp1r053byu48p**** |
StartTime | string | Yes | The beginning of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
| 2021-09-30T00:10:00Z |
EndTime | string | Yes | The end of the time range to query. Specify the time in the ISO 8601 standard in the yyyy-MM-ddTHH:mm:ssZ format. The time must be in UTC. Note
The end time must be later than the start time.
| 2021-09-30T00:15:00Z |
RegionId | string | Yes | The region ID of the cluster. Note
You can call the DescribeRegions operation to query the most recent region list.
| cn-hangzhou |
Keyword | string | No | The keyword that is used for the query. | SELECT |
Order | string | Yes | The order by which to sort query results. Specify the parameter value in the JSON format. Example:
| [{"Field":"AverageQueryTime","Type":"Asc"}] |
PageNumber | integer | No | The page number. Pages start from page 1. Note
If you do not specify this parameter, the value 1 is used.
| 1 |
PageSize | integer | No | The number of entries per page. Valid values:
Note
If you do not specify this parameter, the value 30 is used.
| 30 |
Lang | string | No | The language of file titles and error messages. Valid values:
| zh |
Response parameters
Examples
Sample success responses
JSON
format
{
"PageNumber": 1,
"PageSize": 30,
"TotalCount": 1,
"PatternDetails": [
{
"SQLPattern": "SELECT * FROM KEPLER_META_NODE_STATIC_INFO WHERE elastic_node = ? OR (elastic_node = ? AND enable = ?)",
"PatternId": "5575924945138******",
"User": "reporter",
"AccessIp": "192.168.xx.xx",
"Tables": "tpch.orders",
"PatternCreationTime": "2021-11-12 03:06:00",
"AverageQueryTime": 4,
"MaxQueryTime": 2341,
"AverageExecutionTime": 234.78,
"MaxExecutionTime": 2142,
"AveragePeakMemory": 234.22,
"MaxPeakMemory": 234149,
"AverageScanSize": 234149.23,
"MaxScanSize": 234149,
"QueryCount": 345,
"FailedCount": 234,
"Blockable": true
}
],
"RequestId": "6BE0EDD1-0DE6-3EB6-81BF-BFE4F2******"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2021-10-12 | The response structure of the API has changed | View Change Details |