docs: add OneNET API reference documentation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
+119
@@ -0,0 +1,119 @@
|
||||
物模型查询
|
||||
最近更新时间:2024-02-21 16:47:03
|
||||
接口功能
|
||||
根据产品id查询指定产品下的物模型功能点
|
||||
|
||||
备注
|
||||
数据协议为OneJson的产品可查询
|
||||
|
||||
接口地址
|
||||
http(s)://iot-api.heclouds.com/thingmodel/query-thing-model
|
||||
|
||||
API说明
|
||||
请求方式:GET
|
||||
|
||||
http query 请求参数:
|
||||
|
||||
参数 类型 是否必选 描述
|
||||
product_id string 是 产品id
|
||||
返回数据
|
||||
|
||||
参数名称 类型 描述
|
||||
code int 调用失败时,返回的错误码
|
||||
msg string 调用失败时,返回的错误信息
|
||||
request_id string 调用API时生成的请求标识
|
||||
data.properties array 数组对象 属性功能点
|
||||
p.functionMode string 功能点类型,定值'property'
|
||||
p.identifier string 属性唯一标识符(产品下唯一)
|
||||
p.name string 属性名称
|
||||
p.desc string 属性描述
|
||||
p.accessMode string "属性读写类型:只读(r)或读写(rw)
|
||||
p.functionType string 是否是标准功能点,自定义(u)/系统(s)
|
||||
p.dataType object 属性功能点数据
|
||||
p.dataType.type string 属性类型: int32(32位整数)、int64(64位整数)、float(单精度浮点)、double(双精度浮点型)、string(字符串)、date(String类型UTC秒)、bool(true或false)、enum(int类型)、bitMap(位图)、date(int64类型UTC时间戳毫秒)、struct(结构体类型)、array(数组)
|
||||
p.dataType.specs object 属性功能点数据
|
||||
data.events array 数组对象 事件功能点
|
||||
e.functionMode string 功能点类型,定值'event'
|
||||
e.identifier string 事件唯一标识符
|
||||
e.name string 事件名称
|
||||
e.desc string 事件描述
|
||||
e.type string 事件类型(info、alert、error)
|
||||
e.fuctionType string 是否是标准功能点,自定义(u)/标准(s)
|
||||
e.outputData array 参数
|
||||
e.outputData.identifier string 参数唯一标识符
|
||||
e.outputData.name string 参数名称
|
||||
e.outputData.dataType object 参数数据
|
||||
e.outputData.dataType.type string 属性类型: int32(32位整数)、int64(64位整数)、float(单精度浮点)、double(双精度浮点型)、string(字符串)、date(String类型UTC秒)、bool(true或false)、enum(int类型)、bitMap(位图)、date(int64类型UTC时间戳毫秒)、struct(结构体类型)、array(数组)
|
||||
services array 数组对象 服务功能点
|
||||
s.functionMode string 功能点类型,定值'service'
|
||||
s.identifier string 服务唯一标识符(产品下唯一)
|
||||
s.name string 服务名称
|
||||
s.desc string 服务描述
|
||||
s.callType string 调用方式,同步(s)/异步(a)
|
||||
s.fuctionType string 功能点类型,自定义(u)/系统(s)
|
||||
s.input array 输入参数
|
||||
s.input.identifier string 参数唯一标识符
|
||||
s.input.name string 参数名称
|
||||
s.input.dataType object 参数数
|
||||
s.input.dataType.type string 属性类型: int32(32位整数)、int64(64位整数)、float(单精度浮点)、double(双精度浮点型)、string(字符串)、bool(true或false)、enum(int类型)、bitMap(位图)、date(int64类型UTC时间戳毫秒)、struct(结构体类型)、array(数组)
|
||||
s.input.dataType.specs object 参数功能点数据
|
||||
s.output array 输出参数
|
||||
s.output.identifier string 参数唯一标识符
|
||||
s.output.name string 参数名称
|
||||
s.output.dataType object 参数数据
|
||||
s.output.dataType.type string 属性类型: int32(32位整数)、int64(64位整数)、float(单精度浮点)、double(双精度浮点型)、string(字符串)、bool(true或false)、enum(int类型)、bitMap(位图)、date(int64类型UTC时间戳毫秒)、struct(结构体类型)、array(数组)
|
||||
s.output.dataType.specs object 参数功能点数据
|
||||
示例
|
||||
请求示例
|
||||
|
||||
GET http(s)://iot-api.heclouds.com/thingmodel/query-thing-model?product_id=xxx
|
||||
|
||||
响应示例
|
||||
|
||||
{
|
||||
"data": {
|
||||
"properties": [
|
||||
{
|
||||
"name": "模式",
|
||||
"identifier": "model",
|
||||
"functionType": "u",
|
||||
"functionMode": "property",
|
||||
"desc": "",
|
||||
"accessMode": "rw",
|
||||
"dataType": {
|
||||
"type": "enum",
|
||||
"specs": {
|
||||
"1": "模式1",
|
||||
"2": "模式2"
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"events": [
|
||||
{
|
||||
"name": "test",
|
||||
"identifier": "test",
|
||||
"functionType": "u",
|
||||
"functionMode": "event",
|
||||
"desc": null,
|
||||
"eventType": "info",
|
||||
"outputData": [
|
||||
{
|
||||
"dataType": {
|
||||
"type": "bool",
|
||||
"specs": {
|
||||
"false": "关",
|
||||
"true": "开"
|
||||
}
|
||||
},
|
||||
"name": "开关",
|
||||
"identifier": "switch"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"request_id": "a25087f46df04b69b29e90ef0acfd115",
|
||||
"msg": "succ",
|
||||
"code": 0
|
||||
}
|
||||
Reference in New Issue
Block a user