Queries the diagnostic information about SQL statements that meet a query condition for an AnalyticDB for MySQL cluster.
Operation description
For information about the endpoints of AnalyticDB for MySQL, see Endpoints.
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:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis 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:DescribeDiagnosisRecords | list | *All Resources * |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| DBClusterId | string | Yes | The Enterprise Edition, Basic Edition, or Data Lakehouse Edition cluster ID. Note
You can call the DescribeDBClusters operation to query the IDs of all AnalyticDB for MySQL clusters within a region.
| amv-bp1scs48yc125**** |
| StartTime | string | Yes | The beginning of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. Note
You can query data only within the last 14 days.
| 1632931200000 |
| EndTime | string | Yes | The end of the time range to query. Set the time to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. Note
| 1633017540000 |
| 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 |
| QueryCondition | string | Yes | The query condition for SQL statements, which can contain the
| {"Type":"status","Value":"finished"} |
| Keyword | string | No | The query keyword of the SQL statements. | select |
| MinPeakMemory | long | No | The minimum peak memory of the SQL statements. Unit: bytes. | 0 |
| MaxPeakMemory | long | No | The maximum peak memory of the SQL statements. Unit: bytes. | 89000000 |
| MinScanSize | long | No | The minimum scan size of the SQL statements. Unit: bytes. | 0 |
| MaxScanSize | long | No | The maximum scan size of the SQL statements. Unit: bytes. | 1024000000 |
| ResourceGroup | string | No | The resource group to which the SQL statements belong. Note
You can call the DescribeDiagnosisDimensions operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.
| user_default |
| UserName | string | No | The username that is used to execute the SQL statements. You can call the DescribeDiagnosisDimensions operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition. | test_user |
| Database | string | No | The name of the database on which the SQL statements are executed. Note
You can call the DescribeDiagnosisDimensions operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.
| adb_demo |
| ClientIp | string | No | The source IP address. Note
You can call the DescribeDiagnosisDimensions operation to query the resource groups, database names, usernames, and source IP addresses of the SQL statements that meet a query condition.
| 59.82.XX.XX |
| Order | string | No | The order in which to sort the SQL statements by field, which contains the
| [{"Field":"StartTime", "Type": "desc" }] |
| PageNumber | integer | No | The page number. Pages start from page 1. Default value: 1. | 1 |
| PageSize | integer | No | The number of entries per page. Valid values:
| 30 |
| Lang | string | No | The language of file titles and error messages. Valid values:
| zh |
| PatternId | string | No | The SQL pattern ID. | 5575924945138****** |
Response parameters
Examples
Sample success responses
JSONformat
{
"PageNumber": 1,
"PageSize": 30,
"TotalCount": 1,
"Querys": [
{
"SQL": "SELECT count(*)\\nFROM nation",
"SQLTruncatedThreshold": 5120,
"Status": "finished",
"OutputDataSize": 9,
"Cost": 10,
"OutputRows": 1,
"RcHost": "10.0.XX.XX:3004",
"ScanSize": 9,
"ProcessId": "2021093000414401000000023503151******",
"StartTime": 1632933704000,
"SQLTruncated": false,
"Database": "adb_demo",
"ScanRows": 1,
"ResourceCostRank": 1,
"ClientIp": "59.82.XX.XX",
"PeakMemory": 16648,
"QueueTime": 6,
"ResourceGroup": "user_default",
"UserName": "test_user",
"ExecutionTime": 6,
"TotalPlanningTime": 4,
"EtlWriteRows": 0,
"TotalStages": 2,
"QueryProperties": [
{
"Name": "max_select_items_count",
"Value": 1024
}
],
"PatternId": "-5575924945138******"
}
],
"RequestId": "7F88BEFA-CF0B-5C95-8BB1-92EC9F09E40D"
}Error codes
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2024-10-21 | The response structure of the API has changed | View Change Details |
| 2024-08-30 | The response structure of the API has changed | View Change Details |
| 2023-09-13 | The internal configuration of the API is changed, but the call is not affected | View Change Details |
