自定義事件告警規則:查詢列表
更新時間 2024-09-25 16:20:50
最近更新時間: 2024-09-25 16:20:50
分享文章
告警規則
自定義事件告警規則:查詢列表
接口功能介紹
根據篩選項查詢自定義事件告警規則列表。
接口約束
regionID(資源池)存在。
URI
GET /v4/monitor/query-custom-event-alarm-rules
路徑參數
無
Query參數
| 參數 | 是否必填 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|---|
| regionID | 是 | String | ctyun資源池ID | 81f7728662dd11ec810800155d307d5b | |
| status | 否 | Integer | 本參數表示告警規則啟用狀態。取值范圍:0:啟用。1:停用。根據以上范圍取值。 | 0 | |
| alarmStatus | 否 | Integer | 本參數表示告警規則告警狀態。取值范圍:0:正常。1:正在告警。根據以上范圍取值。 | 0 | |
| name | 否 | String | 規則名稱 | test | |
| sort | 否 | String | 本參數表示排序條件,-表示降序。支持的排序字段:updateTime:更新時間。根據以上范圍取值。 | -updateTime | |
| pageNo | 否 | Integer | 頁碼,默認為1 | 1 | |
| pageSize | 否 | Integer | 頁大小,默認為20 | 10 |
請求參數
請求頭header參數
無
請求體body參數
無
響應參數
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| statusCode | Integer | 返回狀態碼(800為成功,900為失敗),默認值:800 | 800 | |
| errorCode | String | 失敗時的錯誤代碼,參見公共錯誤碼說明 | ||
| message | String | 失敗時的錯誤描述,一般為英文描述 | Success | |
| msgDesc | String | 失敗時的錯誤描述,一般為中文描述 | 成功 | |
| error | String | 錯誤碼,請求成功時,不返回該字段 | Openapi.Parameter.Error | |
| returnObj | Object | 返回對象 | returnObj |
表 returnObj
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| alarmRules | Array of Objects | 告警規則 | alarmRule | |
| totalCount | Integer | 總記錄數 | 20 | |
| currentCount | Integer | 當前頁記錄數 | 10 | |
| totalPage | Integer | 總頁數 | 2 |
表 alarmRule
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| alarmRuleID | String | 告警規則ID | 2c2472df-f633-5b4b-be45-9609fc9f8154 | |
| regionID | String | ctyun資源池ID | 81f7728662dd11ec810800155d307d5b | |
| name | String | 規則名 | 自定義告警規則測試 | |
| desc | String | 描述 | test | |
| repeatTimes | Integer | 重復告警通知次數,默認為0 | 0 | |
| silenceTime | Integer | 告警接收策略靜默時間,多久重復通知一次,單位為秒 | 300 | |
| recoverNotify | Integer | 本參數表示恢復是否通知。默認值0。取值范圍:0:否。1:是。根據以上范圍取值。 | 0 | |
| notifyType | Array of Strings | 本參數表示告警接收策略。取值范圍:email:郵件告警。sms:短信告警。根據以上范圍取值。 | ['email','sms'] | |
| contactGroupList | Array of Strings | 告警聯系人組 | ['000f0322-1f4d-8cc8-bb2e-1c30fb751ccc'] | |
| notifyWeekdays | Array of Integers | 本參數表示通知周期。默認值[0,1,2,3,4,5,6]。取值范圍:0:周日。1:周一。2:周二。3:周三。4:周四。5:周五。6:周六。根據以上范圍取值。 | [0,1,2,3,4,5,6] | |
| notifyStart | String | 通知起始時段,默認為00:00:00 | 00:00:00 | |
| notifyEnd | String | 通知結束時段,默認為23:59:59 | 23:59:59 | |
| webhookUrl | Array of Strings | 告警狀態變更webhook推送地址 | ['//www.daliqc.cn/'] | |
| customEventID | String | 自定義監控指標 | ITEM63cb8954325480a3202307071801 | |
| value | String | 出現次數,告警閾值,整數格式字符串 | 1 | |
| period | String | 本參數表示算法統計周期。默認值5m。本參數格式為“數字+單位”。最大周期為24小時。單位取值范圍:m:分鐘。h:小時。根據以上范圍取值。 | 5m | |
| createTime | Integer | 創建時間 | 1689580180000 | |
| updateTime | Integer | 更新時間 | 1689580180000 |
請求示例
請求url
/v4/monitor/query-custom-event-alarm-rules?regionID=81f7728662dd11ec810800155d307d5b&status=1&page=1&pageSize=1
請求頭header
無
請求體body
無
響應示例
{
"statusCode": 800,
"returnObj": {
"alarmRules": [
{
"alarmRuleID": "3dbd23b2-74e2-53f8-869c-6fe6b07b9dba",
"regionID": "81f7728662dd11ec810800155d307d5b",
"name": "自定義告警規則測試",
"desc": "test",
"repeatTimes": 0,
"silenceTime": 300,
"recoverNotify": 0,
"notifyType": ["email"],
"contactGroupList": [],
"notifyWeekdays": [0, 1, 2, 3, 4, 5, 6],
"notifyStart": "00:00:00",
"notifyEnd": "23:59:59",
"webhookUrl": ["//www.daliqc.cn/"],
"customItemID": "ITEM63cb8954325480a3202307071801",
"value": "3",
"period": "5m",
"createTime":1689580180000,
"updateTime":1689580180000
}
],
"totalCount": 2,
"currentCount": 1,
"totalPage": 2
},
"errorCode": "",
"message": "Success",
"msgDesc":"成功"
}
狀態碼
| 狀態碼 | 描述 |
|---|---|
| 200 | 表示請求成功 |
錯誤碼
| 錯誤碼 | 描述 |
|---|---|
| 其他 | 參見公共錯誤碼說明 |