某個時間段內監控數據最大值
更新時間 2023-07-19 11:40:59
最近更新時間: 2023-07-19 11:40:59
分享文章
接口功能介紹
查詢某個設備的(de)(de)歷史(shi)數據,以(yi)period為周期,返回每個周期內的(de)(de)最大值(zhi)
接口約束
regionID(資(zi)源(yuan)池(chi))、deviceUUIDList(設備資(zi)源(yuan))、itemNameList(待查(cha)監控項名(ming)稱)存在。
URI
POST /v4/monitor/query-metricdata-max
請求參數
請求體body參數
| 參數 | 參數類型 | 是否必填 | 示例 | 說明 | 下級對象 |
|---|---|---|---|---|---|
| regionID | String | 是 | 81f7728662dd11ec810800155d307d5b | 資源池ID | |
| deviceType | String | 是 | eip | 本參數表示設備類型。取值范圍:vm:云主機。ph:宿主機。bare_metal:裸金屬。disk:云磁盤。scaling:彈性伸縮。traffic:共享帶寬。eip:彈性IP。elb:負載均衡。listener:監聽器。cstor_sfs:彈性文件。site_montior:站點監控。根據以上范圍取值。 | |
| itemNameList | Array of String | 是 | ["ingress_throughput","egress_throughput"] | 待查的監控項名稱 | |
| startTime | String | 是 | 1667815639 | 查詢起始時間戳 | |
| endTime | String | 是 | 1667817639 | 查詢結束時間戳 | |
| deviceUUIDList | Array of String | 是 | ["100.124.0.2","100.124.0.5"] | 查詢設備ID列表 | |
| period | Integer | 否 | 300 | 聚合周期,單位:秒,默認300 | |
| pageNo | Integer | 否 | 1 | 頁碼,默認為1 | |
| page | Integer | 否 | 1 | 頁碼,默認為1,建議使用pageNo,該參數后續會下線 | |
| pageSize | Integer | 否 | 2 | 頁大小,默認為20 |
響應參數
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| statusCode | Integer | 返回狀態碼(800為成功,900為失敗),默認值:800 | 800 | |
| errorCode | String | 失敗時的錯誤代碼,參見公共錯誤碼說明 | ||
| message | String | 失敗時的錯誤描述,一般為英文描述 | Success | |
| msgDesc | String | 失敗時的錯誤描述,一般為中文描述 | 成功 | |
| returnObj | Object | 返回對象 | returnObj |
表returnObj
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| result | Array of Objects | 返回數據結果 | result | |
| totalCount | Integer | 獲取對象數據條數 | 14 | |
| totalPage | Integer | 總頁數 | 1 | |
| currentCount | Integer | 當前頁記錄數 | 14 | |
| page | Integer | 頁碼,建議參考請求參數pageNo,該參數后續會下線 | 1 | |
| pageSize | Integer | 頁大小,建議參考請求參數pageSize,該參數后續會下線 | 10 |
表result
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| regionID | String | 所屬資源池ID | 81f7728662dd11ec810800155d307d5b | |
| fUID | String | 唯一鍵 | 100.124.0.2 | |
| deviceUUID | String | 設備ID | 100.124.0.2 | |
| fuserLastUpdated | String | 最近更新時間 | 2022-11-07 18:25:12 | |
| itemAggregateList | Array of Objects | 監控項值列表 | itemAggregateList |
表itemAggregateList
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| {itemName} | Array of Objects | 監控項內容 | valueObject |
表valueObject
| 參數 | 參數類型 | 說明 | 示例 | 下級對象 |
|---|---|---|---|---|
| samplingTime | Integer | 監控數據采樣時間 | 1667815639 | |
| value | Double | 監控項值,具體請參考對應監控項文檔 | 524288 |
請求示例
POST /v4/monitor/query-metricdata-max
請求體body
{
"regionID": "81f7728662dd11ec810800155d307d5b",
"itemNameList": [
"ingress_throughput",
"egress_throughput",
"ingress_bandwidth",
"egress_bandwidth"
],
"startTime": "1667815639",
"endTime": "1667817639",
"pageNo": 1,
"pageSize": 5,
"deviceUUIDList": [
"100.124.0.2"
],
"deviceType":"eip",
"period":2400
}
響應示例
{
"statusCode":800,
"returnObj":{
"result":[
{
"regionID":"73f321ea-62ff-11ec-a8bc-005056898fe0",
"fUID":"100.124.0.2",
"deviceUUID":"100.124.0.2",
"fuserLastUpdated":"2022-10-19 18:09:44",
"itemAggregateList":{
"ingress_throughput":[
{
"value":920,
"samplingTime":1666122174
},
{
"value":920,
"samplingTime":1666122174
},
{
"value":0,
"samplingTime":1666124574
}
],
"egress_throughput":[
{
"value":0,
"samplingTime":1666076574
},
{
"value":0,
"samplingTime":1666076574
},
{
"value":0,
"samplingTime":1666117374
}
],
"ingress_bandwidth":[
{
"value":61,
"samplingTime":1666076574
},
{
"value":61,
"samplingTime":1666076574
},
{
"value":0,
"samplingTime":1666081374
}
],
"egress_bandwidth":[
{
"value":0,
"samplingTime":1666076574
},
{
"value":0,
"samplingTime":1666076574
},
{
"value":0,
"samplingTime":1666078974
}
]
}
},
{
"regionID":"73f321ea-62ff-11ec-a8bc-005056898fe0",
"fUID":"100.124.0.5",
"deviceUUID":"100.124.0.5",
"fuserLastUpdated":"2022-10-19 18:09:44",
"itemAggregateList":{
"ingress_throughput":[
{
"value":46,
"samplingTime":1666076574
},
{
"value":46,
"samplingTime":1666076574
},
{
"value":184,
"samplingTime":1666078974
}
],
"egress_throughput":[
{
"value":0,
"samplingTime":1666076574
},
{
"value":0,
"samplingTime":1666076574
},
{
"value":0,
"samplingTime":1666134174
}
],
"ingress_bandwidth":[
{
"value":6,
"samplingTime":1666076574
},
{
"value":6,
"samplingTime":1666076574
},
{
"value":24,
"samplingTime":1666078974
}
],
"egress_bandwidth":[
{
"value":0,
"samplingTime":1666076574
},
{
"value":0,
"samplingTime":1666076574
},
{
"value":0,
"samplingTime":1666078974
}
]
}
}
],
"currentCount": 1,
"totalCount": 1,
"totalPage": 1,
"page": 1,
"pageSize": 5
},
"errorCode":"",
"message":"Success",
"msgDesc":"成功"
}
狀態碼
| 狀態碼 | 描述 |
|---|---|
| 200 | 請求成功 |
錯誤碼
| errorCode | 描述 |
|---|---|
| Monitor.DataQuery.RegionNotFound | 找不到資源池 |
| Monitor.DataQuery.ItemNameUndefined | 監控項未定義 |
| Monitor.DataQuery.QueryError | 查詢數據失敗 |
| Monitor.DataQuery.AccessFailed | 訪問內部系統失敗 |
| Monitor.DataQuery.ResponseError | 訪問內部系統返回錯誤 |
| 其他 | 參見公共錯誤碼說明 |