查询设备列表

最近更新时间:2025-02-21 02:50:53

1. 接口描述

接口请求域名: vssapi.ctyun.cn
默认接口请求频率限制:500次/秒。

查询设备列表。

2. 请求参数

参数类型是否必选示例值描述
ActionStringDescribeDevices操作接口名,系统规定参数。
InProtocolStringgb28181使用的接入协议。
取值: gb28181
虚拟业务组vgroup时,可为空
GroupIdString32388487739092994根据设备所属组ID查询。
ParentDeviceIdString32388487739092995根据设备所属上级设备ID查询。
DirIdString897098424844288根据设备所属目录ID查询。
DeviceVendorString海康根据设备厂商查询。
DeviceNameString高空抛物摄像头根据设备名称查询。
DeviceTypeStringipc根据设备类型查询。
取值: ipc,nvr,platform
DeviceStatusStringon根据设备状态查询。
取值:on(在线), off(离线), new(未注册)。
StreamStatusStringon根据流状态查询。
取值:on(在线), off(离线), failed(失败)。
SortByStringCreatedTime选择按一个字段排序,可选值为:
- DeviceID
- CreatedTime
- UpdatedTime
默认为CreatedTime,按照创建时间排序。
SortDirectionStringasc排序方式,默认升序。
取值:asc(升序), desc(降序)。
PageNumLong1第几个分页,默认为1。
PageSizeLong20分页大小,默认为10。
取值范围为1~1000
IncludeDeviceStatsLong0是否返回设备统计信息,默认0。
取值:0(不返回), 1(返回)
IncludeDeviceDirLong0是否返回目录信息,默认0。
取值:0(不返回), 1(返回)

3. 返回参数

参数类型描述
PageNumLong第几个分页。
PageSizeLong分页大小。
TotalPageLong分页总数。
TotalNumLong设备总数。
DevicesDevice[]设备列表。
RequestIdString唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
DirStatsDirStats目录统计信息。
ActionsString[]操作集合。

Device

参数类型描述
DeviceIdString设备ID。
GroupIdString设备所属组ID。
ParentDeviceIdString上级设备ID,比如摄像头所属的NVR设备ID。
DirIdString设备所属目录ID。
DeviceTypeString设备类型。取值: ipc,nvr,platform
GbVersionString国标版本。
取值: 2011, 2016
DeviceVendorString设备厂商。
DeviceNameString设备名称。
DescriptionString设备描述。
DeviceIpString设备IP。
DevicePortLong设备Port。
InProtocolString设备使用的接入协议。
取值: gb28181~~, rtmp, onvif, rtsp~~
UserNameString设备用户名,在创建GB28181凭证时生成。
UserPasswordString设备密码,在创建GB28181凭证时生成。
GbIdString设备国标ID。
PullTypeLong是否启用自动拉流。
仅gb28181组支持该字段。
取值:1, 2
取值为1,自动拉流,国标设备注册成功后自动启动拉流;
取值为2,按需拉流,需要通过触发的方式启动拉流。
TransPriorityString设备视频流优先传输协议,默认tcp。
取值:tcp, udp。
取值为tcp,如果设备支持tcp协议传输,设备进行视频邀约时优先使用tcp协议接入到vss服务中。
取值为udp,设备进行视频邀约时优先使用udp协议接入到vss服务中。
DeviceEnabledLong设备是否启用。
取值:0(停用), 1(启用)
DeviceStatusString设备状态。
取值:on(在线), off(离线), new(未注册)。
StreamStatusString流状态。
取值:on(在线), off(离线), failed(失败)。
SipTransTypeString信令传输类型。
取值:tcp, udp
StreamTransTypeString流传输类型。
ps_rtp_udp: PS over RTP UDP
ps_rtp_tcp: PS over RTP TCP
h264_rtp_udp: H264 over RTP UDP
h264_rtp_tcp: H264 over RTP TCP
CreateSubDeviceLong是否自动创建子设备。
取值:1(自动创建), 2(手动创建)
DeviceStatsDeviceStats设备统计信息。
DeviceDirDeviceDir设备目录。
SerialNumberString设备SN码。
DeviceModelString设备型号。
CreatedTimeString设备创建时间。
UpdatedTimeString设备更新时间。
RecordStatusInt录制状态。
RecordTaskIdString录制任务ID。
GbRegionString设备区域编码。
GbRegionLevelString设备区域级别。
PushTypeInt是否启用自动激活推流地址。
InTypeString视频流接入方式。
PushUrlString推流地址。
PullUrlString拉流地址。
TagsString标签。
MultiStreamSizeInt主子码流数量。
AutoStreamNumInt自动拉取第几个码流。
DeviceSnString设备ID序列号。
DeviceFirmwareString设备固件号。
DeviceHardwareString设备硬件号。
DevicePositionString设备位置。
DevicePubIpString设备公网出口Ip。
DevicePubPortInt设备公网出口Port。
EhomeVersionStringehome版本。
ChannelSizeInt通道数量。
ChannelNumInt通道号。
ChannelNameString通道名称。
DeviceStreamsstring[]设备视频流信息。
DeviceLongitudeString设备经度。
DeviceLatitudeString设备纬度。
DeviceDomainString设备域名。
EnableDomainInt是否启用域名。

DeviceStats

参数类型描述
ChannelSizeLong通道数量。
OnlineChannelsLong在线通道数量。
OfflineChannelsLong离线通道数量。
OnlineStreamsLong在线流数量。
OfflineStreamsLong离线流数量。
FailedStreamsLong失败流数量。
MaxChannelSizeLong最大通道数量。

DeviceDir

