監控面板:更新
更新時間 2023-07-19 11:41:02
最近更(geng)新時(shi)間: 2023-07-19 11:41:02
分享文章
接口功能介紹
更新監控(kong)面板(ban)(更新監控(kong)面板(ban)名(ming)稱(cheng)或為監控(kong)面板(ban)增加(jia)一個監控(kong)視(shi)圖)
本接口有兩個功能:
- 更新監控面板的名稱;
- 在指定的監控面板中,添加一個監控視圖。
一個監控面板可以包含多個監控視圖,一個監控視圖可以包含多個監控項。
如(ru)果name(監控(kong)面(mian)板名稱(cheng)),templateTitle(監控(kong)視圖(tu)名稱(cheng)),templateContent(監控(kong)項內(nei)容(rong))都被傳入,則默認(ren)更(geng)新監控(kong)面(mian)板名稱(cheng)。
接口約束
regionID和templateID存在。
當更新監控面板名稱時,參數name必傳;
當(dang)在指定監控(kong)面(mian)板添加(jia)一個(ge)監控(kong)視圖時,參(can)數name必不(bu)傳,而參(can)數templateTitle和templateContent必傳。
URI
POST /v4/monitor/put-monitor
請求參數
請求體body參數
| 參數 | 參數類型 | 是否必填 | 示例 | 說明 | 下級對象 |
|---|---|---|---|---|---|
| regionID | String | 是 | 81f7728662dd11ec810800155d307d5b | 資源池ID | |
| templateID | String | 是 | 2ad61e2e-5046-11ed-8fb7-005056897257 | 監控面板ID | |
| name | String | 否 | newName | 新的監控面板名稱 | |
| templateTitle | String | 否 | testNewTitle | 監控視圖名稱 | |
| templateContent | Object | 否 | 監控項具體內容,為key-value格式 | templateContent |
表templateContent
| 參數 | 參數類型 | 是否必填 | 示例 | 說明 | 下級對象 |
|---|---|---|---|---|---|
| {itemName} | String | 否 | tcKey11 | 監控項名稱 | |
| {value} | Object | 否 | tcVal11 | 監控項值,與監控項名稱組成key-value格式,可以為任意內容 |
響應參數
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| statusCode | Integer | 返回狀態碼(800為成功,900為失敗),默認值:800 | 800 | |
| errorCode | String | 失敗時的錯誤代碼,參見公共錯誤碼說明 | ||
| message | String | 失敗時的錯誤描述,一般為英文描述 | Success | |
| msgDesc | String | 失敗時的錯誤描述,一般為中文描述 | 成功 | |
| returnObj | Object | 返回對象 | returnObj |
表returnObj
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| templateID | String | 操作的監控面板ID | 2ad61e2e-5046-11ed-8fb7-005056897257 |
請求示例
POST /v4/monitor/put-monitor
請求體body
{
"regionID": "81f7728662dd11ec810800155d307d5b",
"templateID": "2ad61e2e-5046-11ed-8fb7-005056897257",
"templateTitle": "testNewTitle",
"templateContent": {
"tcKey11": "tcVal11",
"tcKey22": "tcVal22"
}
}
響應示例
{
"statusCode": 800,
"returnObj": {
"templateID": "2ad61e2e-5046-11ed-8fb7-005056897257"
},
"errorCode": "",
"message": "Success",
"msgDesc": "成功"
}
狀態碼
| 狀態碼 | 描述 |
|---|---|
| 200 | 請求成功 |
錯誤碼
| errorCode | 描述 |
|---|---|
| Monitor.Template.NameNoChange | 監控面板名稱與舊名稱相同 |
| 其他 | 參見公共錯誤碼說明 |