查询设备列表

此接口用于查询设备列表。

1 接口路径

GET /api/v1/device/

2 请求参数

query参数:

名称 类型 是否必需 描述
productKey String 产品标识
name String 模糊匹配设备ID或设备名称
tagKeyword String 标签查询关键词。格式:k:v或k
page Integer 起始页码,默认1
size Integer 每页条数,默认20,在1到200之间

3 返回参数

统一返回参数说明参考:公共参数,以下是返回业务参数(data)的说明:

名称 类型 描述
page Integer 页码
size Integer 每页条数
total Integer 产品总数
content Object[] 设备信息列表,详情参考下表

设备信息详情:

名称 类型 描述
id Integer 设备ID
name String 设备名称
productKey String 产品唯一标识
productName String 产品名称
nodeType String 节点类型 DEVICE:设备 GATEWAY:网关
subNum Integer 子设备数量
latelyOnlineTime Long 最近上线时间
status String 设备状态(未激活 在线 离线 禁用)

4 返回状态码

公共状态码说明参考:公共参数,以下是业务关联的状态码说明:

5 示例

请求示例

/api/v1/device/?productKey=e4ceb4e874e&name=SK-1&page=10&size=1000&tagKeyword=room:

返回示例

{
    "code": "000000",
    "data": {
        "content": [
            {
                "id": "300452843041591296",
                "name": "SK-X",
                "nodeType": "DEVICE",
                "productKey": "1_783dcb3cf4d",
                "productName": "直连设备产品",
                "status": "FORBIDDEN",
                "subNum": 0,
              	"latelyOnlineTime": 1562835034000
            }
        ],
        "page": 1,
        "size": 20,
        "total": 1
    },
    "message": "success"
}