参数类型描述
DirIdString目录ID。
DirNameString目录名称。
DescriptionString目录描述。
GroupIdString目录所属组ID。
ParentDirIdString上级目录ID。
CreatedTimeString目录创建时间。
UpdatedTimeString目录修改时间。

DirStats

参数类型描述
DeviceSizeString设备数量
IpcSizeStringIPC设备数量
NvrSizeStringNVR设备数量
PlatformSizeString平台设备数量

4. 示例

4.1 请求示例

https://vssapi.ctyun.cn/
?Action=DescribeDevices
&InProtocol=gb28181
&GroupId=883904285310976
&IncludeDeviceDir=1
&IncludeDeviceStats=1
&Version=2020-06-12
&AccessKeyId=O0G0BPBI2T9YUD3U****
&Signature=b5Gv5U2hlTHgeEaKE9KgVoo6DWw%3D
&SignatureMethod=HMAC-SHA1
&SignatureNonce=1578406
&SignatureVersion=1.0
&Timestamp=1599113545

4.2 返回示例

{
  "PageNum": 1,
  "PageSize": 20,
  "TotalPage": 1,
  "TotalNum": 3,
  "Devices": [
    {
      "DeviceId": "29942077814997590",
      "GroupId": "883904285310976",
      "ParentDeviceId": "29942103584801365",
      "DirId": "-1",
      "DeviceType": "ipc",
      "DeviceVendor": "",
      "DeviceName": "test-nvr",
      "Description": "",
      "DeviceIp": "",
      "DevicePort": 0,
      "InProtocol": "",
      "UserName": "user",
      "UserPassword": "user",
      "GbId": "34082400011328566275",
      "PullType": 2,
      "TransPriority": "tcp",
      "DeviceEnabled": 1,
      "DeviceStatus": "new",
      "StreamStatus": "",
      "SipTransType": "",
      "StreamTransType": "",
      "CreateSubDevice": 1,
      "GbVersion": "2011",
      "DeviceStats": {
        "ChannelSize": 1,
        "OnlineChannels": 0,
        "OfflineChannels": 0,
        "OnlineStreams": 0,
        "OfflineStreams": 0,
        "FailedStreams": 0
      },
      "DeviceDir": {
        "DirId": "0",
        "DirName": "",
        "Description": "",
        "GroupId": "0",
        "ParentDirId": "0",
        "CreatedTime": "0001-01-01 00:00:00",
        "UpdatedTime": "0001-01-01 00:00:00"
      },
      "CreatedTime": "2020-09-02 17:44:12",
      "UpdatedTime": "2020-09-02 18:14:21",
      "RequestId": "3247575e6e1044668962f5a464fa3885"
    },
    {
      "DeviceId": "29942071372546647",
      "GroupId": "883904285310976",
      "ParentDeviceId": "29942103584801365",
      "DirId": "-1",
      "DeviceType": "ipc",
      "DeviceVendor": "",
      "DeviceName": "test-nvr",
      "Description": "",
      "DeviceIp": "",
      "DevicePort": 0,
      "InProtocol": "",
      "UserName": "user",
      "UserPassword": "user",
      "GbId": "34082400011328199910",
      "PullType": 2,
      "TransPriority": "tcp",
      "DeviceEnabled": 1,
      "DeviceStatus": "new",
      "StreamStatus": "",
      "SipTransType": "",
      "StreamTransType": "",
      "CreateSubDevice": 1,
      "GbVersion": "2011",
      "DeviceStats": {
        "ChannelSize": 1,
        "OnlineChannels": 0,
        "OfflineChannels": 0,
        "OnlineStreams": 0,
        "OfflineStreams": 0,
        "FailedStreams": 0
      },
      "DeviceDir": {
        "DirId": "0",
        "DirName": "",
        "Description": "",
        "GroupId": "0",
        "ParentDirId": "0",
        "CreatedTime": "0001-01-01 00:00:00",
        "UpdatedTime": "0001-01-01 00:00:00"
      },
      "CreatedTime": "2020-09-02 17:44:12",
      "UpdatedTime": "2020-09-02 18:14:21",
      "RequestId": "3247575e6e1044668962f5a464fa3885"
    },
    {
      "DeviceId": "29942103584801365",
      "GroupId": "883904285310976",
      "ParentDeviceId": "-1",
      "DirId": "-1",
      "DeviceType": "nvr",
      "DeviceVendor": "",
      "DeviceName": "test-nvr",
      "Description": "",
      "DeviceIp": "",
      "DevicePort": 0,
      "InProtocol": "",
      "UserName": "user",
      "UserPassword": "user",
      "GbId": "34082400011188419252",
      "PullType": 2,
      "TransPriority": "tcp",
      "DeviceEnabled": 1,
      "DeviceStatus": "new",
      "StreamStatus": "",
      "SipTransType": "",
      "StreamTransType": "",
      "CreateSubDevice": 1,
      "GbVersion": "2011",
      "DeviceStats": {
        "ChannelSize": 2,
        "OnlineChannels": 0,
        "OfflineChannels": 0,
        "OnlineStreams": 0,
        "OfflineStreams": 0,
        "FailedStreams": 0
      },
      "DeviceDir": {
        "DirId": "0",
        "DirName": "",
        "Description": "",
        "GroupId": "0",
        "ParentDirId": "0",
        "CreatedTime": "0001-01-01 00:00:00",
        "UpdatedTime": "0001-01-01 00:00:00"
      },
      "CreatedTime": "2020-09-02 17:44:12",
      "UpdatedTime": "2020-09-02 18:14:21",
      "RequestId": "3247575e6e1044668962f5a464fa3885"
    }
  ],
  "RequestId": "3247575e6e1044668962f5a464fa3885"
}

5. 错误码

ErrorCodeErrorMessage