告警模板:查詢列表
更新時間 2024-09-25 16:20:55
最近更新時間: 2024-09-25 16:20:55
分享文章
告警模板
告警模板:查詢列表
接口功能介紹
調用此接口可查詢告警模板列表。
接口約束
無。
URI
POST /v4/monitor/query-alarm-templates
路徑參數
無
Query參數
無
請求參數
請求頭header參數
無
請求體body參數
| 參數 | 是否必填 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|---|
| regionID | 是 | String | ctyun資源池ID | 81f7728662dd11ec810800155d307d5b | |
| queryContent | 否 | String | 名稱模糊搜索 | temp | |
| services | 否 | Array of Strings | 本參數表示展示出來的服務。默認返回所有服務。取值范圍:ecs:云主機。evs:云硬盤。pms:物理機。...詳見“告警模板:獲取告警模板服務維度關系”接口返回中的服務。 | ['ecs'] | |
| templateType | 否 | String | 本參數表示模板類型。默認all。取值范圍:system:系統默認。custom:自定義。all:所有。根據以上范圍取值。 | all | |
| pageNo | 否 | Integer | 頁碼,默認為1 | 1 | |
| page | 否 | Integer | 頁碼,默認為1,建議使用pageNo,該參數后續會下線 | 1 | |
| pageSize | 否 | Integer | 頁大小,默認為10 | 2 |
響應參數
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| statusCode | Integer | 返回狀態碼(800為成功,900為失敗),默認值:800 | 800 | |
| errorCode | String | 失敗時的錯誤代碼,參見公共錯誤碼說明 | ||
| message | String | 失敗時的錯誤描述,一般為英文描述 | Success | |
| msgDesc | String | 失敗時的錯誤描述,一般為中文描述 | 成功 | |
| error | String | 錯誤碼,請求成功時,不返回該字段 | Openapi.Parameter.Error | |
| returnObj | Object | 返回參數 | returnObj |
表 returnObj
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| templateList | Array of Objects | 告警模板列表 | template | |
| totalCount | Integer | 總記錄數 | 2 | |
| templateQuota | Integer | 用戶告警模板配額數 | 50 | |
| currentCount | Integer | 當前頁記錄數 | 14 | |
| totalPage | Integer | 總頁數 | 1 | |
| pageNo | Integer | 頁碼 | 1 | |
| pageSize | Integer | 頁大小 | 10 |
表 template
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| 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/query-alarm-templates
請求頭header
無
請求體body
{
"regionID": "81f7728662dd11ec810800155d307d5b",
"services":[
"ecs",
"evs"
],
"queryContent":"abc",
"templateType":"system",
"pageNo":1,
"pageSize":10
}
響應示例
{
"statusCode":800,
"returnObj":{
"templateList":[
{
"templateID":"884da6f3-7c0c-5d8b-9650-6e7a945dcacf",
"name":"template_732",
"service":"ecs",
"dimension":"ecs",
"desc":"",
"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":1694917828000,
"updateTime":1694917828000
}
],
"totalCount":2,
"templateQuota":50,
"currentCount":1,
"totalPage":2,
"pageNo":1,
"pageSize":1
},
"errorCode":"",
"message":"Success",
"msgDesc":"成功"
}
狀態碼
| 狀態碼 | 描述 |
|---|---|
| 200 | 請求成功 |
錯誤碼
| errorCode | 描述 |
|---|---|
| 其他 | 參見公共錯誤碼說明 |