该接口支持根据参数查询设备运行状态。使用此接口,需要了解设备有哪些属性。
请求接口
POST /api/dashboard/_multi
请求参数
| 名称 | 位置 | 类型 | 必选 | 说明 |
|---|---|---|---|---|
| X-Access-Token | header | string | true | 平台token |
| body | body | [object] | true | - |
| » body | body | object | true | - |
| »» dashboard | body | string | true | 仪表对象类型,默认为 device |
| »» object | body | string | true | 仪表对象 |
| »» measurement | body | string | true | 指标,默认为 properties |
| »» dimension | body | string | true | 维度,不能为空默认为 history |
| »» params | body | [object] | false | 参数 |
| »»» deviceId | body | string | false | 设备ID |
| »»» history | body | integer | false | 历史记录条数 |
| »»» properties | body | array | false | 默认为一个包含设备属性的数组 |
- dashboard、object、measurement、dimension不能为空
响应参数
以200 Response为例,响应参数如下:
| 名称 | 类型 | 必选 | 约束 | 说明 |
|---|---|---|---|---|
| » message | string | true | none | 返回信息 |
| » result | [object] | true | none | 返回结果 |
| »» data | object | true | none | 数据 |
| »»» value | string | true | none | 内容 |
| »»»» id | string | true | none | 标识 |
| »»»» property | string | true | none | 属性 |
| »»»» propertyName | string | true | none | 属性名 |
| »»»» type | string | true | none | 类型 |
| »»»» value | string | true | none | 值 |
| »»»» formatValue | string | true | none | 标准值 |
| »»»» createTime | string | true | none | 创建时间 |
| »»»» timestamp | string | true | none | 时间戳 |
| »»» timeString | string | true | none | 时间 |
| »»» timestamp | string | true | none | 时间戳 |
| » status | integer | true | none | 响应状态码 |
| » timestamp | integer | true | none | 时间戳 |
响应状态码
| 状态码 | 状态码含义 | 说明 |
|---|---|---|
| 200 | OK | 成功 |
| 401 | Unauthorized | 登录状态已过期,token不能为空 |
| 500 | Internal Server Error | 服务器内部异常 |
Body示例
json
[
{
"dashboard":"device",
"object":"1658741400733331457",
"measurement":"properties",
"dimension":"history",
"params":{
"deviceId":"lw-data",
"history":1,
"properties":[
"real_state_cpu_capacity",
"real_state_ram_capacity",
"real_state_flash_capacity",
"real_state_storage_capacity",
"real_state_storage_usage_rate",
"real_state_system",
"real_state_system_version",
"real_state_net"
]
}
}
][
{
"dashboard":"device",
"object":"1658741400733331457",
"measurement":"properties",
"dimension":"history",
"params":{
"deviceId":"lw-data",
"history":1,
"properties":[
"real_state_cpu_capacity",
"real_state_ram_capacity",
"real_state_flash_capacity",
"real_state_storage_capacity",
"real_state_storage_usage_rate",
"real_state_system",
"real_state_system_version",
"real_state_net"
]
}
}
]返回示例
以200 Response为例:
json
{
"message": "success",
"result": [
{
"data": {
"value": {
"id": "NYohz-QhyQo7F18LNQs4HsvWBeZlnsco",
"property": "real_state_cpu_capacity",
"propertyName": "CPU大小",
"type": "string",
"value": "2 cores | 3666 MB",
"formatValue": "2 cores | 3666 MB",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhYbRqV9FgiwMIe6jBqgPvRcEy",
"property": "real_state_flash_capacity",
"propertyName": "FLASH",
"type": "string",
"value": "16G",
"formatValue": "16G",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-Qh5_K5Sx_8yl5tFENvvQXNOVuI",
"property": "real_state_net",
"propertyName": "网络",
"type": "string",
"value": "eth0:192.168.0.203;eth1:192.168.0.204;docker0:172.17.0.1;",
"formatValue": "eth0:192.168.0.203;eth1:192.168.0.204;docker0:172.17.0.1;",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhlsbCNv5vXl3KL3Lp3TYkiUmz",
"property": "real_state_ram_capacity",
"propertyName": "内存大小",
"type": "string",
"value": "16G",
"formatValue": "16G",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhFNKBABp6Pk-lUx2tT-B4Pfub",
"property": "real_state_storage_capacity",
"propertyName": "存储大小",
"type": "string",
"value": "1TB",
"formatValue": "1TB",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-Qh8wgOoKrVIKajgOKHkdvjGmXa",
"property": "real_state_storage_usage_rate",
"propertyName": "存储使用率",
"type": "string",
"value": "30%",
"formatValue": "30%",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhjCYOdPuyKl16DYJJBSEKuSnM",
"property": "real_state_system",
"propertyName": "操作系统",
"type": "string",
"value": "Kaihong OS",
"formatValue": "Kaihong OS",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhvlT6q_S5i4YOkKNfwkpCSm9Y",
"property": "real_state_system_version",
"propertyName": "系统版本",
"type": "string",
"value": "3.1.1_3432",
"formatValue": "3.1.1_3432",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
}
],
"status": 200,
"timestamp": 1693795333057
}{
"message": "success",
"result": [
{
"data": {
"value": {
"id": "NYohz-QhyQo7F18LNQs4HsvWBeZlnsco",
"property": "real_state_cpu_capacity",
"propertyName": "CPU大小",
"type": "string",
"value": "2 cores | 3666 MB",
"formatValue": "2 cores | 3666 MB",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhYbRqV9FgiwMIe6jBqgPvRcEy",
"property": "real_state_flash_capacity",
"propertyName": "FLASH",
"type": "string",
"value": "16G",
"formatValue": "16G",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-Qh5_K5Sx_8yl5tFENvvQXNOVuI",
"property": "real_state_net",
"propertyName": "网络",
"type": "string",
"value": "eth0:192.168.0.203;eth1:192.168.0.204;docker0:172.17.0.1;",
"formatValue": "eth0:192.168.0.203;eth1:192.168.0.204;docker0:172.17.0.1;",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhlsbCNv5vXl3KL3Lp3TYkiUmz",
"property": "real_state_ram_capacity",
"propertyName": "内存大小",
"type": "string",
"value": "16G",
"formatValue": "16G",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhFNKBABp6Pk-lUx2tT-B4Pfub",
"property": "real_state_storage_capacity",
"propertyName": "存储大小",
"type": "string",
"value": "1TB",
"formatValue": "1TB",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-Qh8wgOoKrVIKajgOKHkdvjGmXa",
"property": "real_state_storage_usage_rate",
"propertyName": "存储使用率",
"type": "string",
"value": "30%",
"formatValue": "30%",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhjCYOdPuyKl16DYJJBSEKuSnM",
"property": "real_state_system",
"propertyName": "操作系统",
"type": "string",
"value": "Kaihong OS",
"formatValue": "Kaihong OS",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
},
{
"data": {
"value": {
"id": "NYohz-QhvlT6q_S5i4YOkKNfwkpCSm9Y",
"property": "real_state_system_version",
"propertyName": "系统版本",
"type": "string",
"value": "3.1.1_3432",
"formatValue": "3.1.1_3432",
"createTime": 1692784387105,
"timestamp": 1692784387104
},
"timeString": "2023-08-23 17:53:07",
"timestamp": 1692784387104
}
}
],
"status": 200,
"timestamp": 1693795333057
}