All Products
Search
Document Center

Cloud Monitor:DescribeMetricRuleTemplateAttribute

Last Updated:Jun 14, 2026

Mengkueri detail templat peringatan dengan memanggil operasi DescribeMetricRuleTemplateAttribute.

Deskripsi operasi

Topik ini memberikan contoh cara mengkueri detail templat peringatan 70****.

Coba sekarang

Coba API ini di OpenAPI Explorer tanpa perlu penandatanganan manual. Panggilan yang berhasil akan secara otomatis menghasilkan contoh kode SDK sesuai dengan parameter Anda. Unduh kode tersebut dengan kredensial bawaan yang aman untuk penggunaan lokal.

Test

RAM authorization

Tabel berikut menjelaskan otorisasi yang diperlukan untuk memanggil API ini. Anda dapat menentukannya dalam kebijakan Resource Access Management (RAM). Kolom pada tabel dijelaskan sebagai berikut:

  • Action: Aksi yang dapat digunakan dalam elemen Action pada pernyataan kebijakan izin RAM untuk memberikan izin guna melakukan operasi tersebut.

  • API: API yang dapat Anda panggil untuk melakukan aksi tersebut.

  • Access level: Tingkat akses yang telah ditentukan untuk setiap API. Nilai yang valid: create, list, get, update, dan delete.

  • Resource type: Jenis resource yang mendukung otorisasi untuk melakukan aksi tersebut. Ini menunjukkan apakah aksi tersebut mendukung izin tingkat resource. Resource yang ditentukan harus kompatibel dengan aksi tersebut. Jika tidak, kebijakan tersebut tidak akan berlaku.

    • Untuk API dengan izin tingkat resource, jenis resource yang diperlukan ditandai dengan tanda bintang (*). Tentukan Nama Sumber Daya Alibaba Cloud (ARN) yang sesuai dalam elemen Resource pada kebijakan.

    • Untuk API tanpa izin tingkat resource, ditampilkan sebagai All Resources. Gunakan tanda bintang (*) dalam elemen Resource pada kebijakan.

  • Condition key: Kunci kondisi yang didefinisikan oleh layanan. Kunci ini memungkinkan kontrol granular, berlaku baik hanya untuk aksi maupun untuk aksi yang terkait dengan resource tertentu. Selain kunci kondisi spesifik layanan, Alibaba Cloud menyediakan serangkaian common condition keys yang berlaku di semua layanan yang didukung RAM.

  • Dependent action: Aksi dependen yang diperlukan untuk menjalankan aksi tersebut. Untuk menyelesaikan aksi tersebut, pengguna RAM atau role RAM harus memiliki izin untuk melakukan semua aksi dependen.

Action

Access level

Resource type

Condition key

Dependent action

cms:DescribeMetricRuleTemplateAttribute

get

*全部资源

*

None None

Parameter permintaan

Parameter

Type

Required

Description

Example

Name

string

No

Nama templat peringatan. Anda harus mengatur Name atau TemplateId.

Untuk informasi tentang cara mendapatkan nama templat peringatan, lihat DescribeMetricRuleTemplateList.

ECS_Template1

TemplateId

string

No

ID templat peringatan. Anda harus mengatur Name atau TemplateId.

Untuk informasi tentang cara mendapatkan ID templat peringatan, lihat DescribeMetricRuleTemplateList.

70****

Untuk informasi lebih lanjut tentang parameter permintaan umum, lihat Parameter umum.

Elemen respons

Element

Type

Description

Example

object

Parameter tanggapan.

Code

integer

Kode status HTTP.

Catatan

Nilai 200 menunjukkan keberhasilan.

200

Message

string

Paket error.

The specified resource is not found.

RequestId

string

ID permintaan.

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

Success

boolean

Apakah operasi berhasil. Nilai valid:

  • true: Operasi berhasil.

  • false: Operasi gagal.

true

Resource

object

Detail templat peringatan.

Description

string

Deskripsi templat peringatan.

ECS template

Name

string

Nama templat peringatan.

ECS_Template1

RestVersion

string

Versi templat peringatan.

1

TemplateId

string

ID templat peringatan.

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

Contoh

Respons sukses

JSONformat

{
  "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
        }
      ]
    }
  }
}

Kode kesalahan

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.
409 %s %s

Lihat Error Codes untuk daftar lengkap.

Catatan rilis

Lihat Release Notes untuk daftar lengkap.