修改设备配置
更新时间:2023-03-31
接口描述
本接口用于修改EVS设备配置。
请求(Request)
请求URI
PUT /v1/device/{deviceId}
参数名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
deviceId | Long | 是 | 设备ID |
请求头域
除公共头域外,无其它特殊头域。
请求体
参数名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
deviceName | String | 否 | 设备名称,最大长度256个字符 |
deviceStreamId | String | 否 | 当type=RTMP时必填;该字段即app/stream的拼接,最大长度256个字符 |
description | String | 否 | 设备描述,最大长度512个字符 |
recording | Object | 否 | 录制配置 |
+ sameAsSpace | Boolean | 否 | 是否和空间一致,为true时表示和空间保持一致 |
+ enabled | Object | 否 | 是否开启录制 |
+ bucket | String | 否 | 边缘存储bucket |
+ duration | Integer | 否 | 录制单文件时长,单位:秒 |
+ format | String | 否 | 存储格式,可选:MP4、FLV、M3U8 |
+ authEnabled | Boolean | 是 | 录制文件下载地址是否开启鉴权 |
+ authExpire | Integer | 否 | 鉴权URL有效时间,单位:秒 |
thumbnail | Object | 否 | 截图配置 |
+ enabled | Boolean | 是 | 是否开启截图 |
+ bucket | String | 否 | 边缘存储bucket |
+ interval | Integer | 否 | 截图周期,单位:秒 |
+ authEnabled | Boolean | 是 | 截图文件下载地址是否开启鉴权 |
+ authExpire | Integer | 否 | 鉴权URL有效时间,单位:秒 |
gis | Object | 否 | 地理位置配置,当「人员轨迹分析」应用绑定此空间设备时,要求空间下所有设备已设置gis信息 |
+ longitude | Float | 是 | 经度,范围[-180, 180] |
+ latitude | Float | 是 | 经度,范围[-90, 90] |
+ name | String | 是 | 地理位置名称 |
gbProperties | Object | 否 | 协议配置 |
+ sameAsSpace | Boolean | 否 | 是否和空间一致,为true时表示和空间保持一致 |
+ streamType | String | 是 | 流类型。可选值:TCP,UDP, bvcp空间只支持TCP |
+ codeStream | String | 否 | 码流类型。可选值:MAIN_STREAM,SUB_STREAM, 只有BVCP空间TD_3116B2_16P型号可支持 |
jtProperties | Object | 否 | 部标配置 |
+ heartbeatCycle | Integer | 否 | 心跳周期,范围[1, 3600],单位:秒 |
clientSiteBase | Object | 否 | 基础端侧配置,bvcp设备配置 |
+ sameAsSpace | Boolean | 否 | 是否和空间一致,为true时表示和空间保持一致 |
+ preTime | Integer | 是 | 预录时间 0/3/6,单位:秒 |
+ stream | String | 是 | 录制码流,默认MAIN,可选值:MAIN/SUB |
clientSiteRecording | Object | 否 | 录制端侧配置,bvcp设备配置 |
+ sameAsSpace | Boolean | 否 | 是否和空间一致,为true时表示和空间保持一致 |
+ enabled | Boolean | 是 | 是否开启录制 |
+ type | String | 否 | 录制类型,默认TIMING,可选值:TIMING/MOTION |
+ effectiveTimes | Array | 是 | 录制时段,最多设置10段 |
++ effectiveTimeStart | String | 是 | 录制开始时间,格式"HH: mm" |
++ effectiveTimeEnd | String | 是 | 录制结束时间,格式"HH: mm" |
+ motionConfig | Object | 否 | 动检录制配置, 录制类型为MOTION时配置 |
++ sensitivity | Integer | 是 | 灵敏度 0-8 |
++ area | Array(Array) | 是 | 生效区域,18x22二维数组,表示22列,18行,选中为1,未选为0 |
clientSiteThumbnail | Object | 否 | 截图端侧配置,bvcp设备配置 |
+ sameAsSpace | Boolean | 否 | 是否和空间一致,为true时表示和空间保持一致 |
+ enabled | Boolean | 是 | 是否开启截图配置 |
+ interval | Integer | 是 | 截图间隔,单位:秒,最大3600秒 |
clientSiteAi | Object | 否 | AI端侧配置,bvcp设备配置 |
+ sameAsSpace | Boolean | 否 | 是否和空间一致,为true时表示和空间保持一致 |
+ enabled | Boolean | 是 | 是否开启AI配置 |
+ configuration | Array | 否 | AI配置列表 |
++ type | String | 是 | AI检测类型,ELECTRIC_ELEVATOR |
++ target | Array | 是 | 检测对象 |
+++ targetType | String | 是 | 检测对象类型,可选值:MOTOR, ELE_MOTOR, ELE_BICYCLE, BICYCLE, CHILD_BICYCLE, WHEELBARROW, SCOOTER, ELE_SCOOTER, HUMAN_BODY, ELE_TRICYCLE |
+++ confidence | Float | 是 | 置信度,0-1 |
++ effectiveTimes | Array | 是 | 检测生效时段,支持多个;输入东八区时间,从00:00开始,到23:59结束,每段间隔最小半小时 |
+++ effectiveTimeStart | String | 是 | 检测生效开始时间,格式"HH: mm" |
+++ effectiveTimeEnd | String | 是 | 检测生效结束时间,格式"HH: mm" |
++ alarmOut | Object | 否 | 报警方式 |
+++ whiteLight | Boolean | 是 | 闪光报警 |
+++ trigger | Boolean | 是 | 阻梯信号报警 |
+++ audio | Boolean | 是 | 声音报警 |
+++ audioConfig | Object | 否 | 声音报警配置 |
++++ alarmName | String | 是 | 警戒声音名称,最大长度128字符 |
++++ audioId | String | 否 | 警戒音id, 自定义警戒音传 |
++++ times | Integer | 是 | 报警次数,最大50次 |
++ area | Array | 否 | 生效区域,闭合多边形的边集合,不选默认下三分之二区域 |
+++ startPointX | Integer | 是 | 线段起始点x坐标, 比例值x10000, 如5000表示50% |
+++ startPointY | Integer | 是 | 线段起始点y坐标, 比例值x10000 |
+++ endPointX | Integer | 是 | 线段终止点x坐标, 比例值x10000 |
+++ endPointY | Integer | 是 | 线段终止点y坐标, 比例值x10000 |
++ event | Object | 否 | 触发事件 |
+++ recordEvent | Object | 否 | 触发事件录像 |
++++ enabled | Boolean | 是 | 是否开启触发事件录像 |
+++ thumbnailEvent | Object | 否 | 触发事件抓图 |
++++ enabled | Boolean | 是 | 是否开启触发事件抓图 |
clientSiteVideo | Object | 否 | 视频端侧配置,bvcp设备配置 |
+ sameAsSpace | Boolean | 否 | 是否和空间一致,为true时表示和空间保持一致 |
+ streamConfigs | Array | 是 | 码流配置 |
++ streamType | String | 是 | 码流类型,主码流:MAIN,子码流:SUB |
++ streamName | String | 是 | 码流名称,最大长度32字符 |
++ resolution | String | 是 | 分辨率,可选值:2592x1520, 2560x1440, 2304x1296, 1920x1080, 1280x720, 704x576, 480x240, 352x288 |
++ maxBitRate | Integer | 是 | 码率,可选值:8192, 6144, 4096, 3072, 2048, 1024, 768, 512, 256, 128 |
++ encodeType | String | 是 | 视频编码,可选值:h264, h265 |
clientSiteOSD | Object | 否 | On-screen Display 菜单端侧配置,bvcp设备配置 |
+ sameAsSpace | Boolean | 否 | 是否和空间一致,为true时表示和空间保持一致 |
+ time | Object | 否 | 时间戳配置 |
++ dateFormat | String | 是 | 时间格式,可选值:YYYY-MM-DD/MM-DD-YYYY/DD-MM-YYYY |
++ x | Integer | 是 | 水印x坐标, 比例值x10000, 如5000表示50% |
++ y | Integer | 是 | 水印y坐标, 比例值x10000 |
+ channelName | Object | 否 | 设备名称配置 |
++ name | String | 是 | 设备名称,最大长度18字符 |
++ x | Integer | 是 | 水印x坐标, 比例值x10000 |
++ y | Integer | 是 | 水印y坐标, 比例值x10000 |
+ customs | Array | 否 | 自定义水印 |
++ value | String | 是 | 水印内容,如有两行使用"\r\n"间隔,最大长度15字符 |
++ x | Integer | 是 | 水印x坐标, 比例值x10000 |
++ y | Integer | 是 | 水印y坐标, 比例值x10000 |
响应(Response)
响应头域
除公共头域外,无其它特殊头域。
响应体
无。
示例
请求示例
- rtmp/Gb28181设备
PUT /v1/device/1000001 HTTP/1.1
x-bce-date: 2020-03-25T09:28:13Z
host: evs.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2020-03-25T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
{
"deviceName": "evs_device_name",
"description": "evs_device_description",
"recording": {
"sameAsSpace": true
},
"thumbnail": {
"enabled": true,
"bucket": "evs_bucket",
"interval": 10,
"authEnabled": true,
"authExpire": 3600
}
}
- bvcp设备
PUT /v1/device/1000001 HTTP/1.1
x-bce-date: 2020-03-25T09:28:13Z
host: evs.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2020-03-25T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
{
"deviceName": "evs_device_name",
"clientSiteRecording":{
"sameAsSpace":false,
"enabled":true,
"type":"MOTION",
"effectiveTimes":[
{
"effectiveTimeStart":"00:00",
"effectiveTimeEnd":"01:00"
},
{
"effectiveTimeStart":"13:00",
"effectiveTimeEnd":"14:45"
}
],
"motionConfig":{
"sensitivity":6,
"area":[
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
]
}
},
"clientSiteAi":{
"sameAsSpace":false,
"enabled":true,
"configuration":[
{
"type":"ELECTRIC_ELEVATOR",
"target":[
{
"targetType":"MOTOR",
"confidence":0.6
},
{
"targetType":"ELE_BICYCLE",
"confidence":0.7
}
],
"effectiveTimes":[
{
"effectiveTimeStart":"12:00",
"effectiveTimeEnd":"12:30"
}
],
"alarmOut":{
"audio":true,
"whiteLight":true,
"trigger":true,
"audioConfig":{
"alarmName":"警戒区",
"times":3
}
},
"event":{
"recordEvent":{
"enabled":true,
"recordCallback":false
},
"thumbnailEvent":{
"enabled":true
}
}
"area":[
{
"startPointX":414,
"startPointY":819,
"endPointX":9085,
"endPointY":819
},
{
"startPointX":9085,
"startPointY":819,
"endPointX":9085,
"endPointY":9180
},
{
"startPointX":9085,
"startPointY":9180,
"endPointX":414,
"endPointY":9180
},
{
"startPointX":414,
"startPointY":9180,
"endPointX":414,
"endPointY":819
}
]
}
]
}
}
- JT808设备
PUT /v1/device/1000001 HTTP/1.1
x-bce-date: 2020-03-25T09:28:13Z
host: evs.bj.baidubce.com
content-type: application/json
authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2020-03-25T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
{
"deviceName": "evs_device_name",
"description": "evs_device_description",
"jtProperties":{
"heartbeatCycle": 10
}
}
响应示例
HTTP/1.1 200 OK
Transfer-Encoding: chunked
x-bce-request-id: 012b9747-f13a-4a2c-a488-02b221844dca
Cache-Control: no-cache
Server: BWS
Date: Tue, 24 Mar 202 013:34:07 GMT
Content-Type: application/json;charset=UTF-8
错误码
错误码(code) | 消息(message) | 描述 | HTTP状态码 |
---|---|---|---|
DeviceOperationNotPermitted | device operation not permitted for space is not running, space id : XXX | 当前空间未就绪,不允许创建设备 | 403 |
DeviceAlreadyExist | device already exist, device name : XXX | 更新的设备名称已经存在 | 400 |
RequestArgumentIllegal | update device argument illegal | 更新设备的请求参数不合法 | 400 |
BvcpOperationNotPermitted | update client config not permitted for device status : XXX | 当前设备状态不允许更新端侧配置 | 403 |
ClientConfigFail | client config fail for XXX, deviceId : XXX | 下发端侧配置失败 | 403 |
ClientException | set client config fail, IPC error, gbDeviceId: XXX, serialId: XXX | 下发配置时端侧设备异常 | 403 |