一鍵告警:產品配置詳情
更新時間 2024-09-25 16:20:59
最近更新時間: 2024-09-25 16:20:59
分享文章
一鍵告警
一鍵告警:產品配置詳情
接口功能介紹
此接口用于獲取單個產品一鍵告警規則配置信息。
接口約束
無。
URI
GET /v4/monitor/alert-onekey/describe-alert-config
路徑參數
無
Query參數
| 參數 | 是否必填 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|---|
| regionID | 是 | String | ctyun資源池ID | 81f7728662dd11ec810800155d307d5b | |
| service | 是 | String | 本參數表示產品名稱。取值范圍:ecs:云主機。evs:云硬盤。...詳見“[一鍵告警:產品列表]”接口返回。 | ecs | |
| alarmType | 是 | String | 本參數表示告警類型。 取值范圍:series:時序指標。event:事件。 根據以上范圍取值。 | series |
請求參數
請求頭header參數
無
請求體body參數
無
響應參數
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| statusCode | Integer | 返回狀態碼(800為成功,900為失敗),默認值:800 | 800 | |
| errorCode | String | 失敗時的錯誤代碼,參見公共錯誤碼說明 | ||
| message | String | 失敗時的錯誤描述,一般為英文描述 | Success | |
| msgDesc | String | 失敗時的錯誤描述,一般為中文描述 | 成功 | |
| error | String | 錯誤碼,請求成功時,不返回該字段 | Openapi.Parameter.Error | |
| returnObj | Object | 返回參數 | returnObj |
表 returnObj
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| alertConfigList | Array of Objects | 初始化規則列表 | alertConfig |
表 alertConfig
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| alarmRuleID | String | 規則ID | 83bd7537-9e06-5a45-a3b5-f4b13a7e81ea | |
| name | String | 規則名稱 | 告警規則123 | |
| service | String | 服務。取值范圍:ecs:云主機。evs:云硬盤。...詳見“[一鍵告警:產品列表]”接口返回。 | ecs | |
| dimension | String | 維度。取值范圍:ecs:云主機。disk:磁盤。pms:物理機。...詳見“告警規則:獲取告警服務維度關系”接口返回。 | ecs | |
| evaluationCount | Integer | 連續出現次數 | 5 | |
| metric | String | 指標名 | cpu_util | |
| repeatTimes | Integer | 重復告警通知次數,默認為0 | 3 | |
| silenceTime | Integer | 告警接收策略靜默時間,多久重復通知一次,單位為秒 | 300 | |
| recoverNotify | Integer | 恢復是否通知。值范圍:0:否。1:是。 | 0 | |
| notifyType | Array of Strings | 告警接收策略。值范圍:email:郵件告警。sms:短信告警。 | ['email'] | |
| 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] | |
| notifyStart | String | 通知起始時段 | 00:00:00 | |
| notifyEnd | String | 通知結束時段 | 23:59:59 | |
| webhookUrl | Array of Strings | 告警狀態變更webhook推送地址 | ['//www.daliqc.cn'] | |
| status | Integer | 告警規則啟用狀態。值范圍:0:啟用。1:停用。 | 0 | |
| createTime | Integer | 創建時間 | 1689580180000 | |
| updateTime | Integer | 更新時間 | 1689580180000 | |
| operator | String | 注意:一鍵告警規則的告警類型(alarmType)為事件類型(event)時,沒有此返回參數。 此參數表示比較符。范圍:eq:等于。gt:大于。ge:大于等于。lt:小于。le:小于等于。根據以上范圍取值。 | eq | |
| value | String | 注意:一鍵告警規則的告警類型(alarmType)為事件類型(event)時,沒有此返回參數。 此參數表示告警閾值,可以是整數、小數或百分數格式字符串 | 20 | |
| unit | String | 單位 | % |
請求示例
請求url
/v4/monitor/alert-onekey/describe-service-config?regionID=81f7728662dd11ec810800155d307d5b&service=ecs&alarmType=series
請求頭header
無
請求體body
無
響應示例
{
"statusCode": 800,
"returnObj": {
"alertConfigList": [
{
"alarmRuleID": "55e07acc-b661-52b0-ad80-7fb4db598122",
"name": "CPU使用率一鍵告警",
"service": "ecs",
"dimension": "ecs",
"evaluationCount": 20,
"unit": "",
"metric": "cpu_util",
"repeatTimes": 0,
"silenceTime": 300,
"recoverNotify": 0,
"notifyWeekdays": [
0,
1,
2,
3,
4,
5,
6
],
"notifyStart": "00:00:00",
"notifyEnd": "23:59:59",
"webhookUrl": [
"//www.daliqc.cn/"
],
"status": 0,
"createTime": 1709870419000,
"updateTime": 1709870419000,
"notifyType": [
"email"
],
"contactGroupList": [
]
},
{
"alarmRuleID": "557496c5-a4c8-5fe8-b813-f5ee6a523495",
"name": "內存使用率一鍵告警",
"service": "ecs",
"dimension": "ecs",
"evaluationCount": 5,
"unit": "",
"metric": "mem_util",
"repeatTimes": 0,
"silenceTime": 300,
"recoverNotify": 0,
"notifyWeekdays": [
0,
1,
2,
3,
4,
5,
6
],
"notifyStart": "00:00:00",
"notifyEnd": "23:59:59",
"webhookUrl": [
"//www.daliqc.cn/"
],
"status": 0,
"createTime": 1709870419000,
"updateTime": 1709870419000,
"notifyType": [
"email"
],
"contactGroupList":[
"6618d45b-b42d-5085-9c49-b73e6053cad6"
]
}
]
},
"errorCode": "",
"message": "Success",
"msgDesc": "成功"
}
狀態碼
| 狀態碼 | 描述 |
|---|---|
| 200 | 請求成功 |
錯誤碼
| errorCode | 描述 |
|---|---|
| 其他 | 參見公共錯誤碼說明 |