查询设备

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

1. 接口描述

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

查询设备信息。

2. 请求参数

参数类型是否必选示例值描述
ActionStringDescribeDevice操作接口名,系统规定参数。
InProtocolStringgb28181使用的接入协议。
取值: gb28181
DeviceIdString32388487739092996设备 ID。
SerialNumberString123xxx设备 SN 码(DeviceId 和 SerialNumber 二选一)。
IncludeDeviceStatsLong0是否返回设备统计信息,默认 0。
取值:0(不返回), 1(返回)
根据设备 id 查询时可使用此参数。
IncludeDeviceDirLong0是否返回目录信息,默认 0。
取值:0(不返回), 1(返回)
根据设备 id 查询时可使用此参数。
RealGroupIdString672386441693560832设备真实业务组 ID(兼容 vgroup 协议)。

3. 返回参数

参数类型描述
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 设备忽略该字段。
DeviceStatsDeviceStats设备统计信息。
DeviceDirDeviceDir设备目录。
SerialNumberString设备 SN 码。
DeviceModelString设备型号。
CreatedTimeString设备创建时间。
UpdatedTimeString设备更新时间。
RequestIdString唯一请求 ID,每次请求都会返回。定位问题时需要提供该次请求的 RequestId。
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是否启用域名。
RecordMessageString录制信息。
IndustryCodeString设备行业编码。
NetworkCodeString设备的网络标识。
TypeString类型。

DeviceChannel

参数类型描述
ChannelNumLong通道号。
ChannelNameString通道名称。
GbIdString设备国标 ID。
DeviceIdString设备 ID。
DeviceStatusString设备状态。
取值:on(在线), off(离线), new(未注册)。
StreamStatusString流状态。
取值:on(在线), off(离线), failed(失败)。
CreatedTimeString子设备(通道)创建时间。
UpdatedTimeString子设备(通道)更新时间。
RecordStatusLong录制状态。
RecordTaskIdString录制任务 ID。
InTypeString视频流接入方式。
MultiStreamSizeLong主子码流数量。
AutoStreamNumLong自动拉取第几个码流。
ParentDeviceIdString父设备 id
CreateSubDeviceLong是否自动创建子设备。
DeviceVendorString设备厂商。
DeviceStreamsDeviceStream[]设备视频流信息。
RecordMessageString录制信息。

DeviceStream

参数类型描述
StreamNumLong视频流编号。
StreamStatusString视频流状态。

DeviceStats

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

DeviceDir

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

4. 示例

4.1 请求示例

https://vssapi.ctyun.cn/
?Action=DescribeDevice
&InProtocol=gb28181
&DeviceId=568037376560250882
&Version=2020-06-12
&AccessKeyId=O0G0BPBI2T9YUD3U****
&Signature=OMq1XDhZGNLkkkGl6VjMzADgk4w%3D
&SignatureMethod=HMAC-SHA1
&SignatureNonce=174345971
&SignatureVersion=1.0
&Timestamp=1599108494

4.2 返回示例

{
  "DeviceId": "568037376560250882",
  "GroupId": "568037376560250880",
  "ParentDeviceId": "-1",
  "DirId": "-1",
  "DeviceType": "ipc",
  "DeviceVendor": "海康",
  "DeviceName": "createds",
  "Description": "xxx路口摄像头",
  "DeviceIp": "",
  "DevicePort": 0,
  "InProtocol": "gb28181",
  "UserName": "creategnhsta",
  "UserPassword": "Cert123@",
  "GbId": "51030300101327015065",
  "PullType": 1,
  "TransPriority": "tcp",
  "DeviceEnabled": 0,
  "DeviceStatus": "new",
  "StreamStatus": "",
  "SipTransType": "",
  "StreamTransType": "",
  "CreateSubDevice": -1,
  "GbVersion": "2016",
  "DeviceChannels": [],
  "DeviceStats": null,
  "DeviceDir": null,
  "CreatedTime": "2022-10-06 19:44:29",
  "UpdatedTime": "2022-10-06 19:44:30",
  "RequestId": "009ead555ddb405494189f0d4f7ec1c4",
  "RecordStatus": 0,
  "RecordTaskId": "",
  "GbRegion": "51030300",
  "GbRegionLevel": "3",
  "PushType": 0,
  "InType": "",
  "PushUrl": "",
  "PullUrl": "",
  "Tags": "",
  "MultiStreamSize": 0,
  "AutoStreamNum": 0,
  "DeviceModel": "",
  "DeviceSn": "",
  "DeviceFirmware": "",
  "DeviceHardware": "",
  "DevicePosition": "",
  "DevicePubIp": "",
  "DevicePubPort": 0,
  "EhomeVersion": "",
  "ChannelSize": 0,
  "ChannelNum": 0,
  "ChannelName": "",
  "DeviceStreams": [],
  "DeviceLongitude": "0",
  "DeviceLatitude": "0",
  "DeviceDomain": "",
  "EnableDomain": 0,
  "IndustryCode": "10",
  "NetworkCode": "7",
  "RecordMessage": "",
  "errorCode": "",
  "errorMessage": "",
  "bitrate": 0,
  "MacAddr": "",
  "PoleId": "",
  "GbRegionNames": ["贡井区", "自贡市", "四川省"],
  "SerialNumber": ""
}

5. 错误码

ErrorCodeErrorMessage