查询设备列表

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

1. 接口描述

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

查询设备列表。

2. 请求参数

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

3. 返回参数

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

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(手动创建)
DeviceChannelsDeviceChannel[]nvr设备通道列表。
ipc设备忽略该字段,nvr设备才返回。
DeviceStatsDeviceStats设备统计信息。
DeviceDirDeviceDir设备目录。
CreatedTimeString设备创建时间。
UpdatedTimeString设备更新时间。
RequestIdString唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
RecordStatusInt
RecordTaskIdString
GbRegionString
GbRegionLevelString
PushTypeInt
InTypeString
PushUrlString
PullUrlString
TagsString
MultiStreamSizeInt
AutoStreamNumInt
DeviceModelString
DeviceSnString
DeviceFirmwareString
DeviceHardwareString
DevicePositionString
DevicePubIpString
DevicePubPortInt
EhomeVersionString
ChannelSizeInt
ChannelNumInt
ChannelNameString
DeviceStreamsstring[]
DeviceLongitudeString
DeviceLatitudeString
DeviceDomainString
EnableDomainInt

DeviceChannel

参数类型描述
ChannelNumLong通道号。
ChannelNameString通道名称。
GbIdString设备国标ID。
DeviceIdString设备ID。
DeviceStatusString设备状态。
取值:on(在线), off(离线), new(未注册)。
StreamStatusString流状态。
取值:on(在线), off(离线), failed(失败)。
CreatedTimeString子设备(通道)创建时间。
UpdatedTimeString子设备(通道)更新时间。

DeviceStats

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

DeviceDir

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


4.1 请求示例

https://vssapi.ctyun.cn/
?Action=DescribeDevices
&InProtocol=rtmp
&DirId=897098424844288
&DeviceVendor=haikang
&DeviceName=haikang
&DeviceType=ipc
&StreamStatus=on
&SortBy=CreatedTime
&SortDirection=asc
&PageNum=1
&PageSize=20
&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": 1,
    "Devices":
    [
        {
            "DeviceId": "282260509138534400",
            "GroupId": "282007604284276739",
            "ParentDeviceId": "-1",
            "DirId": "",
            "DeviceType": "ipc",
            "DeviceVendor": "",
            "DeviceName": "testfordev",
            "Description": "",
            "DeviceIp": "",
            "DevicePort": 0,
            "InProtocol": "rtmp",
            "UserName": "",
            "UserPassword": "",
            "GbId": "",
            "PullType": 0,
            "TransPriority": "",
            "DeviceEnabled": 0,
            "DeviceStatus": "on",
            "StreamStatus": "new",
            "SipTransType": "",
            "StreamTransType": "",
            "CreateSubDevice": 0,
            "GbVersion": "",
            "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": "2021-09-16 18:24:23",
            "UpdatedTime": "2021-09-16 18:24:23",
            "RecordStatus": 2,
            "RecordTaskId": "",
            "InType": "push",
            "PushType": 1,
            "DeviceModel": "",
            "DeviceSn": "",
            "DeviceFirmware": "",
            "DeviceHardware": "",
            "DevicePosition": "",
            "DevicePubIp": "",
            "DevicePubPort": 0,
            "EhomeVersion": "",
            "ChannelSize": 0,
            "ChannelNum": 0,
            "ChannelName": "",
            "autoStreamNum": 0,
            "DeviceChannels":
            [
                {
                    "ChannelNum": 1,
                    "ChannelName": "通道1",
                    "GbId": "34082400011328367668",
                    "DeviceId": "29942045602742287",
                    "DeviceStatus": "on",
                    "StreamStatus": "failed",
                    "CreatedTime": "2020-08-31 09:43:55",
                    "UpdatedTime": "2020-09-02 19:21:04"
                },
                {
                    "ChannelNum": 2,
                    "ChannelName": "通道2",
                    "GbId": "34082400011328546061",
                    "DeviceId": "29941979030749200",
                    "DeviceStatus": "on",
                    "StreamStatus": "on",
                    "CreatedTime": "2020-08-31 09:43:56",
                    "UpdatedTime": "2020-09-02 19:21:04"
                }
            ],
            "DeviceStreams":
            [],
            "MultiStreamSize": 0,
            "DeviceLongitude": "",
            "DeviceLatitude": "",
            "GbRegion": "",
            "GbRegionLevel": 0,
            "DeviceDomain": "",
            "EnableDomain": 0,
            "OrderSequence": "0"
        }
    ],
    "RequestId": "eba74b07aea3480d8ce4ee39cfd57a0a",
    "actions":[]
}

5. 错误码

ErrorCodeErrorMessage