Mengkueri detail templat peringatan dengan memanggil operasi DescribeMetricRuleTemplateAttribute.
Deskripsi operasi
Topik ini memberikan contoh cara mengkueri detail templat peringatan 70****.
Coba sekarang
Test
RAM authorization
|
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 Untuk informasi tentang cara mendapatkan nama templat peringatan, lihat DescribeMetricRuleTemplateList. |
ECS_Template1 |
| TemplateId |
string |
No |
ID templat peringatan. Anda harus mengatur 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 |
| 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 |
| 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 |
| 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 |
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 |
| 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 |
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 |
| 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 |
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.