Skip to content

物模型管理 ​

属性列表查询 ​

请求URL

https://www.thingshub.com.cn/openapi/v2/function/property/list?productKey=${productKey}

方法

GET

Content-Type

无

请求参数

参数数据类型是否必须说明
productIdint否产品ID
productKeystring是ProductKey
pageNumberint否页码
pageSizeint否页大小

响应参数

参数数据类型是否必须说明
codeint是返回码
msgstring是返回信息
dataobject是返回数据
+totalint是总记录数
+recordsarray是属性列表
++idint是属性ID
++namestring是属性名
++identifierstring是属性标识
++accessModeint是访问模式。只读,只写、读写
++specsstring是描述属性的元数据,json格式
++dataTypestring是数据类型描述
++productIdint是所属产品ID
++createTimestring是创建时间

样例

json
{
  "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

无

请求参数

参数数据类型是否必须说明
idint否属性ID

响应参数

参数数据类型是否必须说明
codeint是返回码
msgstring是返回信息
dataobject是返回数据
+functionIdint是属性ID
+productIdint是产品ID
+productKeystring是ProductKey
+functionNamestring是属性名称
+identifierstring是属性标识
+createTimeint是创建时间
+dataTypestring是属性的数据类型
+rwPropsint是访问模式。只读、只写、读写
+jsonTextstring是描述属性的元数据,json格式

样例

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

无

请求参数

参数数据类型是否必须说明
productIdint是产品ID
pageNumberint否页码
pageSizeint否页大小

响应参数

参数数据类型是否必须说明
codeint是返回码
msgstring是返回信息
dataobject是返回数据
+totalint是总事件数
+recordsint是事件列表
++idint是id
++productIdint是产品ID
++identifierstring是事件标识
++namestring是事件名称
++outputDatastring是事件输出数据内容说明
++typeint是事件类型
++createTimestring是创建时间
++remarkstring是备注

样例

json
{
  "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

无

请求参数

参数数据类型是否必须说明
idint是事件ID

响应参数

参数数据类型是否必须说明
codeint是返回码
msgstring是返回信息
dataobject是返回数据
+idint是事件ID
+productIdint是产品ID
+identifierint是事件标识
+nameint是事件名称
+outputDatastring是事件输出数据内容说明
+typestring是事件类型
+createTimestring是创建时间
+remarkint是备注

样例

json
{
  "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

无

请求参数

参数数据类型是否必须说明
productIdint是产品ID

响应参数

参数数据类型是否必须说明
codeint是返回码
msgstring是返回信息
dataobject是返回数据
+totalint是总记录数
+recordsint是服务列表
++idint是服务ID
++productIdint是产品ID
++identifierstring是服务标识
++namestring是服务名称
++inputDatastring是服务输入数据内容说明,json格式
++outputDatastring是服务输出数据内容说明,json格式
++typeint是服务类型
++createTimestring是创建时间
++remarkint是备注

样例

json
{
  "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

无

请求参数

参数数据类型是否必须说明
idint是服务ID

响应参数

参数数据类型是否必须说明
codeint是返回码
msgstring是返回信息
dataobject是返回数据
+idint是服务ID
+productIdint是产品ID
+identifierstring是服务标识
+namestring是服务名称
+inputDatastring是服务输入数据内容说明,json格式
+outputDatastring是服务输出数据内容说明,json格式
+typeint是服务类型
+createTimestring是创建时间
+remarkstring是备注

样例

json
{
  "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
  }
}