All Products
Search
Document Center

CloudMonitor:DescribeMetricRuleTemplateAttribute

Last Updated:Mar 01, 2024

Queries the details of an alert template.

Operation description

This topic provides an example on how to query the details of an alert template whose ID is 70****.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
NamestringNo

The name of the alert template. You must specify at least one of the Name and TemplateId parameters.

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

ECS_Template1
TemplateIdstringNo

The ID of the alert template. You must specify at least one of the Name and TemplateId parameters.

For 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 parameters

ParameterTypeDescriptionExample
object

The returned result.

Codeinteger

The HTTP status code.

Note The status code 200 indicates that the request was successful.
200
Messagestring

The error message returned.

The specified resource is not found.
RequestIdstring

The request ID.

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

Indicates whether the request was successful. Valid values:

  • true
  • false
true
Resourceobject

The details of the alert template.

Descriptionstring

The description of the alert template.

Namestring

The name of the alert template.

ECS_Template1
RestVersionstring

The version of the alert template.

1
TemplateIdstring

The ID of the alert template.

70****
AlertTemplatesobject []

The queried alert templates.

MetricNamestring

The metric name.

cpu_total
Selectorstring

The dimension of the alert. It is an extended field.

{"disk":"/"}
Webhookstring

The callback URL to which a request is sent when an alert is triggered.

https://www.aliyun.com
Namespacestring

The namespace of the Alibaba Cloud service.

acs_ecs_dashboard
Categorystring

The abbreviation of the Alibaba Cloud service name.

ecs
RuleNamestring

The name of the alert rule.

ECS_Rule
NoDataPolicystring

The method that is used to handle alerts when no monitoring data is found. Valid values:

  • KEEP_LAST_STATE (default): No operation is performed.
  • INSUFFICIENT_DATA: An alert whose content is "Insufficient data" is triggered.
  • OK: The status is considered normal.
KEEP_LAST_STATE
Escalationsobject

The threshold and the alert level.

Infoobject

The conditions for triggering Info-level alerts.

ComparisonOperatorstring

The comparison operator that is used to compare the metric value with the threshold for Info-level alerts. Valid values:

  • GreaterThanOrEqualToThreshold: greater than or equal to the threshold
  • GreaterThanThreshold: greater than the threshold
  • LessThanOrEqualToThreshold: less than or equal to the threshold
  • LessThanThreshold: less than the threshold
  • NotEqualToThreshold: not equal to the threshold
  • GreaterThanYesterday: greater than the metric value at the same time yesterday
  • LessThanYesterday: less than the metric value at the same time yesterday
  • GreaterThanLastWeek: greater than the metric value at the same time last week
  • LessThanLastWeek: less than the metric value at the same time last week
  • GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
  • LessThanLastPeriod: less than the metric value in the last monitoring cycle
GreaterThanOrEqualToThreshold
Timesinteger

The consecutive number of times for which the metric value meets the alert condition before an Info-level alert is triggered.

3
Thresholdstring

The threshold for Info-level alerts.

90
Statisticsstring

The statistical method for Info-level alerts.

The value of the Statistics parameter varies with the cloud service. For more information, see Appendix 1: Metrics.

Average
Warnobject

The conditions for triggering Warn-level alerts.

ComparisonOperatorstring

The comparison operator that is used to compare the metric value with the threshold for Warn-level alerts. Valid values:

  • GreaterThanOrEqualToThreshold: greater than or equal to the threshold
  • GreaterThanThreshold: greater than the threshold
  • LessThanOrEqualToThreshold: less than or equal to the threshold
  • LessThanThreshold: less than the threshold
  • NotEqualToThreshold: not equal to the threshold
  • GreaterThanYesterday: greater than the metric value at the same time yesterday
  • LessThanYesterday: less than the metric value at the same time yesterday
  • GreaterThanLastWeek: greater than the metric value at the same time last week
  • LessThanLastWeek: less than the metric value at the same time last week
  • GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
  • LessThanLastPeriod: less than the metric value in the last monitoring cycle
GreaterThanOrEqualToThreshold
Timesinteger

The consecutive number of times for which the metric value meets the alert condition before a Warn-level alert is triggered.

3
Thresholdstring

The threshold for Warn-level alerts.

90
Statisticsstring

The statistical method for Warn-level alerts.

The value of the Statistics parameter varies with the cloud service. For more information, see Appendix 1: Metrics.

Average
Criticalobject

The conditions for triggering Critical-level alerts.

ComparisonOperatorstring

The comparison operator that is used to compare the metric value with the threshold for Critical-level alerts. Valid values:

  • GreaterThanOrEqualToThreshold: greater than or equal to the threshold
  • GreaterThanThreshold: greater than the threshold
  • LessThanOrEqualToThreshold: less than or equal to the threshold
  • LessThanThreshold: less than the threshold
  • NotEqualToThreshold: not equal to the threshold
  • GreaterThanYesterday: greater than the metric value at the same time yesterday
  • LessThanYesterday: less than the metric value at the same time yesterday
  • GreaterThanLastWeek: greater than the metric value at the same time last week
  • LessThanLastWeek: less than the metric value at the same time last week
  • GreaterThanLastPeriod: greater than the metric value in the last monitoring cycle
  • LessThanLastPeriod: less than the metric value in the last monitoring cycle
GreaterThanOrEqualToThreshold
Timesinteger

The consecutive number of times for which the metric value meets the alert condition before a Critical-level alert is triggered.

5
Thresholdstring

The threshold for Critical-level alerts.

90
Statisticsstring

The statistical method for Critical-level alerts.

The value of the Statistics parameter varies with the cloud service. For more information, see Appendix 1: Metrics.

Average
Labelsobject []

The tags of the alert template.

Keystring

The tag key of the alert template.

label1
Valuestring

The tag value of the alert template.

value1

Examples

Sample success responses

JSONformat

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

Error codes

HTTP status codeError codeError messageDescription
400ParameterInvalidIllegal parameters.-
400%s%s-
403AccessForbiddenUser not authorized to operate on the specified resource.-
404ResourceNotFoundThe specified resource is not found.The specified resource is not found.
500InternalErrorThe request processing has failed due to some unknown error.-

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2022-12-26The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 409
    delete Error Codes: 412
    delete Error Codes: 500
Output ParametersThe response structure of the API has changed.
2022-12-22The Error code has changed. The response structure of the API has changedsee changesets
Change itemChange content
Error CodesThe Error code has changed.
    delete Error Codes: 400
    delete Error Codes: 403
    delete Error Codes: 404
    delete Error Codes: 409
    delete Error Codes: 412
    delete Error Codes: 500
Output ParametersThe response structure of the API has changed.