Queries SQL diagnostics records by pages.
Operation description
Before you call this operation, take note of the following items:
-
If you use an SDK to call API operations of Database Autonomy Service (DAS), you must set the region ID to cn-shanghai.
-
This operation supports the following database engines:
- ApsaraDB RDS for MySQL
- ApsaraDB RDS for PostgreSQL
- ApsaraDB RDS for SQL Server
- PolarDB for MySQL
- PolarDB for PostgreSQL (Compatible with Oracle)
- ApsaraDB for MongoDB
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 |
---|---|---|---|---|
hdm:GetRequestDiagnosisPage | get | *All Resources * |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The instance ID. | rm-0iwhhl8gx0ld6**** |
NodeId | string | No | The node ID. Note
You must specify the node ID if your database instance is a PolarDB for MySQL, PolarDB for PostgreSQL (Compatible with Oracle), or ApsaraDB for MongoDB instance.
| 202**** |
PageNo | integer | Yes | The page number. The value must be a positive integer. Default value: 1. | 1 |
PageSize | integer | Yes | The number of entries per page. The value must be a positive integer. Default value: 10. | 10 |
StartTime | long | Yes | The beginning of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. | 1633071840000 |
EndTime | long | Yes | The end of the time range to query. Set this parameter to a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC. | 1634972640000 |
Response parameters
Examples
Sample success responses
JSON
format
{
"Message": "Successful",
"RequestId": "800FBAF5-A539-5B97-A09E-C63AB2F7****",
"Data": {
"list": [
{
"messageId": "61820b594664275c4429****",
"uuid": "hdm_51fe9bc19ec413f4d530431af87a****",
"accountId": "2093****",
"sqlId": "0c95dae3afef77be06572612df9b****",
"engine": "MySQL",
"dbSchema": "das",
"param": "{\"\":\"\"}",
"state": 2,
"result": "{ \"endTime\":1636354256000, \"errorCode\":\"0001\", \"errorMessage\":\"TFX Successful\", \"estimateCost\":{ \"cpu\":1.7878745150389268, \"io\":9.948402604746128, \"rows\":8.889372575194633 }, \"improvement\":12933.97, \"indexAdvices\":[ { \"columns\":[ \"work_no\" ], \"ddlAddIndex\":\"ALTER TABLE `test`.`work_order` ADD INDEX `idx_workno` (`work_no`)\", \"indexName\":\"idx_workno\", \"schemaName\":\"test\", \"tableName\":\"work_order\", \"unique\":false } ], \"ip\":\"****.mysql.rds.aliyuncs.com\", \"messageId\":\"6188c8cb2f1365b16aee****\", \"port\":3306, \"sqlTag\":\"{\\\"PRED_EQUAL\\\":\\\"Y\\\",\\\"CNT_QB\\\":\\\"1\\\",\\\"CNT_TB\\\":\\\"1\\\"}\", \"startTime\":1636354252000, \"success\":true, \"support\":true, \"tuningAdvices\":[ ] }",
"gmtCreate": "1633071840000",
"gmtModified": "1633071850000"
}
],
"pageNo": 1,
"pageSize": 10,
"total": 100,
"extra": "{\"\":\"\"}"
},
"Code": "200",
"Success": "true"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidParams | The request parameters are invalid. |
403 | NoPermission | You are not authorized to do this action. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|