Menerapkan templat peringatan ke kelompok aplikasi untuk membuat aturan peringatan.
Deskripsi operasi
Topik ini menyediakan contoh cara menerapkan templat peringatan 700**** ke kelompok aplikasi 123456. ID aturan peringatan yang dibuat adalah applyTemplate8ab74c6b-9f27-47ab-8841-de01dc08****, dan namanya adalah test123.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:ApplyMetricRuleTemplate |
create |
*MetricRuleTemplate.
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| SilenceTime |
integer |
No |
Periode bisu. Unit: detik. Nilai default: 86400. Catatan
Ketika data pemantauan terus-menerus melebihi ambang batas aturan peringatan, hanya satu Pemberitahuan peringatan yang dikirim dalam setiap periode bisu. |
86400 |
| GroupId |
integer |
Yes |
ID kelompok aplikasi. Untuk informasi tentang cara memperoleh ID kelompok aplikasi, lihat DescribeMonitorGroups. |
123456 |
| TemplateIds |
string |
Yes |
ID templat peringatan. Untuk informasi tentang cara memperoleh ID templat peringatan, lihat DescribeMetricRuleTemplateList. |
700**** |
| EnableStartTime |
integer |
No |
Waktu mulai pengatur waktu periode efektif peringatan. Nilai valid: 00 hingga 23, yang menunjukkan 00:00 hingga 23:00. |
00 |
| EnableEndTime |
integer |
No |
Waktu akhir pengatur waktu periode efektif peringatan. Nilai valid: 00 hingga 23, yang menunjukkan 00:59 hingga 23:59. |
23 |
| NotifyLevel |
integer |
No |
Metode notifikasi Pemberitahuan peringatan. Nilai valid: 4: TradeManager + chatbot DingTalk. |
4 |
| ApplyMode |
string |
No |
Mode penerapan templat peringatan. Nilai valid:
|
GROUP_INSTANCE_FIRST |
| Webhook |
string |
No |
URL callback tempat permintaan POST dikirim saat peringatan dipicu. |
https://www.aliyun.com |
| AppendMode |
string |
No |
Kebijakan untuk menerapkan templat. Nilai valid:
|
all |
Untuk informasi lebih lanjut tentang parameter permintaan umum, lihat Parameter umum.
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| Code |
integer |
Kode status. Catatan
Nilai 200 menunjukkan keberhasilan. |
200 |
| Message |
string |
Paket error. |
The specified resource is not found. |
| RequestId |
string |
ID permintaan. |
3F897F3C-020A-4993-95B4-63ABB84F83E6 |
| Success |
boolean |
Apakah operasi berhasil. Nilai valid:
|
true |
| Resource |
object |
Resource yang terpengaruh oleh aturan peringatan. |
|
| GroupId |
integer |
ID kelompok aplikasi. |
123456 |
| AlertResults |
array<object> |
Detail aturan peringatan yang dibuat. |
|
|
object |
Detail aturan peringatan yang dibuat. |
||
| Code |
string |
Kode status. Catatan
Nilai 200 menunjukkan keberhasilan. |
200 |
| Message |
string |
Paket yang dikembalikan. |
alert rule is creating, please wait a few minutes. |
| Success |
boolean |
Apakah operasi berhasil. Nilai valid:
|
true |
| RuleName |
string |
Nama aturan peringatan. |
test123 |
| RuleId |
string |
ID aturan peringatan. |
applyTemplate8ab74c6b-9f27-47ab-8841-de01dc08**** |
Contoh
Respons sukses
JSONformat
{
"Code": 200,
"Message": "The specified resource is not found.",
"RequestId": "3F897F3C-020A-4993-95B4-63ABB84F83E6",
"Success": true,
"Resource": {
"GroupId": 123456,
"AlertResults": [
{
"Code": "200",
"Message": "alert rule is creating, please wait a few minutes.",
"Success": true,
"RuleName": "test123",
"RuleId": "applyTemplate8ab74c6b-9f27-47ab-8841-de01dc08****"
}
]
}
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ParameterInvalid | Illegal parameters. | |
| 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 | %s |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.