Consulta os detalhes de um modelo de alerta chamando a operação DescribeMetricRuleTemplateAttribute.
Descrição da operação
Este tópico fornece um exemplo de como consultar os detalhes do modelo de alerta 70****.
Experimente agora
Testar
Autorização RAM
|
Ação |
Nível de acesso |
Tipo de recurso |
Chave de condição |
Ação dependente |
|
cms:DescribeMetricRuleTemplateAttribute |
get |
*All Resource
|
Nenhuma | Nenhuma |
Parâmetros da solicitação
|
Parâmetro |
Tipo |
Obrigatório |
Descrição |
Exemplo |
| Name |
string |
Não |
O nome do modelo de alerta. Você deve definir Para informações sobre como obter o nome do modelo de alerta, consulte DescribeMetricRuleTemplateList. |
ECS_Template1 |
| TemplateId |
string |
Não |
O ID do modelo de alerta. Você deve definir Para informações sobre como obter o ID do modelo de alerta, consulte DescribeMetricRuleTemplateList. |
70**** |
Para mais informações sobre parâmetros de solicitação comuns, consulte Parâmetros comuns.
Elementos de resposta
|
Elemento |
Tipo |
Descrição |
Exemplo |
|
object |
Os parâmetros de resposta. |
||
| Code |
integer |
O código de status HTTP. Nota
O valor 200 indica sucesso. |
200 |
| Message |
string |
A mensagem de erro. |
The specified resource is not found. |
| RequestId |
string |
O ID da solicitação. |
8F3A82AD-DA92-52B0-8EC6-C059D1C3839F |
| Success |
boolean |
Indica se a operação foi bem-sucedida. Valores válidos:
|
true |
| Resource |
object |
Os detalhes do modelo de alerta. |
|
| Description |
string |
A descrição do modelo de alerta. |
ECS template |
| Name |
string |
O nome do modelo de alerta. |
ECS_Template1 |
| RestVersion |
string |
A versão do modelo de alerta. |
1 |
| TemplateId |
string |
O ID do modelo de alerta. |
70**** |
| AlertTemplates |
object |
||
| AlertTemplate |
array<object> |
The alert templates. |
|
|
array<object> |
The alert template. |
||
| MetricName |
string |
The metric name. |
cpu_total |
| Selector |
string |
The extended options of the alert dimension. |
{"disk":"/"} |
| Webhook |
string |
The URL that triggers an alert callback. |
https://www.aliyun.com |
| Namespace |
string |
The namespace of the Alibaba Cloud service. |
acs_ecs_dashboard |
| Category |
string |
The abbreviation of the Alibaba Cloud service name. |
ecs |
| RuleName |
string |
The name of the alert rule. |
ECS_Rule |
| NoDataPolicy |
string |
The processing method when no monitoring data is found. Valid values:
|
KEEP_LAST_STATE |
| Escalations |
object |
The threshold and alert level. |
|
| Info |
object |
The conditions that trigger Info-level alerts. |
|
| ComparisonOperator |
string |
The comparison operator for Info-level alerts. Valid values:
|
GreaterThanOrEqualToThreshold |
| Times |
integer |
The number of retries for Info-level alerts. |
3 |
| Threshold |
string |
The threshold for Info-level alerts. |
90 |
| Statistics |
string |
The statistical method for Info-level alerts. The valid values of |
Average |
| Warn |
object |
The conditions that trigger Warn-level alerts. |
|
| ComparisonOperator |
string |
The comparison operator for Warn-level alerts. Valid values:
|
GreaterThanOrEqualToThreshold |
| Times |
integer |
The number of retries for Warn-level alerts. |
3 |
| Threshold |
string |
The threshold for Warn-level alerts. |
90 |
| Statistics |
string |
The statistical method for Warn-level alerts. The valid values of |
Average |
| Critical |
object |
The conditions that trigger Critical-level alerts. |
|
| ComparisonOperator |
string |
The comparison operator for Critical-level alerts. Valid values:
|
GreaterThanOrEqualToThreshold |
| Times |
integer |
The number of retries for Critical-level alerts. |
5 |
| Threshold |
string |
The threshold for Critical-level alerts. |
90 |
| Statistics |
string |
The statistical method for Critical-level alerts. The valid values of |
Average |
| Labels |
object |
||
| Labels |
array<object> |
The labels of the alert template. |
|
|
object |
The label of the alert template. |
||
| Key |
string |
The key of the alert template label. |
label1 |
| Value |
string |
The value of the alert template label. |
value1 |
| SilenceTime |
integer |
The mute period. Unit: seconds. |
3600 |
Exemplos
Resposta de sucesso
JSON formato
{
"Code": 200,
"Message": "The specified resource is not found.",
"RequestId": "8F3A82AD-DA92-52B0-8EC6-C059D1C3839F",
"Success": true,
"Resource": {
"Description": "ECS template",
"Name": "ECS_Template1",
"RestVersion": "1",
"TemplateId": "70****",
"AlertTemplates": {
"AlertTemplate": [
{
"MetricName": "cpu_total",
"Selector": "{\"disk\":\"/\"}",
"Webhook": "https://www.aliyun.com",
"Namespace": "acs_ecs_dashboard",
"Category": "ecs",
"RuleName": "ECS_Rule",
"NoDataPolicy": "KEEP_LAST_STATE",
"Escalations": {
"Info": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 3,
"Threshold": "90",
"Statistics": "Average"
},
"Warn": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 3,
"Threshold": "90",
"Statistics": "Average"
},
"Critical": {
"ComparisonOperator": "GreaterThanOrEqualToThreshold",
"Times": 5,
"Threshold": "90",
"Statistics": "Average"
}
},
"Labels": {
"Labels": [
{
"Key": "label1",
"Value": "value1"
}
]
},
"SilenceTime": 3600
}
]
}
}
}
Códigos de erro
|
Código de status HTTP |
Código de erro |
Mensagem de erro |
Descrição |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 400 | %s | %s | |
| 412 | %s | %s | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 403 | AccessForbidden | User not authorized to operate on the specified resource. | |
| 404 | ResourceNotFound | The specified resource is not found. | The specified resource is not found. |
| 409 | %s | %s |
Consulte Códigos de Erro para uma lista completa.
Notas de versão
Consulte Notas de Versão para uma lista completa.