Queries the diagnostic suggestions generated by the DAS automatic SQL optimization feature.
Operation description
The SQL diagnostics feature provides instance diagnosis suggestions. You can use the suggestions to optimize instance indexes. For details, see Automatic SQL optimization.
You can invoke this operation only to query diagnostic suggestions generated by the DAS automatic SQL optimization feature.
Before you begin:
The database DPI engine is RDS MySQL or PolarDB for MySQL.
If you use the China site (aliyun.com) or DAS SDK, use the latest version.
When you invoke DAS by using the SDK, set the region to cn-shanghai.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
hdm:GetSqlOptimizeAdvice |
get |
*All Resource
|
None | None |
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| ConsoleContext |
string |
No |
A reserved parameter. |
None |
| Engine |
string |
No |
The database engine. Valid values:
|
MySQL |
| InstanceIds |
string |
No |
The instance ID. Note
Only RDS MySQL and PolarDB for MySQL instances are supported. |
rm-2ze1jdv45i7l6**** |
| StartDt |
string |
No |
The start date of the query. Format: yyyyMMdd (UTC).
|
20210916 |
| EndDt |
string |
No |
The end date of the query. Format: yyyyMMdd (UTC).
|
20210917 |
| Region |
string |
No |
The region to which the instance belongs. Valid values:
This parameter takes effect only when the InstanceIds request parameter is left empty. If InstanceIds is left empty, data is retrieved based on the region specified by the Region parameter. The default region is cn-china. If InstanceIds is not empty, data is retrieved based on the region of the first instance specified by InstanceIds, even if the Region parameter is set. Note
For instances created in regions within the Chinese mainland, set this parameter to cn-china. |
cn-china |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
string |
The status code returned. |
200 |
| Message |
string |
The message returned for the request. Note
If the request is successful, Successful is returned. If the request fails, an error message is returned, such as an error code. |
Successful |
| Data |
object |
The details, including the total number of entries and error codes. |
|
| Status |
string |
The task status. Valid values:
|
FINISH |
| StatusCode |
string |
The task status code. Valid values:
|
SUCCESS |
| DownloadUrl |
string |
The download URL of the file. |
https://das-sql-optimize.oss-cn-shanghai.aliyuncs.com/adb/oss_sql_optimize_advice/1083******* |
| CreateTime |
string |
The time when the task was created. The value is a UNIX timestamp. Unit: milliseconds. |
1632303861000 |
| ExpireTime |
string |
The time when the file expires. The value is a UNIX timestamp. Unit: milliseconds. Note
The file expires three days after the task is created. |
1632563061000 |
| TaskId |
string |
The task ID. |
2021091710461519216**** |
| RequestId |
string |
The request ID. |
B6D17591-B48B-4D31-9CD6-9B9796B2**** |
| Success |
string |
Indicates whether the request is successful. Valid values:
|
true |
Examples
Success response
JSON format
{
"Code": "200",
"Message": "Successful",
"Data": {
"Status": "FINISH",
"StatusCode": "SUCCESS",
"DownloadUrl": "https://das-sql-optimize.oss-cn-shanghai.aliyuncs.com/adb/oss_sql_optimize_advice/1083*******",
"CreateTime": "1632303861000",
"ExpireTime": "1632563061000",
"TaskId": "2021091710461519216****"
},
"RequestId": "B6D17591-B48B-4D31-9CD6-9B9796B2****",
"Success": "true"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | The request parameters are invalid. |
| 403 | NoPermission | You are not authorized to do this action. | You do not have the permissions to perform this operation. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.