实时监控数据:云主机
更新时间 2023-07-19 11:41:01
最近更新时间: 2023-07-19 11:41:01
接口功能介绍
查询云主机设备的实时监控数据。
接口约束
regionID(资源池)存在,且存在云主机设备。
URI
POST /v4/monitor/query-vm-latestmetricdata
请求参数
请求体body参数
| 参数 | 参数类型 | 是否必填 | 示例 | 说明 | 下级对象 |
|---|---|---|---|---|---|
| regionID | String | 是 | 81f7728662dd11ec810800155d307d5b | 资源池ID | |
| deviceUUIDList | Array of String | 是 | ["000f0322-1f4d-8cc8-bb2e-1c30fb751aa5"] | 查询设备ID列表,具体值参考监控对象查询返回字段deviceUUID | |
| pageNo | Integer | 否 | 1 | 页码,默认为1 | |
| page | Integer | 否 | 1 | 页码,默认为1,建议使用pageNo,该参数后续会下线 | |
| pageSize | Integer | 否 | 1 | 页大小,默认为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 | 获取对象数据条数 | 138 | |
| totalPage | Integer | 总页数 | 1 | |
| currentCount | Integer | 当前页记录数 | 2 | |
| page | Integer | 页码,建议参考请求参数pageNo,该参数后续会下线 | 1 | |
| pageSize | Integer | 页大小,建议参考请求参数pageSize,该参数后续会下线 | 10 |
表result
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| regionID | String | 所属资源池ID | 81f7728662dd11ec810800155d307d5b | |
| fUID | String | 唯一键 | 3c7b4997-ca51-4885-8e53-0d1a2b37ccc0 | |
| fuserLastUpdated | String | 最近更新时间 | 2022-11-07 18:25:12 | |
| deviceUUID | String | 设备ID | 3c7b4997-ca51-4885-8e53-0d1a2b37ccc0 | |
| itemList | Object | 监控项内容 | itemList |
表itemList
| 参数 | 参数类型 | 说明 | 示例 | 下级对象 |
|---|---|---|---|---|
| samplingTime | Integer | 监控数据采集时间 | 1667816712 | |
| {item1} | String | 监控项具体内容 | 0.1168 | |
| {item2} | String | 监控项具体内容 | 0.1168 | |
| ... | String | 监控项具体内容 |
请求示例
POST /v4/monitor/query-vm-latestmetricdata
请求体body
{
"regionID": "81f7728662dd11ec810800155d307d5b",
"deviceUUIDList": [
"000f0322-1f4d-8cc8-bb2e-1c30fb751aa5"
],
"pageNo": 1,
"pageSize": 5
}
响应示例
{
"statusCode":800,
"returnObj":{
"result":[
{
"regionID":"73f321ea-62ff-11ec-a8bc-005056898fe0",
"fUID":"000f0322-1f4d-8cc8-bb2e-1c30fb751aa5",
"fuserLastUpdated":"2022-10-20 15:43:08",
"deviceUUID":"000f0322-1f4d-8cc8-bb2e-1c30fb751aa5",
"itemList":{
"disk_util":"7.6032",
"cpu_util":"0.2169",
"mem_util":"20.8554",
"disk_read_bytes_rate":"0",
"disk_write_bytes_rate":"0.4833",
"disk_read_requests_rate":"0",
"disk_write_requests_rate":"0.0833",
"net_in_bytes_rate":"0.8803",
"net_out_bytes_rate":"1.629",
"cpu_user_time":"0.0634",
"cpu_system_time":"0.1335",
"other_cpu_util":"0",
"cpu_idle_time":"99.7831",
"cpu_nice_time":"0",
"cpu_iowait_time":"0",
"cpu_interrupt_time":"0",
"cpu_softirq_time":"0",
"processor_load_1_min_average_per_core":"0.01",
"processor_load_5_min_average_per_core":"0.03",
"processor_load_15_min_average_per_core":"0.05",
"free_memory":"1525518336",
"used_memory":"401870848",
"buffer_memory":"2117632",
"cache_memory":"207880192",
"network_incoming_packets_rate_inband":"100",
"network_outing_packets_rate_inband":"100",
"network_incoming_errs_rate_inband":"0",
"network_outing_errs_rate_inband":"0",
"network_incoming_drop_rate_inband":"0",
"network_outing_drop_rate_inband":"0",
"process_cpu_used":"0.2",
"process_memory_used":"6.9",
"open_files_num":"992",
"proc_num":"0",
"zomb_num":"0",
"sleep_num":"81",
"running_abnormal":"",
"running_normal":"",
"samplingTime":1666251788
}
}
],
"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 | 访问内部系统返回错误 |
| 其他 | 参见公共错误码说明 |