产品管理
更新时间: 2023-04-19
# 创建产品
# 基本信息
Path: /v1/products/:instanceId
Method: POST
接口描述:
# 请求参数
Headers
参数名称 | 参数值 | 是否必须 | 示例 | 备注 |
---|---|---|---|---|
Content-Type | application/json | 是 |
路径参数
参数名称 | 示例 | 备注 |
---|---|---|
instanceId |
Body
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
productName | string | 必须 | 1~32字符,可为汉字、大小写英文、数字、中线、下划线。^[\u4e00-\u9fa5a-zA-Z0-9\-_]{1,32}$ | ||
productKey | string | 必须 | 1~32字符,可为大小写英文、数字、中线、下划线。^[a-zA-Z0-9\-_]{1,32}$ | ||
description | string | 非必须 | 0-128字符。^[\s\S]{0,128}$ | ||
deviceType | string | 必须 | DIRECT: 直连设备, GATEWAY: 网关, SUBDEVICE: 网关子设备, COMPONENT: 组件 | ||
accessType | string [] | 必须 | 联网方式: [WIFI, 2G/3G/4G, 5G, ETHERNET] 接入协议: [NB-IOT, BLE, ZigBee, Modbus, OPC UA, HTTP/HTTPS, MQTT, OTHER] | ||
├─ | 非必须 | ||||
extensions | string [] | 非必须 | |||
├─ | 非必须 |
# 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
instanceId | string | 非必须 | |||
productKey | string | 非必须 | |||
productSecret | string | 非必须 | |||
productName | string | 非必须 | |||
description | string | 非必须 | |||
deviceType | string | 非必须 | |||
accessType | string | 非必须 | |||
createTime | string | 非必须 | |||
updateTime | string | 非必须 | |||
offlineDetectState | boolean | 非必须 | |||
offlineDetectCycle | integer | 非必须 |
# 删除产品
# 基本信息
Path: /v1/products/:instanceId/:productKey
Method: DELETE
接口描述:
# 请求参数
路径参数
参数名称 | 示例 | 备注 |
---|---|---|
instanceId | ||
productKey |
# 返回数据
无
# 修改产品
# 基本信息
Path: /v1/products/:instanceId/:productKey
Method: PUT
接口描述:
# 请求参数
路径参数
参数名称 | 示例 | 备注 |
---|---|---|
instanceId | ||
productKey |
Body
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
productName | string | 非必须 | |||
description | string | 非必须 | |||
extensions | string [] | 非必须 | |||
├─ | 非必须 | ||||
offlineDetectState | boolean | 非必须 | 离在线检测开关 | ||
offlineDetectCycle | integer | 非必须 | 离在线检测周期,单位秒,min = 5, max = 86400 | ||
logState | boolean | 非必须 | 默认false,产品是否开启用户日志功能 | ||
dynamicRegisterState | boolean | 非必须 | 默认false,产品是否开启动态注册功能 |
# 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
deviceType | string | 非必须 | |||
updateTime | string | 非必须 | |||
description | string | 非必须 | |||
accessType | string | 非必须 | |||
productSecret | string | 非必须 | |||
productKey | string | 非必须 | |||
createTime | string | 非必须 | |||
authType | string | 非必须 | |||
productName | string | 非必须 | |||
instanceId | string | 非必须 | |||
offlineDetectState | boolean | 非必须 | |||
offlineDetectCycle | number | 非必须 | |||
logState | boolean | 非必须 | |||
dynamicRegisterState | boolean | 非必须 |
# 重置产品密钥
# 基本信息
Path: /v1/products/:instanceId/:productKey/secret
Method: PUT
接口描述:
# 请求参数
路径参数
参数名称 | 示例 | 备注 |
---|---|---|
instanceId | ||
productKey |
# 返回数据
无
# 产品支持永久连接
# 基本信息
Path: /v1/products/:instanceId/:productKey/permanentConnect
Method: POST
接口描述:
# 请求参数
路径参数
参数名称 | 示例 | 备注 |
---|---|---|
instanceId | ||
productKey |
Body
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
permanentConnect | boolean | 非必须 | 默认false,产品是否支持永久MQTT连接 |
# 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|
# 查询产品详情
# 基本信息
Path: /v1/products/:instanceId/:productKey
Method: GET
接口描述:
# 请求参数
路径参数
参数名称 | 示例 | 备注 |
---|---|---|
instanceId | ||
productKey |
# 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
instanceId | string | 非必须 | |||
productKey | string | 非必须 | |||
productSecret | string | 非必须 | |||
productName | string | 非必须 | |||
description | string | 非必须 | |||
deviceType | string | 非必须 | |||
accessType | string [] | 非必须 | |||
├─ | 非必须 | ||||
updateTime | string | 非必须 | |||
createTime | string | 非必须 | |||
permanentConnect | boolean | 非必须 | |||
extensions | string [] | 非必须 | |||
├─ | 非必须 | ||||
shadowState | boolean | 非必须 | |||
logState | boolean | 非必须 | |||
dynamicRegisterState | boolean | 非必须 | |||
offlineDetectState | boolean | 非必须 | |||
offlineDetectCycle | integer | 非必须 |
# 查询产品列表
# 基本信息
Path: /v1/products/:instanceId
Method: GET
接口描述:
# 请求参数
路径参数
参数名称 | 示例 | 备注 |
---|---|---|
instanceId |
Query
参数名称 | 是否必须 | 示例 | 备注 |
---|---|---|---|
pageNo | 是 | ||
pageSize | 是 | ||
productName | 否 | 支持ID/名称模糊查询 | |
tagKey | 否 | ||
tagValue | 否 | ||
deviceType | 否 | 支持按设备类型查询 |
# 返回数据
名称 | 类型 | 是否必须 | 默认值 | 备注 | 其他信息 |
---|---|---|---|---|---|
totalCount | number | 非必须 | |||
result | object [] | 非必须 | |||
├─ instanceId | string | 非必须 | |||
├─ productKey | string | 非必须 | |||
├─ productSecret | string | 非必须 | |||
├─ productName | string | 非必须 | |||
├─ description | string | 非必须 | |||
├─ deviceType | string | 非必须 | |||
├─ accessType | string [] | 非必须 | |||
├─ | 非必须 | ||||
├─ createTime | string | 非必须 | |||
├─ updateTime | string | 非必须 | |||
pageNo | number | 非必须 | |||
pageSize | number | 非必须 | |||
productName | string | 非必须 | |||
tagKey | string | 非必须 | |||
tagValue | string | 非必须 | |||
deviceType | string | 非必须 |