Queries information about the best-performing and worst-performing instances based on query governance data.
- If you use an Alibaba Cloud SDK, make sure that the aliyun-sdk-core version is later than V2.1.8. We recommend that you use the latest version.
- The version of your Database Autonomy Service (DAS) SDK must be V2.1.8 or later.
- If you use an SDK to call API operations of DAS, you must set the region ID to cn-shanghai.
- This operation is applicable to the following database services:
- ApsaraDB RDS for MySQL
- PolarDB for MySQL
- ApsaraDB RDS for PostgreSQL
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | GetQueryOptimizeDataTop | The operation that you want to perform. Set the value to GetQueryOptimizeDataTop. |
Engine | String | Yes | MySQL | The database engine. Valid values:
|
InstanceIds | String | No | rm-2ze8g2am97624**** | The instance IDs. Separate multiple IDs with commas (,). |
TagNames | String | No | None | A reserved parameter. |
Time | String | Yes | 1642953600000 | The end of the time range to query. Specify the time in the UNIX timestamp format. Unit: milliseconds. |
Type | String | Yes | RED | The type of instances that you want to query. Valid values:
|
Region | String | No | cn-china | The region in which the instance resides. Valid values:
This parameter is valid only if the InstanceIds parameter is left empty. If you do not specify the InstanceIds parameter, the system obtains data from the region set by the Region parameter. By default, the Region parameter is set to cn-china. If you have specified the InstanceIds parameter, the specified Region parameter becomes invalid and the system obtains data from the region in which the first specified instance resides. Note If your instances reside in the regions inside the Chinese mainland, set this parameter to cn-china. |
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
Code | String | 200 | The HTTP status code returned. |
Message | String | Successful | The message that is returned for the request. |
Data | Object | The details about the instances. | |
Total | Long | 10 | The total number of entries returned. |
PageNo | Integer | None | A reserved parameter. |
PageSize | Integer | None | A reserved parameter. |
Extra | String | None | A reserved parameter. |
List | Array of QueryOptimizeDataTops | The information about the instances. | |
InstanceId | String | rm-2ze8g2am97624**** | The ID of the instance. |
Type | String | sqlExecuteCount | The metric name. Valid values:
|
Value | double | 100 | The metric value. |
RequestId | String | B6D17591-B48B-4D31-9CD6-9B9796B2**** | The ID of the request. |
Success | String | true | Indicates whether the request was successful. Valid values:
|
Examples
Sample requests
http(s)://das.cn-shanghai.aliyuncs.com/?Action=GetQueryOptimizeDataTop
&Engine=MySQL
&InstanceIds=rm-2ze8g2am97624****
&TagNames=None
&Time=1642953600000
&Type=RED
&Region=cn-china
&Common request parameters
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<GetQueryOptimizeDataTopResponse>
<Code>200</Code>
<Message>Successful</Message>
<Data>
<Total>10</Total>
<Extra>None</Extra>
<List>
<InstanceId>rm-2ze8g2am97624****</InstanceId>
<Type>sqlExecuteCount</Type>
<Value>100</Value>
</List>
</Data>
<RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
<Success>true</Success>
</GetQueryOptimizeDataTopResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"Code" : "200",
"Message" : "Successful",
"Data" : {
"Total" : 10,
"Extra" : "None",
"List" : [ {
"InstanceId" : "rm-2ze8g2am97624****",
"Type" : "sqlExecuteCount",
"Value" : 100
} ]
},
"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 error message returned because the specified request parameters are invalid. |
For a list of error codes, see Service error codes.