修改设备配置
更新时间: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设备
Plain Text
1PUT /v1/device/1000001 HTTP/1.1
2x-bce-date: 2020-03-25T09:28:13Z
3host: evs.bj.baidubce.com
4content-type: application/json
5authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2020-03-25T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
6
7{
8 "deviceName": "evs_device_name",
9 "description": "evs_device_description",
10 "recording": {
11 "sameAsSpace": true
12 },
13 "thumbnail": {
14 "enabled": true,
15 "bucket": "evs_bucket",
16 "interval": 10,
17 "authEnabled": true,
18 "authExpire": 3600
19 }
20}
- bvcp设备
Plain Text
1PUT /v1/device/1000001 HTTP/1.1
2x-bce-date: 2020-03-25T09:28:13Z
3host: evs.bj.baidubce.com
4content-type: application/json
5authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2020-03-25T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
6
7{
8 "deviceName": "evs_device_name",
9 "clientSiteRecording":{
10 "sameAsSpace":false,
11 "enabled":true,
12 "type":"MOTION",
13 "effectiveTimes":[
14 {
15 "effectiveTimeStart":"00:00",
16 "effectiveTimeEnd":"01:00"
17 },
18 {
19 "effectiveTimeStart":"13:00",
20 "effectiveTimeEnd":"14:45"
21 }
22 ],
23 "motionConfig":{
24 "sensitivity":6,
25 "area":[
26 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
27 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
28 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
29 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
30 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
31 [0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
32 [0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
33 [0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
34 [0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
35 [0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0],
36 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
37 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
38 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
39 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
40 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
41 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
42 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],
43 [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
44 ]
45 }
46 },
47 "clientSiteAi":{
48 "sameAsSpace":false,
49 "enabled":true,
50 "configuration":[
51 {
52 "type":"ELECTRIC_ELEVATOR",
53 "target":[
54 {
55 "targetType":"MOTOR",
56 "confidence":0.6
57 },
58 {
59 "targetType":"ELE_BICYCLE",
60 "confidence":0.7
61 }
62 ],
63 "effectiveTimes":[
64 {
65 "effectiveTimeStart":"12:00",
66 "effectiveTimeEnd":"12:30"
67 }
68 ],
69 "alarmOut":{
70 "audio":true,
71 "whiteLight":true,
72 "trigger":true,
73 "audioConfig":{
74 "alarmName":"警戒区",
75 "times":3
76 }
77 },
78 "event":{
79 "recordEvent":{
80 "enabled":true,
81 "recordCallback":false
82 },
83 "thumbnailEvent":{
84 "enabled":true
85 }
86 }
87 "area":[
88 {
89 "startPointX":414,
90 "startPointY":819,
91 "endPointX":9085,
92 "endPointY":819
93 },
94 {
95 "startPointX":9085,
96 "startPointY":819,
97 "endPointX":9085,
98 "endPointY":9180
99 },
100 {
101 "startPointX":9085,
102 "startPointY":9180,
103 "endPointX":414,
104 "endPointY":9180
105 },
106 {
107 "startPointX":414,
108 "startPointY":9180,
109 "endPointX":414,
110 "endPointY":819
111 }
112 ]
113 }
114 ]
115 }
116}
- JT808设备
Plain Text
1PUT /v1/device/1000001 HTTP/1.1
2x-bce-date: 2020-03-25T09:28:13Z
3host: evs.bj.baidubce.com
4content-type: application/json
5authorization: bce-auth-v1/e8e4a9ced6794355a9a1b8a20b58d37b/2020-03-25T09:28:13Z/1800/content-type;host;x-date/4a1692dc4bab84f5801f79ea0c1fece3601cf73ecd94409d2a94b3942b971715
6
7{
8 "deviceName": "evs_device_name",
9 "description": "evs_device_description",
10 "jtProperties":{
11 "heartbeatCycle": 10
12 }
13 }
响应示例
Plain Text
1HTTP/1.1 200 OK
2Transfer-Encoding: chunked
3x-bce-request-id: 012b9747-f13a-4a2c-a488-02b221844dca
4Cache-Control: no-cache
5Server: BWS
6Date: Tue, 24 Mar 202 013:34:07 GMT
7Content-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 |