Consulta as regras de limitação automática de SQL de uma instância de banco de dados.
Descrição da operação
Antes de chamar esta operação, observe os seguintes itens:
-
Se você usar um SDK para chamar operações de API do Database Autonomy Service (DAS), deverá definir o ID da região como cn-shanghai.
-
A instância de banco de dados que você deseja gerenciar deve ser de um dos seguintes tipos:
-
ApsaraDB RDS for MySQL High-availability Edition ou Enterprise Edition que executa MySQL 5.6, MySQL 5.7 ou MySQL 8.0
-
PolarDB for MySQL Cluster Edition que executa MySQL 5.6, MySQL 5.7 ou MySQL 8.0
-
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
hdm:GetAutoThrottleRules |
none |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| ConsoleContext |
string |
Não |
O parâmetro reservado. |
None |
| InstanceIds |
string |
Não |
Os IDs das instâncias de banco de dados.
|
['rm-2ze8g2am97624****','rm-2vc54m2a6pd6p****','rm-2ze9xrhze0709****'] |
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
Os parâmetros de resposta. |
||
| Code |
integer |
O código de status HTTP retornado. |
200 |
| Message |
string |
A mensagem retornada. Nota
Se a solicitação for bem-sucedida, Successful será retornado. Se a solicitação falhar, uma mensagem de erro que contém informações como um código de erro será retornada. |
Successful |
| Data |
object |
Os dados retornados. |
|
| TotalAutoThrottleRulesCount |
integer |
O número de bancos de dados para os quais o recurso de limitação automática de SQL foi ativado. |
3 |
| EnableAutoThrottleCount |
integer |
O número de instâncias de banco de dados para as quais o recurso de limitação automática de SQL está atualmente ativado. |
1 |
| TurnOffAutoThrottleCount |
integer |
O número de instâncias de banco de dados para as quais o recurso de limitação automática de SQL foi ativado anteriormente, mas está atualmente desativado. |
1 |
| NeverEnableAutoThrottleOrReleasedInstanceCount |
integer |
O número de instâncias de banco de dados que não existem ou para as quais o recurso de limitação automática de SQL nunca foi ativado. Nota
Se uma instância de banco de dados não existir, a instância foi liberada ou o ID da instância especificado é inválido. |
1 |
| EnableAutoThrottleList |
array<object> |
As instâncias de banco de dados para as quais o recurso de limitação automática de SQL está atualmente ativado. |
|
|
object |
|||
| AbnormalDuration |
number |
The maximum period of time during which an exception occurs when automatic SQL throttling is triggered. Unit: minutes. |
2 |
| CpuUsage |
number |
The CPU utilization threshold. |
70 |
| CpuSessionRelation |
string |
The logical relationship between the CPU utilization threshold and the maximum number of active sessions. Valid values:
|
AND |
| ActiveSessions |
integer |
The maximum number of active sessions. |
32 |
| MaxThrottleTime |
number |
The maximum throttling duration. Unit: minutes. |
10 |
| AllowThrottleStartTime |
string |
The start time of the throttling window. The value of this parameter is in UTC. |
00:00Z |
| AllowThrottleEndTime |
string |
The end time of the throttling window. The value of this parameter is in UTC. |
23:59Z |
| Visible |
boolean |
Indicates whether the automatic SQL throttling feature is enabled. Valid values:
|
true |
| AutoKillSession |
boolean |
Indicates whether abnormal SQL statements in execution are terminated at a time. Valid values: Nota
Abnormal SQL statements use the same template as the SQL statements that need to be throttled.
|
true |
| InstanceId |
string |
The database instance ID. |
rm-2ze8g2am97624**** |
| UserId |
string |
The ID of the Alibaba Cloud account that is used to create the database instance. |
140692647406**** |
| TurnOffAutoThrottleList |
array<object> |
As instâncias de banco de dados para as quais o recurso de limitação automática de SQL foi ativado anteriormente, mas está atualmente desativado. |
|
|
object |
|||
| AbnormalDuration |
number |
The maximum period of time during which the automatic SQL throttling feature is triggered. Unit: minutes. |
2 |
| CpuUsage |
number |
The CPU utilization threshold. |
80 |
| AllowThrottleEndTime |
string |
The end time of the throttling window. The value of this parameter is in UTC. |
23:59Z |
| InstanceId |
string |
The database instance ID. |
rm-2ze9xrhze0709**** |
| Visible |
boolean |
Indicates whether the automatic SQL throttling feature is enabled. Valid values:
|
false |
| CpuSessionRelation |
string |
The logical relationship between the CPU utilization threshold and the maximum number of active sessions. Valid values:
|
OR |
| AutoKillSession |
boolean |
Indicates whether abnormal SQL statements in execution are terminated at a time. Valid values: Nota
Abnormal SQL statements use the same template as the SQL statements that need to be throttled.
|
true |
| ActiveSessions |
integer |
The maximum number of active sessions. |
64 |
| MaxThrottleTime |
number |
The maximum throttling duration. Unit: minutes. |
10 |
| UserId |
string |
The ID of the Alibaba Cloud account that is used to create the database instance. |
140692647406**** |
| AllowThrottleStartTime |
string |
The start time of the throttling window. The value of this parameter is in UTC. |
00:00Z |
| NeverEnableAutoThrottleOrReleasedInstanceIdList |
array |
O número de instâncias de banco de dados que não existem ou para as quais o recurso de limitação automática de SQL nunca foi ativado. Nota
Se uma instância de banco de dados não existir, a instância foi liberada ou o ID da instância especificado é inválido. |
|
|
string |
O ID da instância de banco de dados. |
rm-2vc54m2a6pd6p**** |
|
| RequestId |
string |
O ID da solicitação. |
7172BECE-588A-5961-8126-C216E16B**** |
| Success |
boolean |
Indica se a solicitação foi bem-sucedida. Valores válidos:
|
true |
Exemplos
Resposta de sucesso
JSON formato
{
"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
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | InvalidParams | The request parameters are invalid. | |
| 403 | NoPermission | You are not authorized to do this action. |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.