查询设备列表
最近更新时间:2025-02-21 02:50:53
1. 接口描述
接口请求域名: vssapi.ctyun.cn
默认接口请求频率限制:500次/秒。
查询设备列表。
2. 请求参数
参数 | 类型 | 是否必选 | 示例值 | 描述 |
---|---|---|---|---|
Action | String | 是 | DescribeDevices | 操作接口名,系统规定参数。 |
InProtocol | String | 否 | rtmp | 使用的接入协议。 取值: rtmp 虚拟业务组vgroup时,可为空 |
GroupId | String | 是 | 32388487739092994 | 根据设备所属组ID查询。 |
DirId | String | 否 | 897098424844288 | 根据设备所属目录ID查询。 |
DeviceVendor | String | 否 | 海康 | 根据设备厂商查询。 |
DeviceName | String | 否 | 高空抛物摄像头 | 根据设备名称查询。 |
DeviceType | String | 否 | ipc | 根据设备类型查询。 取值: ipc,nvr,platform |
StreamStatus | String | 否 | on | 根据流状态查询。 取值:on(在线), off(离线), failed(失败)。 |
SortBy | String | 否 | CreatedTime | 选择按一个字段排序,可选值为: - DeviceID - CreatedTime - UpdatedTime 默认为CreatedTime,按照创建时间排序。 |
SortDirection | String | 否 | asc | 排序方式,默认升序。 取值:asc(升序), desc(降序)。 |
PageNum | Long | 否 | 1 | 第几个分页,默认为1。 |
PageSize | Long | 否 | 20 | 分页大小,默认为20。 取值范围为1~1000 |
IncludeDeviceStats | Long | 否 | 0 | 是否返回设备统计信息,默认0。 取值:0(不返回), 1(返回) |
3. 返回参数
参数 | 类型 | 描述 |
---|---|---|
PageNum | Long | 第几个分页。 |
PageSize | Long | 分页大小。 |
TotalPage | Long | 分页总数。 |
TotalNum | Long | 设备总数。 |
Devices | Device[] | 设备列表。 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
Device
参数 | 类型 | 描述 |
---|---|---|
DeviceId | String | 设备ID。 |
GroupId | String | 设备所属组ID。 |
ParentDeviceId | String | 上级设备ID,比如摄像头所属的NVR设备ID。 |
DirId | String | 设备所属目录ID。 |
DeviceType | String | 设备类型。 取值: ipc, nvr, platform |
GbVersion | String | 国标版本。 取值: 2011, 2016 |
DeviceVendor | String | 设备厂商。 |
DeviceName | String | 设备名称。 |
Description | String | 设备描述。 |
DeviceIp | String | 设备IP。 |
DevicePort | Long | 设备Port。 |
InProtocol | String | 设备使用的接入协议。 取值: gb28181, rtmp, onvif, rtsp |
UserName | String | 设备用户名,在创建GB28181凭证时生成。 |
UserPassword | String | 设备密码,在创建GB28181凭证时生成。 |
GbId | String | 设备国标ID。 |
PullType | Long | 是否启用自动拉流。 仅gb28181组支持该字段。 取值:1, 2 取值为1,自动拉流,国标设备注册成功后自动启动拉流; 取值为2,按需拉流,需要通过触发的方式启动拉流。 |
TransPriority | String | 设备视频流优先传输协议,默认tcp。 取值:tcp, udp。 取值为tcp,如果设备支持tcp协议传输,设备进行视频邀约时优先使用tcp协议接入到vss服务中。 取值为udp,设备进行视频邀约时优先使用udp协议接入到vss服务中。 |
DeviceEnabled | Long | 设备是否启用。 取值:0(停用), 1(启用) |
DeviceStatus | String | 设备状态。 取值:on(在线), off(离线), new(未注册)。 |
StreamStatus | String | 流状态。 取值:on(在线), off(离线), failed(失败)。 |
SipTransType | String | 信令传输类型。 取值:tcp, udp |
StreamTransType | String | 流传输类型。 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 |
CreateSubDevice | Long | 是否自动创建子设备。 取值:1(自动创建), 2(手动创建) |
DeviceChannels | DeviceChannel[] | nvr设备通道列表。 ipc设备忽略该字段,nvr设备才返回。 |
DeviceStats | DeviceStats | 设备统计信息。 |
DeviceDir | DeviceDir | 设备目录。 |
CreatedTime | String | 设备创建时间。 |
UpdatedTime | String | 设备更新时间。 |
RequestId | String | 唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。 |
RecordStatus | Int | |
RecordTaskId | String | |
GbRegion | String | |
GbRegionLevel | String | |
PushType | Int | |
InType | String | |
PushUrl | String | |
PullUrl | String | |
Tags | String | |
MultiStreamSize | Int | |
AutoStreamNum | Int | |
DeviceModel | String | |
DeviceSn | String | |
DeviceFirmware | String | |
DeviceHardware | String | |
DevicePosition | String | |
DevicePubIp | String | |
DevicePubPort | Int | |
EhomeVersion | String | |
ChannelSize | Int | |
ChannelNum | Int | |
ChannelName | String | |
DeviceStreams | string[] | |
DeviceLongitude | String | |
DeviceLatitude | String | |
DeviceDomain | String | |
EnableDomain | Int |
DeviceChannel
参数 | 类型 | 描述 |
---|---|---|
ChannelNum | Long | 通道号。 |
ChannelName | String | 通道名称。 |
GbId | String | 设备国标ID。 |
DeviceId | String | 设备ID。 |
DeviceStatus | String | 设备状态。 取值:on(在线), off(离线), new(未注册)。 |
StreamStatus | String | 流状态。 取值:on(在线), off(离线), failed(失败)。 |
CreatedTime | String | 子设备(通道)创建时间。 |
UpdatedTime | String | 子设备(通道)更新时间。 |
DeviceStats
参数 | 类型 | 描述 |
---|---|---|
ChannelSize | Long | 通道数量。 |
OnlineChannels | Long | 在线通道数量。 |
OffineChannels | Long | 离线通道数量。 |
OnlineStreams | Long | 在线流数量。 |
OfflineStreams | Long | 离线流数量。 |
FailedStreams | Long | 失败流数量。 |
DeviceDir
参数 | 类型 | 描述 |
---|---|---|
DirId | String | 目录ID。 |
DirName | String | 目录名称。 |
Description | String | 目录描述。 |
GroupId | String | 目录所属组ID。 |
ParentDirId | String | 上级目录ID。 |
CreatedTime | String | 目录创建时间。 |
UpdatedTime | String | 目录修改时间。 |
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. 错误码
ErrorCode | ErrorMessage |
---|---|
本页目录: