物模型管理
属性列表查询
请求URL
https://www.thingshub.com.cn/openapi/v2/function/property/list?productKey=${productKey}
方法
GET
Content-Type
无
请求参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| productId | int | 否 | 产品ID |
| productKey | string | 是 | ProductKey |
| pageNumber | int | 否 | 页码 |
| pageSize | int | 否 | 页大小 |
响应参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| code | int | 是 | 返回码 |
| msg | string | 是 | 返回信息 |
| data | object | 是 | 返回数据 |
| +total | int | 是 | 总记录数 |
| +records | array | 是 | 属性列表 |
| ++id | int | 是 | 属性ID |
| ++name | string | 是 | 属性名 |
| ++identifier | string | 是 | 属性标识 |
| ++accessMode | int | 是 | 访问模式。只读,只写、读写 |
| ++specs | string | 是 | 描述属性的元数据,json格式 |
| ++dataType | string | 是 | 数据类型描述 |
| ++productId | int | 是 | 所属产品ID |
| ++createTime | string | 是 | 创建时间 |
样例
{
"code": 200,
"msg": "success",
"data": {
"total": 6,
"records": [
{
"id": 0,
"name": "设备名",
"identifier": "device_id",
"accessMode": 3,
"specs": "{\"type\": \"text\", \"specs\": {\"device_id\": \"\"}}",
"dataType": "text",
"productId": 0,
"createTime": "2025-03-24 09:24:19"
},
{
"id": 0,
"name": "下载字节速度",
"identifier": "bytes_recv_speed",
"accessMode": 3,
"specs": "{\"type\": \"float\", \"specs\": {\"value\": \"\"}}",
"dataType": "float",
"productId": 0,
"createTime": "2025-03-21 10:55:11"
},
{
"id": 0,
"name": "上传字节速度(kb/s)",
"identifier": "bytes_sent_speed",
"accessMode": 3,
"specs": "{\"type\": \"float\", \"specs\": {\"value\": \"\"}}",
"dataType": "float",
"productId": 0,
"createTime": "2025-03-21 10:29:46"
},
{
"id": 0,
"name": "边缘设备内存占用率",
"identifier": "device_ram",
"accessMode": 3,
"specs": "{\"type\": \"float\", \"specs\": {\"value\": \"\"}}",
"dataType": "float",
"productId": 0,
"createTime": "2025-03-21 10:22:18"
},
{
"id": 0,
"name": "边缘设备gpu占用率",
"identifier": "device_gpu",
"accessMode": 3,
"specs": "{\"type\": \"int\", \"specs\": {\"value\": \"\"}}",
"dataType": "int",
"productId": 0,
"createTime": "2025-03-21 10:21:45"
},
{
"id": 0,
"name": "边缘设备cpu占用率",
"identifier": "device_cpu",
"accessMode": 3,
"specs": "{\"type\": \"float\", \"specs\": {\"value\": \"\"}}",
"dataType": "float",
"productId": 0,
"createTime": "2025-03-21 10:18:02"
}
]
}
}
获取属性详情
请求URL
https://www.thingshub.com.cn/openapi/v2/function/property/get?id=${id}
方法
GET
Content-Type
无
请求参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| id | int | 否 | 属性ID |
响应参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| code | int | 是 | 返回码 |
| msg | string | 是 | 返回信息 |
| data | object | 是 | 返回数据 |
| +functionId | int | 是 | 属性ID |
| +productId | int | 是 | 产品ID |
| +productKey | string | 是 | ProductKey |
| +functionName | string | 是 | 属性名称 |
| +identifier | string | 是 | 属性标识 |
| +createTime | int | 是 | 创建时间 |
| +dataType | string | 是 | 属性的数据类型 |
| +rwProps | int | 是 | 访问模式。只读、只写、读写 |
| +jsonText | string | 是 | 描述属性的元数据,json格式 |
样例
{
"code": 200,
"msg": "success",
"data": {
"functionId": 0,
"productId": 0,
"productKey": "",
"functionName": "设备名",
"identifier": "device_id",
"createTime": "2025-03-24T09:24:19",
"dataType": "text",
"rwProps": 3,
"jsonText": "{\"type\": \"text\", \"specs\": {\"device_id\": \"\"}}"
}
}
事件列表查询
请求URL
https://www.thingshub.com.cn/openapi/v2/function/event/list?productId=${productId}
方法
GET
Content-Type
无
请求参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| productId | int | 是 | 产品ID |
| pageNumber | int | 否 | 页码 |
| pageSize | int | 否 | 页大小 |
响应参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| code | int | 是 | 返回码 |
| msg | string | 是 | 返回信息 |
| data | object | 是 | 返回数据 |
| +total | int | 是 | 总事件数 |
| +records | int | 是 | 事件列表 |
| ++id | int | 是 | id |
| ++productId | int | 是 | 产品ID |
| ++identifier | string | 是 | 事件标识 |
| ++name | string | 是 | 事件名称 |
| ++outputData | string | 是 | 事件输出数据内容说明 |
| ++type | int | 是 | 事件类型 |
| ++createTime | string | 是 | 创建时间 |
| ++remark | string | 是 | 备注 |
样例
{
"code": 200,
"msg": "success",
"data": {
"total": 5,
"records": [
{
"id": 0,
"productId": 0,
"identifier": "plc_test",
"name": "模拟plc上传",
"outputData": "[{\"identifier\": \"plc_test\",\"name\": \"\",\"remark\":\"\",\"dataType\": {\"type\": \"int|float|double|enum|bool|text|date|struct|array\",\"specs\": {}}}]",
"type": 1,
"createTime": "2025-03-26 16:04:17",
"remark": ""
},
{
"id": 0,
"productId": 0,
"identifier": "server_status",
"name": "查看服务状态",
"outputData": "[{\"identifier\": \"server_status\",\"name\": \"\",\"remark\":\"\",\"dataType\": {\"type\": \"int|float|double|enum|bool|text|date|struct|array\",\"specs\": {}}}]",
"type": 1,
"createTime": "2025-03-25 11:29:10",
"remark": ""
},
{
"id": 0,
"productId": 0,
"identifier": "ai_check_result",
"name": "推理结果",
"outputData": "[{\"identifier\": \"ai_check_result\",\"name\": \"推理结果\",\"remark\":\"\",\"dataType\": {\"type\": \"struct\",\"specs\": {\"image_id\":\"\",\"status\":\"\",\"result\":\"\",\"used\":\"\"}}}]",
"type": 1,
"createTime": "2025-03-21 11:45:04",
"remark": ""
},
{
"id": 0,
"productId": 0,
"identifier": "ai_check_request_stat",
"name": "请求计数和最大最小响应时间",
"outputData": "[{\"identifier\": \"ai_check_request_stat\",\"name\": \"请求计数和最大最小响应时间\",\"remark\":\"\",\"dataType\": {\"type\": \"struct\",\"specs\": {\"total_requests\":\"\",\"max_time\":\"\",\"average_time\":\"\"}}}]",
"type": 1,
"createTime": "2025-03-21 11:44:50",
"remark": ""
},
{
"id": 0,
"productId": 0,
"identifier": "ai_check_alert",
"name": "预测告警",
"outputData": "[{\"identifier\": \"ai_check_alert\",\"name\": \"预测告警\",\"remark\":\"\",\"dataType\": {\"type\": \"struct\",\"specs\": {\"alert_messages\":\"\",\"alert_frame\":\"\",\"alert_number\":\"\",}}}]",
"type": 2,
"createTime": "2025-03-21 11:42:32",
"remark": ""
}
]
}
}
获取事件详情
请求URL
https://www.thingshub.com.cn/openapi/v2/function/event/get?id=${id}
方法
GET
Content-Type
无
请求参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| id | int | 是 | 事件ID |
响应参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| code | int | 是 | 返回码 |
| msg | string | 是 | 返回信息 |
| data | object | 是 | 返回数据 |
| +id | int | 是 | 事件ID |
| +productId | int | 是 | 产品ID |
| +identifier | int | 是 | 事件标识 |
| +name | int | 是 | 事件名称 |
| +outputData | string | 是 | 事件输出数据内容说明 |
| +type | string | 是 | 事件类型 |
| +createTime | string | 是 | 创建时间 |
| +remark | int | 是 | 备注 |
样例
{
"code": 200,
"msg": "success",
"data": {
"id": 0,
"productId": 0,
"identifier": "plc_test",
"name": "模拟plc上传",
"outputData": "[{\"identifier\": \"plc_test\",\"name\": \"\",\"remark\":\"\",\"dataType\": {\"type\": \"int|float|double|enum|bool|text|date|struct|array\",\"specs\": {}}}]",
"type": 1,
"createTime": "2025-03-26 16:04:17",
"remark": ""
}
}
服务列表查询
请求URL
https://www.thingshub.com.cn/openapi/v2/function/service/list?productId=${productId}
方法
GET
Content-Type
无
请求参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| productId | int | 是 | 产品ID |
响应参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| code | int | 是 | 返回码 |
| msg | string | 是 | 返回信息 |
| data | object | 是 | 返回数据 |
| +total | int | 是 | 总记录数 |
| +records | int | 是 | 服务列表 |
| ++id | int | 是 | 服务ID |
| ++productId | int | 是 | 产品ID |
| ++identifier | string | 是 | 服务标识 |
| ++name | string | 是 | 服务名称 |
| ++inputData | string | 是 | 服务输入数据内容说明,json格式 |
| ++outputData | string | 是 | 服务输出数据内容说明,json格式 |
| ++type | int | 是 | 服务类型 |
| ++createTime | string | 是 | 创建时间 |
| ++remark | int | 是 | 备注 |
样例
{
"code": 200,
"msg": "success",
"data": {
"total": 1,
"records": [
{
"id": 0,
"productId": 0,
"identifier": "server_start",
"name": "服务开启",
"outputData": "[{\"identifier\": \"\",\"name\": \"\",\"remark\":\"\",\"dataType\": {\"type\": \"int|float|double|enum|bool|text|date|struct|array\",\"specs\": {}}}]",
"type": 2,
"createTime": "2025-03-21 15:53:34",
"remark": "",
"inputData": "[{\"identifier\": \"start\", \"name\":\"开启服务\", \"remark\": \"\", \"dataType\": {\"type\": \"string\", \"specs\": {\"action\":\"\",\"carama\":\"{\"rstp_address\":\"\",\"frame_speed\":\"\"}\",\"PLC\":{\"top_number\":\"\",\"bottom_number\":\"\"}}}}]"
}
]
}
}
获取服务详情
请求URL
https://www.thingshub.com.cn/openapi/v2/function/service/get?id=${id}
方法
GET
Content-Type
无
请求参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| id | int | 是 | 服务ID |
响应参数
| 参数 | 数据类型 | 是否必须 | 说明 |
|---|---|---|---|
| code | int | 是 | 返回码 |
| msg | string | 是 | 返回信息 |
| data | object | 是 | 返回数据 |
| +id | int | 是 | 服务ID |
| +productId | int | 是 | 产品ID |
| +identifier | string | 是 | 服务标识 |
| +name | string | 是 | 服务名称 |
| +inputData | string | 是 | 服务输入数据内容说明,json格式 |
| +outputData | string | 是 | 服务输出数据内容说明,json格式 |
| +type | int | 是 | 服务类型 |
| +createTime | string | 是 | 创建时间 |
| +remark | string | 是 | 备注 |
样例
{
"code": 200,
"msg": "success",
"data": {
"id": 0,
"productId": 0,
"identifier": "opendoor",
"name": "打开门禁",
"outputData": null,
"type": 1,
"createTime": "2022-07-27 15:12:06",
"remark": "",
"inputData": null
}
}