All Products
Search
Document Center

Cloud Monitor:DescribeMetricRuleTemplateAttribute

Last Updated:Jan 23, 2026

Call the DescribeMetricRuleTemplateAttribute operation to query the details of an alert template.

Operation description

This example shows how to query the details of the alert template 70****.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:DescribeMetricRuleTemplateAttribute

get

*All Resource

*

None None

Request parameters

Parameter

Type

Required

Description

Example

Name

string

No

The name of the alert template. You must specify either the Name or TemplateId parameter.

For more information about how to obtain the name of an alert template, see DescribeMetricRuleTemplateList.

ECS_Template1

TemplateId

string

No

The ID of the alert template. You must specify either the Name or TemplateId parameter.

For more information about how to obtain the ID of an alert template, see DescribeMetricRuleTemplateList.

70****

For more information about common request parameters, see Common parameters.

Response elements

Element

Type

Description

Example

object

The response that is returned.

Code

integer

The status code.

Note

A status code of 200 indicates that the request was successful.

200

Message

string

The error message.

The specified resource is not found.

RequestId

string

The request ID.

8F3A82AD-DA92-52B0-8EC6-C059D1C3839F

Success

boolean

Indicates whether the operation was successful. Valid values:

  • true: The operation was successful.

  • false: The operation failed.

true

Resource

object

The details of the alert template.

Description

string

The description of the alert template.

ECS模板

Name

string

The name of the alert template.

ECS_Template1

RestVersion

string

The version of the alert template.

1

TemplateId

string

The ID of the alert template.

70****

AlertTemplates

object

AlertTemplate

array<object>

The alert templates.

array<object>

The alert template.

MetricName

string

The name of the metric.

cpu_total

Selector

string

The extended options for the alert dimensions.

{"disk":"/"}

Webhook

string

The URL of the alert callback that is triggered.

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 method used to handle alerts when no monitoring data is available. Valid values:

  • KEEP_LAST_STATE (default): No action is taken.

  • INSUFFICIENT_DATA: An alert whose content is "No data" is triggered.

  • OK: The status is Normal.

KEEP_LAST_STATE

Escalations

object

The thresholds and alert levels.

Info

object

The conditions for triggering an Info-level alert.

ComparisonOperator

string

The comparison operator for the threshold of the Info-level alert. 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 previous epoch

  • LessThanLastPeriod: less than the value in the previous epoch

GreaterThanOrEqualToThreshold

Times

integer

The number of retries for the Info-level alert.

3

Threshold

string

The threshold for the Info-level alert.

90

Statistics

string

The statistical method for the Info-level alert.

The valid values of the Statistics parameter vary for different Alibaba Cloud services. For more information, see Metrics.

Average

Warn

object

The conditions for triggering a Warn-level alert.

ComparisonOperator

string

The comparison operator for the threshold of the Warn-level alert. 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 previous epoch

  • LessThanLastPeriod: less than the value in the previous epoch

GreaterThanOrEqualToThreshold

Times

integer

The number of retries for the Warn-level alert.

3

Threshold

string

The threshold for the Warn-level alert.

90

Statistics

string

The statistical method for the Warn-level alert.

The valid values of the Statistics parameter vary for different Alibaba Cloud services. For more information, see Metrics.

Average

Critical

object

The conditions for triggering a Critical-level alert.

ComparisonOperator

string

The comparison operator for the threshold of the Critical-level alert. 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 previous epoch

  • LessThanLastPeriod: less than the value in the previous epoch

GreaterThanOrEqualToThreshold

Times

integer

The number of retries for the Critical-level alert.

5

Threshold

string

The threshold for the Critical-level alert.

90

Statistics

string

The statistical method for the Critical-level alert.

The valid values of the Statistics parameter vary for different Alibaba Cloud services. For more information, see Metrics.

Average

Labels

object

Labels

array<object>

The labels of the alert template.

object

The label of the alert template.

Key

string

The label key of the alert template.

label1

Value

string

The label value of the alert template.

value1

SilenceTime

integer

The mute period of the channel. Unit: seconds.

3600

Examples

Success response

JSON format

{
  "Code": 200,
  "Message": "The specified resource is not found.",
  "RequestId": "8F3A82AD-DA92-52B0-8EC6-C059D1C3839F",
  "Success": true,
  "Resource": {
    "Description": "ECS模板",
    "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
        }
      ]
    }
  }
}

Error codes

HTTP status code

Error code

Error message

Description

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

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.