Todos os produtos
Search
Central de documentação

Cloud Monitor:DescribeMetricRuleTemplateAttribute

Última atualização: Jun 28, 2026

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

Experimente esta API no OpenAPI Explorer, sem necessidade de assinatura manual. Chamadas bem-sucedidas geram automaticamente código SDK correspondente aos seus parâmetros. Faça o download com segurança de credenciais integrada para uso local.

Testar

Autorização RAM

A tabela abaixo descreve a autorização necessária para chamar esta API. Você pode defini-la em uma política do Resource Access Management (RAM). As colunas da tabela estão detalhadas abaixo:

  • Ação: As ações que podem ser usadas no elemento Action das instruções de política de permissão do RAM para conceder permissões para executar a operação.

  • API: A API que você pode chamar para executar a ação.

  • Nível de acesso: O nível de acesso predefinido concedido para cada API. Valores válidos: create, list, get, update e delete.

  • Tipo de recurso: O tipo de recurso que suporta autorização para executar a ação. Indica se a ação suporta permissão em nível de recurso. O recurso especificado deve ser compatível com a ação. Caso contrário, a política será ineficaz.

    • Para APIs com permissões em nível de recurso, os tipos de recursos obrigatórios são marcados com um asterisco (*). Especifique o Nome de Recurso Alibaba Cloud (ARN) correspondente no elemento Resource da política.

    • Para APIs sem permissões em nível de recurso, é exibido como Todos os Recursos. Use um asterisco (*) no elemento Resource da política.

  • Chave de condição: As chaves de condição definidas pelo serviço. A chave permite controle granular, aplicando-se somente a ações ou a ações associadas a recursos específicos. Além das chaves de condição específicas do serviço, o Alibaba Cloud fornece um conjunto de chaves de condição comuns aplicáveis a todos os serviços compatíveis com RAM.

  • Ação dependente: As ações dependentes necessárias para executar a ação. Para concluir a ação, o usuário RAM ou a função RAM deve ter permissões para executar todas as ações dependentes.

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 Name ou TemplateId.

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 Name ou TemplateId.

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: A operação foi bem-sucedida.

  • false: A operação falhou.

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 (default): No action is performed.

  • INSUFFICIENT_DATA: An alert whose content is "Insufficient Data" is triggered.

  • OK: The status is considered normal.

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: greater than or equal to

  • GreaterThanThreshold: greater than

  • LessThanOrEqualToThreshold: less than or equal to

  • LessThanThreshold: less than

  • NotEqualToThreshold: not equal to

  • GreaterThanYesterday: greater than the value at the same time yesterday

  • LessThanYesterday: less than the value at the same time yesterday

  • GreaterThanLastWeek: greater than the value at the same time last week

  • LessThanLastWeek: less than the value at the same time last week

  • GreaterThanLastPeriod: greater than the value in the last period

  • LessThanLastPeriod: less than the value in the last period.

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 Statistics vary based on the Alibaba Cloud service. For more information, see Alibaba Cloud service metrics.

Average

Warn

object

The conditions that trigger Warn-level alerts.

ComparisonOperator

string

The comparison operator for Warn-level alerts. Valid values:

  • GreaterThanOrEqualToThreshold: greater than or equal to

  • GreaterThanThreshold: greater than

  • LessThanOrEqualToThreshold: less than or equal to

  • LessThanThreshold: less than

  • NotEqualToThreshold: not equal to

  • GreaterThanYesterday: greater than the value at the same time yesterday

  • LessThanYesterday: less than the value at the same time yesterday

  • GreaterThanLastWeek: greater than the value at the same time last week

  • LessThanLastWeek: less than the value at the same time last week

  • GreaterThanLastPeriod: greater than the value in the last period

  • LessThanLastPeriod: less than the value in the last period.

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 Statistics vary based on the Alibaba Cloud service. For more information, see Alibaba Cloud service metrics.

Average

Critical

object

The conditions that trigger Critical-level alerts.

ComparisonOperator

string

The comparison operator for Critical-level alerts. Valid values:

  • GreaterThanOrEqualToThreshold: greater than or equal to

  • GreaterThanThreshold: greater than

  • LessThanOrEqualToThreshold: less than or equal to

  • LessThanThreshold: less than

  • NotEqualToThreshold: not equal to

  • GreaterThanYesterday: greater than the value at the same time yesterday

  • LessThanYesterday: less than the value at the same time yesterday

  • GreaterThanLastWeek: greater than the value at the same time last week

  • LessThanLastWeek: less than the value at the same time last week

  • GreaterThanLastPeriod: greater than the value in the last period

  • LessThanLastPeriod: less than the value in the last period.

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 Statistics vary based on the Alibaba Cloud service. For more information, see Alibaba Cloud service metrics.

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.