Consulta os detalhes de uma regra de alerta acionada por evento especificada ao chamar a operação DescribeEventRuleAttribute.
Descrição da operação
Este tópico fornece um exemplo de como consultar os detalhes da regra de alerta acionada por evento testRule.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
cms:DescribeEventRuleAttribute |
get |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| RuleName |
string |
Sim |
O nome da regra de alerta acionada por evento. Para obter informações sobre como obter o nome de uma regra de alerta acionada por evento, consulte DescribeEventRuleList. |
testRule |
| SilenceTime |
string |
Não |
O período de silenciamento. Unidade: segundos. Valor padrão: 86400 (1 dia). Nota
Quando os dados de monitoramento excedem continuamente o limite da regra de alerta, apenas uma notificação de alerta é enviada dentro de cada período de silenciamento. |
86400 |
Para obter mais informações sobre parâmetros de solicitação comuns, consulte Parâmetros comuns.
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
|||
| Code |
string |
O código de status. Nota
200 indica sucesso. |
200 |
| Message |
string |
A mensagem de erro. |
The alert does not exist. |
| RequestId |
string |
O ID da solicitação. |
9AA3F210-C03D-4C86-8DB6-21C84FF692A1 |
| Success |
boolean |
Indica se a operação foi bem-sucedida. Valores válidos:
|
true |
| Result |
object |
Os detalhes da regra de alerta acionada por evento. |
|
| EventType |
string |
O tipo de evento. Valores válidos:
|
SYSTEM |
| GroupId |
string |
O ID do grupo de aplicativos. |
3607**** |
| Name |
string |
O nome da regra de alerta acionada por evento. |
test_DefaultEventRule_7378**** |
| Description |
string |
A descrição da regra de alerta acionada por evento. |
Default group event rule. |
| State |
string |
O status da regra de alerta acionada por evento. Valores válidos:
|
ENABLED |
| EventPattern |
object |
O padrão de evento. Descreve as condições de acionamento do evento. |
|
| Product |
string |
The name of the cloud service. |
CloudMonitor |
| LevelList |
object |
||
| LevelList |
array |
The list of levels for the event-triggered alert rule. |
|
|
string |
The level of the event-triggered alert rule. Valid values:
|
["CRITICAL","WARN"] |
|
| StatusList |
object |
||
| StatusList |
array |
The list of statuses for the event-triggered alert rule. |
|
|
string |
The event status. |
Running |
|
| NameList |
object |
||
| NameList |
array |
The list of names for the event-triggered alert rule. |
|
|
string |
The event name. |
Agent_Status_Running |
|
| EventTypeList |
object |
||
| EventTypeList |
array |
The list of types for the event-triggered alert rule. |
|
|
string |
The type of the event-triggered alert rule.
|
* |
|
| SQLFilter |
string |
Filters logs by using SQL statements. An alert is triggered if the filter conditions are met. |
ycccluster1 and (i-23ij0o82612 or Executed1) or Asimulated not 222 |
| KeywordFilterObj |
object |
The filter keyword. |
|
| Keywords |
object |
||
| keyword |
array |
The list of keywords that match the event. |
|
|
string |
The keyword. |
VMException |
|
| Relation |
string |
The condition for multiple keywords. Valid values:
|
OR |
Exemplos
Resposta de sucesso
JSON formato
{
"Code": "200",
"Message": "The alert does not exist.",
"RequestId": "9AA3F210-C03D-4C86-8DB6-21C84FF692A1",
"Success": true,
"Result": {
"EventType": "SYSTEM",
"GroupId": "3607****",
"Name": "test_DefaultEventRule_7378****",
"Description": "Default group event rule.",
"State": "ENABLED",
"EventPattern": {
"Product": "CloudMonitor",
"LevelList": {
"LevelList": [
"[\"CRITICAL\",\"WARN\"] "
]
},
"StatusList": {
"StatusList": [
"Running"
]
},
"NameList": {
"NameList": [
"Agent_Status_Running"
]
},
"EventTypeList": {
"EventTypeList": [
"*"
]
},
"SQLFilter": "ycccluster1 and (i-23ij0o82612 or Executed1) or Asimulated not 222",
"KeywordFilterObj": {
"Keywords": {
"keyword": [
"VMException"
]
},
"Relation": "OR"
}
}
}
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | InvalidParameterValue | Illegal parameters. | Illegal parameters. |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. | |
| 404 | %s | %s |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.