告警模板:查看詳情
更新時間 2024-09-25 16:20:55
最近更新時間: 2024-09-25 16:20:55
分享文章
告警模板
告警模板:查看詳情
接口功能介紹
調用此接口可查看告警模板的配置詳情。
接口約束
告警模板ID不能為空,且應為已創建的模板的ID。
URI
GET /v4/monitor/describe-alarm-template
路徑參數
無
Query參數
| 參數 | 是否必填 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|---|
| regionID | 是 | String | ctyun資源池ID | 81f7728662dd11ec810800155d307d5b | |
| templateID | 是 | String | 告警模板ID | 315c7f8c-3e43-11ed-8ef2-005056898fe0 |
請求參數
請求頭header參數
無
請求體body參數
無
響應參數
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| statusCode | Integer | 返回狀態碼(800為成功,900為失敗),默認值:800 | 800 | |
| errorCode | String | 失敗時的錯誤代碼,參見公共錯誤碼說明 | ||
| message | String | 失敗時的錯誤描述,一般為英文描述 | Success | |
| msgDesc | String | 失敗時的錯誤描述,一般為中文描述 | 成功 | |
| error | String | 錯誤碼,請求成功時,不返回該字段 | Openapi.Parameter.Error | |
| returnObj | Object | 返回參數 | returnObj |
表 returnObj
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| templateID | String | 告警模板ID | 315c7f8c-3e43-11ed-8ef2-005056898fe0 | |
| name | String | 告警模板名稱 | bzmcV | |
| service | String | 服務 | ecs | |
| dimension | String | 維度 | ecs | |
| desc | String | 告警模板描述 | test | |
| conditions | Array of Objects | 告警規則 | condition | |
| createTime | Integer | 創建時間,時間戳,精確到毫秒 | 1667459789000 | |
| updateTime | Integer | 最近更新時間, 時間戳,精確到毫秒 | 1667459789000 |
表 condition
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| evaluationCount | Integer | 持續次數,當規則執行結果持續多久符合條件時報警(防抖) | 2 | |
| metric | String | 監控指標 | cpu_util | |
| metricCnName | String | 監控指標中文描述 | cpu使用率 | |
| fun | String | 算法 | min | |
| operator | String | 比較符 | le | |
| value | String | 告警閾值 | 80 | |
| period | String | 算法統計周期 | 5m | |
| unit | String | 單位 | KB/s |
請求示例
請求url
/v4/monitor/describe-alarm-template?templateID=315c7f8c-3e43-11ed-8ef2-005056898fe0®ionID=81f7728662dd11ec810800155d307d5b
請求頭header
無
請求體body
無
響應示例
{
"statusCode":800,
"returnObj":{
"templateID":"8f29cc8c-fa92-5009-816a-6022761f91e6",
"name":"xsZSu",
"service":"ecs",
"dimension":"ecs",
"desc":"test",
"conditions":[
{
"evaluationCount":2,
"metric":"cpu_util",
"metricCnName":"cpu使用率",
"fun":"avg",
"operator":"eq",
"value":"100",
"period":"5m",
"unit":""
},
{
"evaluationCount":2,
"metric":"cpu_util",
"metricCnName":"cpu使用率",
"fun":"avg",
"operator":"eq",
"value":"70",
"period":"5m",
"unit":""
}
],
"createTime":1694916692000,
"updateTime":1694916692000
},
"errorCode":"",
"message":"Success",
"msgDesc":"成功"
}
狀態碼
| 狀態碼 | 描述 |
|---|---|
| 200 | 請求成功 |
錯誤碼
| errorCode | 描述 |
|---|---|
| Monitor.AlarmTemplate.TemplateIDNotFound | 告警模板ID不存在 |
| 其他 | 參見公共錯誤碼說明 |