最近更新时间:2023-02-01
查询设备列表
参数 | 是否必选 | 参数类型 | 描述 |
---|---|---|---|
Action | 是 | String | 系统指定参数。取值:QueryDevice |
DeviceId | 否 | String | 按设备ID查询 |
Name | 否 | String | 按设备名称查询,支持模糊查询 |
Type | 否 | String | 按设备类型查询。取值:ipc、nvr、channel、platform |
GroupId | 否 | String | 按空间ID查询。 指定查询某个空间下设备时必传,不传时默认查询所有空间下设备。 查询所有空间下设备时,仅支持根据设备ID、设备名称查询。(对于通道设备支持传入ParentId查询) |
ParentId | 否 | String | 按上级设备ID查询(适用于查询通道设备即Type为channel,查询其他类型设备不要传) |
GbDeviceId | 否 | String | 按国标ID查询。 |
ManageStatus | 否 | String | 根据设备启用状态查询 启用 active 停用 stop |
DeviceStatus | 否 | String | 按设备上下线状态查询,在线:online 离线:offline 未注册:unregistered (如果不为空,需要指定GroupId) |
PageSize | 否 | Long | 分页大小,默认为20 |
PageNum | 否 | Long | 第几分页,默认为1 |
参数 | 是否必选 | 参数类型 | 描述 |
---|---|---|---|
RequestId | 是 | String | 该条接口请求ID |
Code | 是 | String | 0成功 其他失败 |
Message | 否 | String | 结果信息,成功时为空 |
Data | 否 | Object | 返回数据,json对象结构 此接口为空 |
--PageSize | 否 | Long | 分页大小,默认为20 |
--PageNum | 否 | Long | 第几分页,默认为1 |
--PageTotal | 否 | Long | 分页总数,默认为1 |
--TotalCount | 是 | Long | 设备数量 |
--DeviceList | 是 | array of device objects | 设备列表 |
device定义
参数 | 是否必选 | 参数类型 | 描述 |
---|---|---|---|
DeviceId | 是 | String | 设备ID |
Type | 是 | String | 设备类型。取值:ipc、nvr、channel、platform |
Name | 是 | String | 设备名称。 |
GroupId | 是 | String | 设备所属空间ID。 |
GroupName | 是 | String | 设备所属空间名称。 |
ParentId | 否 | String | 上级设备ID |
MaxChannelNum | 否 | Long | 最大通道数量。 |
ChannelId | 否 | Long | 通道号 |
GbDeviceId | 否 | String | 设备国标ID |
StreamName | 否 | String | 流名称。 |
PushUrl | 否 | String | 推流地址 |
UserName | 否 | String | 鉴权用户名(适用于国标空间设备NVR的通道可以不用设置)。 |
Password | 否 | String | 鉴权密码(适用于国标空间设备NVR的通道可以不用设置)。 |
ManageStatus | 是 | String | 设备管理状态。取值:active(启用)、stop(停用) |
GbVersion | 否 | String | gb28181协议版本号,仅gb28181空间ipc、nvr设备有效。取值:2011、2016。 (仅适用于gb28181空间设备) |
Longitude | 否 | String | 设备经度 |
Latitude | 否 | String | 设备纬度 |
DeviceIp | 否 | String | 设备IP |
DevicePort | 否 | Long | 设备端口号 |
DeviceSn | 否 | String | 设备序列号 |
LastOnlineTime | 否 | String | 设备最后一次在线时间 格式如:yyyy-MM-ddTHH:mm:ssZ,UTC时间 |
请求示例:
查询非通道设备:
GET https://api.unicloud.com/univms?
Action=QueryDevice
&Name=测试设备
&公共请求参数
查询通道设备:
GET https://api.unicloud.com/univms?
Action=QueryDevice
&DeviceId=uni0340031122060938682400
&GroupId=uni0341122060286924475
&ParentId=uni0340021122061775779565
&公共请求参数
返回示例:
非通道设备 { "RequestId": "77fc5395-78ec-433f-9f48-519a08647cdf", "Code": "0", "Data": { "PageSize": 20, "PageNum": 1, "TotalCount": 4, "PageTotal": 1, "DeviceList": [ { "DeviceId": "uni0340021122061775779565", "Type": "nvr", "Name": "nvr测试设备", "GroupId": "uni0341122060286924475", "GroupName": "测试国标空间", "ParentId": "", "MaxChannelNum": "16", "ChannelId": "0", "GbDeviceId": "12000000001180570947", "UserName": "username", "Password": "password", "GbVersion": "2011", "ManageStatus": "active", "DeviceIp": "10.0.0.1", "DevicePort": "4321", "DeviceSn": "12345", "LastOnlineTime": "2022-10-26T07:53:29Z" }, { "DeviceId": "uni0340011122061377609622", "Type": "ipc", "Name": "ipc测试设备", "GroupId": "uni0341122060286924475", "GroupName": "测试国标空间-0010", "ParentId": "", "MaxChannelNum": "1", "ChannelId": "0", "GbDeviceId": "12000000001320914363", "UserName": "username", "Password": "password", "GbVersion": "2011", "ManageStatus": "active", "DeviceIp": "10.0.0.1", "DevicePort": "4321", "DeviceSn": "12345", "LastOnlineTime": "2022-10-26T07:53:29Z" }, { "DeviceId": "uni0340001122062015593783", "Type": "ipc", "Name": "rtmp测试设备", "GroupId": "uni0341122060388608507", "GroupName": "测试rtmp空间", "ParentId": "", "GbDeviceId": "", "PushUrl": "rtmp://rtmp.pushdomain.param/uni0341122060388608507/uni0340001122062015593783?token=54d988b7aa65247317a55987ad7c6905&time=1656468060", "ManageStatus": "active", "Longitude": "52.25", "Latitude": "25.52", "DeviceIp": "10.0.0.1", "DevicePort": "0", "DeviceSn": "12345", "LastOnlineTime": "2022-10-26T07:53:29Z" }, { "DeviceId": "uni0340041122070426267133", "Type": "platform", "Name": "测试级联设备0004", "GroupId": "uni03411202109f70ec206", "GroupName": "上海测试空间", "ParentId": "", "MaxChannelNum": "1", "ChannelId": "0", "GbDeviceId": "12000000002001000007", "UserName": "username", "Password": "password", "GbVersion": "2011", "ManageStatus": "active", "DeviceIp": "", "DevicePort": "0", "DeviceSn": "", "LastOnlineTime": "2022-10-26T07:53:29Z" } ] } } 通道设备(nvr): { "RequestId": "8731b418-9ed8-47a5-87a1-39ffe336b339", "Code": "0", "Data": { "PageSize": 20, "PageNum": 1, "TotalCount": 1, "PageTotal": 1, "DeviceList": [ { "DeviceId": "uni0340031122060938682400", "Type": "channel", "Name": "channel测试设备", "GroupId": "uni0341122060286924475", "GroupName": "测试国标空间", "ParentId": "uni0340021122061775779565", "MaxChannelNum": "0", "ChannelId": "1", "GbDeviceId": "12000000001320130360", "GbVersion": "", "ManageStatus": "active", "DeviceIp": "10.0.0.1", "DevicePort": "4321", "DeviceSn": "12345", "LastOnlineTime": "2022-10-26T07:53:29Z" } ] } } 通道设备(platform): { "RequestId": "83367a1d-456a-46d8-9080-c0da30cd674b", "Code": "0", "Data": { "PageSize": 20, "PageNum": 1, "TotalCount": 1, "PageTotal": 1, "DeviceList": [ { "DeviceId": "uni0340031122071116899151", "Type": "channel", "Name": "通道一", "GroupId": "uni03411202109f70ec206", "GroupName": "上海测试空间", "ParentId": "uni0340041122070426267133", "MaxChannelNum": "0", "ChannelId": "0", "GbDeviceId": "13050111091327000001", "GbVersion": "", "ManageStatus": "stop", "DeviceIp": "", "DevicePort": "0", "DeviceSn": "", "LastOnlineTime": "2022-10-26T07:53:29Z" } ] } } |
状态码 | 描述 |
---|---|
200 | OK |
400 | Bad Request |