Obtains the tags added by query governance to specified database instances.

Before you call this operation, make sure that the following requirements are met:

  • 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 the DAS service, you must set the region to cn-shanghai.
  • This operation can be used in 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 GetQueryOptimizeRuleList

The operation that you want to perform. Set the value to GetQueryOptimizeRuleList.

Engine String Yes MySQL

The database engine. Valid values:

  • MySQL
  • PolarDB MySQL
  • PostgreSQL
InstanceIds String No rm-2ze8g2am97624****

The instance IDs. Separate multiple IDs with commas (,).

TagNames String No None

A reserved parameter.

Response parameters

Parameter Type Example Description
Code String 200

The returned HTTP status code.

Message String Successful

The message that is returned for the request.

Data Object

Details of the returned entries.

Total Long 1

The total number of returned entries.

PageNo Integer None

A reserved parameter.

PageSize Integer None

A reserved parameter.

Extra String None

A reserved parameter.

List Array of Rules
Type String Predefined

The type of the tag. Predefined is returned, which indicates that the tag is added by the system.

Name String LARGE_ROWS_EXAMINED

The tag name. For more information, see Query governance.

RuleId String None

A reserved parameter.

RequestId String B6D17591-B48B-4D31-9CD6-9B9796B2****

The ID of the request.

Success String true

Indicates whether the request is successful. Valid values:

  • true
  • false

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=GetQueryOptimizeRuleList
&Engine=MySQL
&InstanceIds=rm-2ze8g2am97624****
&TagNames=None
&Common request parameters

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<GetQueryOptimizeRuleListResponse>
    <Code>200</Code>
    <Message>Successful</Message>
    <Data>
        <Total>1</Total>
        <Extra>None</Extra>
        <List>
            <Type>Predefined</Type>
            <Name>LARGE_ROWS_EXAMINED</Name>
            <RuleId>None</RuleId>
        </List>
    </Data>
    <RequestId>B6D17591-B48B-4D31-9CD6-9B9796B2****</RequestId>
    <Success>true</Success>
</GetQueryOptimizeRuleListResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Code" : "200",
  "Message" : "Successful",
  "Data" : {
    "Total" : 1,
    "Extra" : "None",
    "List" : [ {
      "Type" : "Predefined",
      "Name" : "LARGE_ROWS_EXAMINED",
      "RuleId" : "None"
    } ]
  },
  "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, visit the API Error Center.