批量添加ONVIF设备
更新时间:2022-02-17
接口描述
本接口用于ONVIF探测结束批量添加设备,每次最多添加20个设备。
请求(Request)
请求URI
POST /v1/device/batch
请求头域
除公共头域外,无其它特殊头域。
请求体
公共参数见「创建设备」的请求体参数信息,批量创建为「创建设备」的请求体参数信息组成的list
响应(Response)
响应头域
除公共头域外,无其它特殊头域。
响应体
参数名称 | 类型 | 描述 |
---|---|---|
deviceList | Array | 设备列表 |
+ deviceId | Long | 设备ID |
示例
请求示例
POST /v1/device/batch 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
[
{
"spaceId": 1000001,
"deviceName": "evs_device_name",
"type": "ONVIF",
"description": "evs_device_description",
"onvifConfig": {
"deviceIp":"119.249.51.196",
"devicePort":8883,
"platform": "IPC",
"username":"xxxx",
"password":"xxxx",
"onvifUsername":"xxxx",
"onvifPassword":"xxxx"
}
},
{
"spaceId": 1000001,
"deviceName": "evs_device_name1",
"type": "ONVIF",
"description": "evs_device_description",
"onvifConfig": {
"deviceIp":"119.249.51.197",
"devicePort":8883,
"platform": "IPC",
"username":"xxxx",
"password":"xxxx",
"onvifUsername":"xxxx",
"onvifPassword":"xxxx"
}
}
]
响应示例
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
{
"deviceList":[
{
"deviceId": 1000001
}
]
}
错误码
错误码(code) | 消息(message) | 描述 | HTTP状态码 |
---|---|---|---|
DeviceOperationNotPermitted | device operation not permitted for space is not running, space id : XXX | 当前空间未就绪,不允许创建设备 | 403 |
RequestArgumentIllegal | create device argument illegal | 创建设备的请求参数不合法 | 400 |
DeviceIpAlreadyExist | device ip already exist, device ip : XXX | 创建的ONVIF设备IP已经存在 | 400 |