创建应用
更新时间:2021-06-24
接口描述
本接口用于创建一个AI上层应用,可通过指定应用类型,创建不同的应用。
请求(Request)
请求URL
POST /v1/app
请求头域
除公共头域外,无其它特殊头域。
请求体
参数名称 | 类型 | 是否必需 | 描述 |
---|---|---|---|
name | String | 是 | 应用名称 |
type | String | 是 | 应用类型 |
spaceInfo | Array | 是 | 关联空间ID列表,支持多个 |
databaseInfo | Array | 是 | 关联人脸库ID列表,支持多个,当type为003时此项为空 |
configuration | Object | 是 | 配置信息 |
+ interval | Long | 是 | 截帧频率,单位:毫秒 |
+ effectiveTimes | Array | 否 | 检测生效时段,支持多个;输入东八区时间,从00:00:00开始,到23:59:59结束,每段间隔最小半小时 |
++ effectiveTimeStart | String | 是 | 检测生效开始时间,格式"HH:mm:ss" |
++ effectiveTimeEnd | String | 是 | 检测生效结束时间,格式"HH:mm:ss" |
+ lifecycle | Long | 是 | 存储周期,支持1-500天 |
+ confidence | Float | 是 | 置信度,支持0-1浮点数,精度2位 |
+ callback | Object | 否 | 通知配置,当type为003时不可设置通知 |
++ enabled | Boolean | 是 | 是否开启通知 |
++ endpoint | String | 是 | 回调地址,开启时必填;支持http/https,https需用户自己检测域名证书链配置是否正确 |
++ authEnabled | Boolean | 否 | 回调是否添加签名信息,默认不加验证即false |
++ key | String | 否 | 回调签名key,用于计算token |
响应(Response)
响应头域
除公共头域外,无其它特殊头域。
响应体
参数名称 | 类型 | 描述 |
---|---|---|
appId | String | 应用ID |
示例
请求示例
Plain Text
1POST /v1/app 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 "name": "海淀区海淀中学附近人员布控",
9 "type": "001",
10 "spaceInfo": [
11 1000101,
12 1000102
13 ],
14 "databaseInfo": [
15 "dbf-mark0ig2eaibsqyd",
16 "dbf-marjxygzy884hyrq"
17 ],
18 "configuration": {
19 "interval": "1000",
20 "effectiveTimes": [
21 {
22 "effectiveTimeStart": "06:00:00",
23 "effectiveTimeEnd": "09:00:00"
24 },
25 {
26 "effectiveTimeStart": "11:00:00",
27 "effectiveTimeEnd": "15:00:00"
28 },
29 {
30 "effectiveTimeStart": "16:00:00",
31 "effectiveTimeEnd": "19:00:00"
32 }
33 ],
34 "lifecycle": 7,
35 "confidence": 0.85,
36 "callback": {
37 "enabled": true,
38 "endpoint": "http://user.service/callback"
39 }
40 }
41}
响应示例
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
8
9{
10 "appId": "app-bbvtiuevh52imw4a"
11}
错误码
错误码(code) | 消息(message) | 描述 | HTTP状态码 |
---|---|---|---|
DuplicateAppName | duplicate app name : XXX | 重复的应用程序名称 | 403 |
AppCountOverQuota | the number of app exceed system quota | 应用程序数超过系统配额 | 403 |
参考公共错误码