呼叫PutCustomEventRule介面建立自訂事件告警規則。
介面說明
呼叫本介面前,請先呼叫 PutCustomEvent 介面上報自訂事件的監控資料,詳情請參見 PutCustomEvent 。
調試
您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。
調試
授權資訊
|
操作 |
存取層級 |
資源類型 |
條件關鍵字 |
關聯操作 |
|
cms:PutCustomEventRule |
create |
*All Resource
|
無 | 無 |
請求參數
|
名稱 |
類型 |
必填 |
描述 |
樣本值 |
| GroupId |
string |
是 |
應用分組 ID。獲取方法請參見 DescribeCustomEventAttribute 。 說明
0 表示上報的自訂事件不屬於任何一個應用分組。 |
7378**** |
| RuleId |
string |
是 |
告警規則 ID。 說明
如果告警規則 ID 已存在,則表示修改告警規則;如果告警規則 ID 不存在,則表示建立告警規則。 |
CustomRuleId1 |
| RuleName |
string |
是 |
告警規則名稱。 |
CustomeRule |
| EventName |
string |
是 |
自訂事件名稱。獲取方法請參見 DescribeCustomEventAttribute 。 |
HostDown |
| ContactGroups |
string |
是 |
告警聯絡人群組。多個聯絡人群組之間使用英文逗號(,)分隔。 |
ECS_Group |
| Webhook |
string |
否 |
告警發生回呼時指定的 URL 位址,向 URL 發送 POST 請求。 |
https://www.aliyun.com |
| EffectiveInterval |
string |
否 |
告警規則生效的時間範圍。取值範圍:00:00-23:59。 |
00:00-23:59 |
| Period |
string |
否 |
自訂事件監控資料的彙總週期。單位:秒。取值為 60 或 60 的整數倍。預設值:300。 |
60 |
| EmailSubject |
string |
否 |
告警郵件主旨。 |
ECS instance |
| Threshold |
string |
是 |
告警閾值。 |
99 |
| Level |
string |
是 |
告警等級。取值:
|
CRITICAL |
返回參數
|
名稱 |
類型 |
描述 |
樣本值 |
|
object |
|||
| Code |
string |
狀態代碼。 說明
200 表示成功。 |
200 |
| Message |
string |
錯誤訊息。 |
The request has failed due to a temporary failure of the server. |
| RequestId |
string |
請求 ID。 |
AD5DCD82-BD1C-405F-BAED-32302DE9F498 |
| Success |
boolean |
操作是否成功。取值:
|
true |
樣本
正常返回樣本
JSON格式
{
"Code": "200",
"Message": "The request has failed due to a temporary failure of the server.",
"RequestId": "AD5DCD82-BD1C-405F-BAED-32302DE9F498",
"Success": true
}
錯誤碼
|
HTTP status code |
錯誤碼 |
錯誤資訊 |
描述 |
|---|---|---|---|
| 400 | %s | %s | |
| 499 | %s | %s | |
| 500 | InternalError | The request processing has failed due to some unknown error. | |
| 204 | %s | %s | |
| 403 | %s | %s | |
| 206 | %s | %s | |
| 404 | %s | %s | |
| 503 | %s | %s | |
| 406 | %s | %s |
訪問錯誤中心查看更多錯誤碼。
變更歷史
更多資訊,參考變更詳情。