Queries the automatic SQL throttling rules of a specified database instance.

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

  • The region is set to cn-shanghai when you use an SDK to call Database Autonomy Service (DAS).
  • The database instance that you want to manage is of one of the following types:
    • An ApsaraDB RDS for MySQL instance of the High-availability Edition or the Enterprise Edition that runs MySQL 5.6, MySQL 5.7, or MySQL 8.0
    • A PolarDB for MySQL cluster of the Cluster Edition that runs MySQL 5.6, MySQL 5.7, or MySQL 8.0 or a PolarDB for MySQL cluster of the X-Engine that runs MySQL 8.0

Request parameters

Parameter Type Required Example Description
Action String Yes GetAutoThrottleRules

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

ConsoleContext String No None

A reserved parameter.

InstanceIds String No ['rm-2ze8g2am97624****','rm-2vc54m2a6pd6p****','rm-2ze9xrhze0709****']

The IDs of the database instances.

  • Specify this parameter in the JSONArray format. Separate instance IDs with commas (,). Example: ['Instance ID1','Instance ID2'].
  • By default, if you do not enter the ID of a database instance, all database instances for which automatic SQL throttling has been enabled within the current Alibaba Cloud account are returned. The following types of database instances are returned:
    • Database instances for which this feature is currently enabled.
    • Database instances for which this feature was once enabled but is currently disabled (excluding released database instances).

Response parameters

Parameter Type Example Description
Code Long 200

The returned HTTP status code.

Message String Successful

The message that is returned for the request.

Note If the request is successful, Successful is returned. If the request fails, an error message that contains information such as an error code is returned.
Data Object

The returned data.

TotalAutoThrottleRulesCount Long 3

The number of databases for which automatic SQL throttling has been enabled.

EnableAutoThrottleCount Long 1

The number of database instances for which automatic SQL throttling is currently enabled.

TurnOffAutoThrottleCount Long 1

The number of database instances for which automatic SQL throttling was once enabled but is currently disabled.

NeverEnableAutoThrottleOrReleasedInstanceCount Long 1

The number of database instances that do not exist or for which automatic SQL throttling has never been enabled.

Note Database instances that do not exist include database instances that have been released or those whose IDs are not correctly specified in the request.
EnableAutoThrottleList Array of enableAutoThrottleList

The list of database instances for which automatic SQL throttling is enabled.

AbnormalDuration double 2

The maximum period of time during which an exception occurs when automatic SQL throttling is triggered. Unit: minutes.

CpuUsage double 70

The CPU utilization threshold.

CpuSessionRelation String AND

The logical relationship between the CPU utilization threshold and the maximum number of active sessions. Valid values:

  • AND
  • OR
ActiveSessions Long 32

The maximum number of active sessions.

MaxThrottleTime double 10

The maximum throttling duration. Unit: minutes.

AllowThrottleStartTime String 00:00Z

The start time of the throttling window. The value of this parameter is in UTC.

AllowThrottleEndTime String 23:59Z

The end time of the throttling window. The value of this parameter is in UTC.

Visible Boolean true

Indicates whether automatic SQL throttling is enabled. Valid values:

  • true
  • false
AutoKillSession Boolean true

Indicates whether abnormal SQL statements in execution are terminated at the same time.

Note Abnormal SQL statements use the same template as the SQL statements that need to be throttled.
  • Valid values: true
  • false
InstanceId String rm-2ze8g2am97624****

The ID of the database instance.

UserId String 140692647406****

The ID of the Alibaba Cloud account that is used to create the database instance.

TurnOffAutoThrottleList Array of turnOffAutoThrottleList

The list of database instances for which automatic SQL throttling was once enabled but is currently disabled.

AbnormalDuration double 2

The maximum period of time during which automatic SQL throttling is triggered. Unit: minutes.

CpuUsage double 80

The CPU utilization threshold.

AllowThrottleEndTime String 23:59Z

The end time of the throttling window. The value of this parameter is in UTC.

InstanceId String rm-2ze9xrhze0709****

The ID of the database instance.

Visible Boolean false

Indicates whether automatic SQL throttling is enabled. Valid values:

  • true
  • false
CpuSessionRelation String OR

The logical relationship between the CPU utilization threshold and the maximum number of active sessions. Valid values:

  • AND
  • OR
AutoKillSession Boolean true

Indicates whether abnormal SQL statements in execution are terminated at the same time. Valid values:.

Note Abnormal SQL statements use the same template as the SQL statements that need to be throttled.
  • Valid values: true
  • false
ActiveSessions Long 64

The maximum number of active sessions.

MaxThrottleTime double 10

The maximum throttling duration. Unit: minutes.

UserId String 140692647406****

The ID of the Alibaba Cloud account that is used to create the database instance.

AllowThrottleStartTime String 00:00Z

The start time of the throttling window. The value of this parameter is in UTC.

NeverEnableAutoThrottleOrReleasedInstanceIdList Array of String rm-2vc54m2a6pd6p****

The ID of the database instance.

RequestId String 7172BECE-588A-5961-8126-C216E16B****

The ID of the request.

Success Boolean true

Indicates whether the request is successful. Valid values:

  • true
  • false

Examples

Sample requests

http(s)://das.cn-shanghai.aliyuncs.com/?Action=GetAutoThrottleRules
&InstanceIds=['rm-2ze8g2am97624****','rm-2vc54m2a6pd6p****','rm-2ze9xrhze0709****']
&<Common request parameters>

Sample success responses

XML format

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

<GetAutoThrottleRulesResponse>
    <Code>200</Code>
    <Message>Successful</Message>
    <Data>
        <TotalAutoThrottleRulesCount>3</TotalAutoThrottleRulesCount>
        <EnableAutoThrottleCount>1</EnableAutoThrottleCount>
        <TurnOffAutoThrottleCount>1</TurnOffAutoThrottleCount>
        <NeverEnableAutoThrottleOrReleasedInstanceCount>1</NeverEnableAutoThrottleOrReleasedInstanceCount>
        <EnableAutoThrottleList>
            <AbnormalDuration>2</AbnormalDuration>
            <CpuUsage>70</CpuUsage>
            <CpuSessionRelation>AND</CpuSessionRelation>
            <ActiveSessions>32</ActiveSessions>
            <MaxThrottleTime>10</MaxThrottleTime>
            <AllowThrottleStartTime>00:00Z</AllowThrottleStartTime>
            <AllowThrottleEndTime>23:59Z</AllowThrottleEndTime>
            <Visible>true</Visible>
            <AutoKillSession>true</AutoKillSession>
            <InstanceId>rm-2ze8g2am97624****</InstanceId>
            <UserId>140692647406****</UserId>
        </EnableAutoThrottleList>
        <TurnOffAutoThrottleList>
            <AbnormalDuration>2</AbnormalDuration>
            <CpuUsage>80</CpuUsage>
            <AllowThrottleEndTime>23:59Z</AllowThrottleEndTime>
            <InstanceId>rm-2ze9xrhze0709****</InstanceId>
            <Visible>false</Visible>
            <CpuSessionRelation>OR</CpuSessionRelation>
            <AutoKillSession>true</AutoKillSession>
            <ActiveSessions>64</ActiveSessions>
            <MaxThrottleTime>10</MaxThrottleTime>
            <UserId>140692647406****</UserId>
            <AllowThrottleStartTime>00:00Z</AllowThrottleStartTime>
        </TurnOffAutoThrottleList>
        <NeverEnableAutoThrottleOrReleasedInstanceIdList>rm-2vc54m2a6pd6p****</NeverEnableAutoThrottleOrReleasedInstanceIdList>
    </Data>
    <RequestId>7172BECE-588A-5961-8126-C216E16B****</RequestId>
    <Success>true</Success>
</GetAutoThrottleRulesResponse>

JSON format

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

{
  "Code" : 200,
  "Message" : "Successful",
  "Data" : {
    "TotalAutoThrottleRulesCount" : 3,
    "EnableAutoThrottleCount" : 1,
    "TurnOffAutoThrottleCount" : 1,
    "NeverEnableAutoThrottleOrReleasedInstanceCount" : 1,
    "EnableAutoThrottleList" : [ {
      "AbnormalDuration" : 2,
      "CpuUsage" : 70,
      "CpuSessionRelation" : "AND",
      "ActiveSessions" : 32,
      "MaxThrottleTime" : 10,
      "AllowThrottleStartTime" : "00:00Z",
      "AllowThrottleEndTime" : "23:59Z",
      "Visible" : true,
      "AutoKillSession" : true,
      "InstanceId" : "rm-2ze8g2am97624****",
      "UserId" : "140692647406****"
    } ],
    "TurnOffAutoThrottleList" : [ {
      "AbnormalDuration" : 2,
      "CpuUsage" : 80,
      "AllowThrottleEndTime" : "23:59Z",
      "InstanceId" : "rm-2ze9xrhze0709****",
      "Visible" : false,
      "CpuSessionRelation" : "OR",
      "AutoKillSession" : true,
      "ActiveSessions" : 64,
      "MaxThrottleTime" : 10,
      "UserId" : "140692647406****",
      "AllowThrottleStartTime" : "00:00Z"
    } ],
    "NeverEnableAutoThrottleOrReleasedInstanceIdList" : [ "rm-2vc54m2a6pd6p****" ]
  },
  "RequestId" : "7172BECE-588A-5961-8126-C216E16B****",
  "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.