华为云用户手册

  • 返回值 正常 边缘作业的删除是异步删除,返回202。 异常 返回值 说明 400 Bad Request 请求错误,具体返回错误码请参考错误码。 401 Unauthorized 鉴权失败。 403 Forbidden 没有操作权限。 404 Not Found 找不到资源。 500 Internal Server Error 服务内部错误。 503 Service Unavailable 服务不可用。
  • 响应消息 删除失败时的响应示例 { "error_code": "IVA.0004", "error_msg": "The request param is invalid. parameter [task_id] does not match ^[0-9a-f]{32}|task\\w{8}$."} 响应参数说明 参数名称 描述信息 error_code 错误码。 error_msg 错误信息。
  • 响应消息 删除失败时的响应示例 { "error_code": "IVA.0004", "error_msg": "The request param is invalid. parameter [task_id] does not match ^[0-9a-f]{32}|task\\w{8}$."} 响应参数说明 参数名称 描述信息 error_code 错误码。 error_msg 错误信息。
  • 返回值 正常 云上作业的删除是异步删除,返回202。 异常 返回值 说明 400 Bad Request 请求错误,具体返回错误码请参考错误码。 401 Unauthorized 鉴权失败。 403 Forbidden 没有操作权限。 404 Not Found 找不到资源。 500 Internal Server Error 服务内部错误 503 Service Unavailable 服务不可用。
  • 响应消息 删除失败时的响应示例 { "error_code": "IVA.0004", "error_msg": "The request param is invalid. parameter [task_id] does not match ^[0-9a-f]{32}|task\\w{8}$."} 响应参数说明 参数名称 描述信息 error_code 错误码。 error_msg 错误信息。
  • 返回值 正常 边缘作业的删除是异步删除,返回202。 异常 返回值 说明 400 Bad Request 请求错误,具体返回错误码请参考错误码。 401 Unauthorized 鉴权失败。 403 Forbidden 没有操作权限。 404 Not Found 找不到资源。 500 Internal Server Error 服务内部错误。 503 Service Unavailable 服务不可用。
  • 响应消息 删除失败时的响应示例 { "error_code": "IVA.0004", "error_msg": "The request param is invalid. parameter [task_id] does not match ^[0-9a-f]{32}|task\\w{8}$."} 响应参数说明 参数名称 描述信息 error_code 错误码。 error_msg 错误信息。
  • 返回值 正常 边缘作业的删除是异步删除,返回202。 异常 返回值 说明 400 Bad Request 请求错误,具体返回错误码请参考错误码。 401 Unauthorized 鉴权失败。 403 Forbidden 没有操作权限。 404 Not Found 找不到资源。 500 Internal Server Error 服务内部错误。 503 Service Unavailable 服务不可用。
  • 响应消息 删除失败时的响应示例 { "error_code": "IVA.0004", "error_msg": "The request param is invalid. parameter [task_id] does not match ^[0-9a-f]{32}|task\\w{8}$."} 响应参数说明 参数名称 描述信息 error_code 错误码。 error_msg 错误信息。
  • 响应 响应样例(VIS输入+DIS输出) { "id": "3d7c81cf35784d88a4e26066bcc5debd", "name": "safetysuitedetection-cloud-task", "creator": "user_test", "project_id": "1f793beac00d4801874db741cbfe10fa", "description": null, "service_version": "3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at": "2020-09-22T07:37:03Z", "updated_at": "2020-09-22T07:37:03Z", "state": "RUNNING", "input": { "type": "vis", "data": [ { "stream_name": "vis-campusgo", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-campusgo" } }, "service_config": { "common": { "hat_detection_sw": 0, "cloth_detection_sw": 1, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } }} 响应参数说明 参数名称 字段类型 描述信息 task Object task详情,定义见 Task参数结构说明。
  • 返回值 正常 云上作业的删除是异步删除,返回202。 异常 返回值 说明 400 Bad Request 请求错误,具体返回错误码请参考错误码。 401 Unauthorized 鉴权失败。 403 Forbidden 没有操作权限。 404 Not Found 找不到资源。 500 Internal Server Error 服务内部错误 503 Service Unavailable 服务不可用。
  • 响应 响应样例(VIS输入+DIS输出) { "id":"5c127c7844674d2382b7daae07794152", "name":"c-highpoint-crowdcount-cloud-test", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"c-highpoint-crowdcount-cloud task test", "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-22T08:08:39Z", "updated_at":"2020-09-22T08:08:39Z", "state":"PENDING", "input":{ "type":"vis", "data":[ { "stream_name":"intrusiondetectio", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-intrusion" } }, "service_config":{ "common":{ "image_compression_ratio": 90, "roadside_stall_detect_sw": 1, "outstore_stall _detect_sw": 0, "render_roi_sw": 1, "render_result_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}" } }} 响应参数说明 参数名称 字段类型 描述信息 task Object task详情,定义见 Task参数结构说明。
  • 响应消息体 响应消息体通常以结构化格式返回,与响应消息头中Content-type对应,传递除响应消息头之外的内容。 对于获取用户Token接口,返回如下消息体。为篇幅起见,这里只展示部分内容。 { "token": { "expires_at": "2019-02-13T06:52:13.855000Z", "methods": [ "password" ], "catalog": [ { "endpoints": [ { "region_id": "cn-north-1",...... 当接口调用出错时,可根据返回的错误码及错误信息说明进行问题定位,如下所示。 { "error_msg": "The API does not exist or has not been publish in the environment", "error_code": "IVA.0101", "request_id": "8ec47b9ec686af9976bed342d5cd5e06"} 其中,error_code表示错误码,error_msg表示错误描述信息,具体请参见错误码。
  • 返回值 正常 云上作业的删除是异步删除,返回204。 异常 返回值 说明 400 Bad Request 请求错误,具体返回错误码请参考错误码。 401 Unauthorized 鉴权失败。 403 Forbidden 没有操作权限。 404 Not Found 找不到资源。 500 Internal Server Error 服务内部错误。 503 Service Unavailable 服务不可用。
  • 响应消息头 对应请求消息头,响应同样也有消息头,如“Content-type”。 表1 公共响应消息头 消息头名称 描述 是否必选 Content-Type 用于指明发送给接收者的实体正文的媒体类型。 类型:字符串。 默认值:application/json; charset=UTF-8 是 X-request-id 此字段携带请求ID号,以便任务跟踪。 类型:字符串。request_id-timestamp-hostname(request_id在服务器端生成UUID, timestamp为当前时间戳,hostname为处理当前接口的服务器名称)。 默认值:无。 否 X-ratelimit 此字段携带总计流控请求数。 类型:整型。 默认值:无。 否 X-ratelimit-used 此字段携带剩下请求数。 类型:整型。 默认值:无。 否 X-ratelimit-window 此字段携带流控单位。 类型:字符串。单位按照分钟、小时、天。 默认值:小时。 否 对于获取用户Token接口,返回如下图所示的消息头。 其中“x-subject-token”就是需要获取的用户Token。有了Token之后,您就可以使用Token认证调用其他API。 图1 获取用户Token响应消息头
  • 响应消息 删除失败时的响应示例 { "error_code": "IVA.0004", "error_msg": "The request param is invalid. parameter [task_id] does not match ^[0-9a-f]{32}|task\\w{8}$."} 响应参数说明 参数名称 描述信息 error_code 错误码。 error_msg 错误信息。
  • 请求 请求样例(VIS输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-staffonduty-cloud/tasks{ "name":"staffonduty_cloud_0", "description":"staffonduty task test", "input":{ "type":"vis", "data":[ { "stream_name":"staffonduty", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-staffonduty" } }, "service_version":"3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "service_config":{ "common":{ "target_roi":"{\"polygons\":[{\"data\":[[484,465],[1850,450],[1905,1013],[515,1050]]},{\"data\":[[484,125],[1800,125],[1800,677],[495,677]]}]}", "image_compression_ratio":90, "key_region_detection_sw":1, "key_region_detect_interval":2, "key_region_detect_threshold":2, "key_region_person_count":50 } }} 参数说明 参数 是否必选 类型 说明 name 是 String 作业名称,只能由中文、字母(a~zA~Z)、数字(0~9)、中划线(-)、下划线(_)组成,长度范围为[1,100]。 description 否 String 作业描述信息,最大长度为500字符长度。 input 是 Object 视频数据输入列表,目前云上关键岗位检测支持以下输入类型: vis:从 视频接入服务 中读取视频数据。 详细参数定义参见task.input(任务输入参数)。 service_version 是 String 功能版本号,版本号为3.0。 resource_order_id 是 String 购买的算法能力包ID,在服务界面购买算法能力包获取。 output service_config 是 否 Object Object 结果数据的输出列表,目前支持将结果输出到您指定的通道中,输出类型为“dis”。 详细参数定义参见task.output(任务输出参数)。 服务的算法配置,配置参数见ServiceConfig参数说明。 service_config参数结构说明 参数 是否必选 类型 说明 key_region_detection_sw 否 Int 对应控制台的界面参数“关键岗位检测开关”。 是否开启关键岗位检测告警,取值范围: 0:表示不开启 1:表示开启 默认值为1。 key_region_person_count 否 Int 对应控制台的界面参数“在岗最小人数”。 关键岗位检测区域的最少人数,取值范围为[1, 100],默认值为2。该参数只对同级列表中的输入生效。 key_region_detect_interval 否 Int 对应控制台的界面参数“检测周期”。 关键区域检测周期,单位为秒。取值范围为[1, 3600],默认值为1。当时间到达检测周期整数倍时,触发算法检测在岗人数。 key_region_detect_threshold 否 Int 对应控制台的界面参数“告警触发阈值”。 告警触发阈值,单位为检测周期个数。取值范围为[1, 3600],默认值为60。假设告警触发阈值为N,当连续N个检测周期时间内检测结果都不满足最小在岗人数,则触发告警。触发告警或满足在岗人数则重新开始计数,直到再次达到告警阈值。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 取值范围[20,100],默认值:90,表示图片压缩比90%。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]} 参数没有携带时,默认区域为整个视频帧中间的1/4。 当区域的坐标值全为0时,区域默认位置如图1 区域默认位置所示,其中Wframe为帧宽度,Hframe为帧高度。 图1 区域默认位置 默认区域为矩形,假设矩形的四个端点分别为point_1、point_2、point_3、point_4,其位置默认为: poin_1=(¼Wframe, ¼Hframe) poin_2=(¾Wframe, ¼Hframe) poin_3=(¼Wframe, ¾Hframe) poin_4=(¾Wframe, ¾Hframe)
  • 响应 响应样例 { "id":"a29dfa1bfcdd4a62b3f6048fe6965e8b", "name":"fightingdetection_edge_task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"fighting detection task test", "service_version":"3.0", "edge_pool_id":"8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-21T12:57:12Z", "updated_at":"2020-09-21T12:57:12Z", "state":"PENDING", "input":{ "type":"edgecamera", "data":[ { "id":"aec5857c-222f-4aa9-be39-23654e118886", "index":0 } ] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_config":{ "common":{ "render_result_sw":1, "image_compression_ratio":90, "render_roi_sw": 1, "target_roi": "{"polygons":[{"data":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}" } }} 响应参数说明 参数名称 字段类型 描述信息 task Object task详情,定义见Task参数结构说明。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-urban-trash-detect-edge/tasks{ "name": "c-urban-trash-detect-edge-task", "description": "c-urban-trash-detect-edge test", "input": { "type": "edgecamera", "data": [ { "id": "25292206-995f-4c31-bfd5-b0dd7bc389e7", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-suxinxing" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "image_compression_ratio": 90, "trash_detect_sw": 1, "person_constraint_sw": 0, "min_trash_size": 1, "render_roi_sw": 1, "render_result_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } }} 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-urban-trash-detect-edge/tasks{ "name": "c-urban-trash-detect-edge-task", "description": "c-urban-trash-detect-edge test", "input": { "type": "edgerestful", "data": [ { "index": 0, "url":"https://100.127.134.69:554/test/data", "certificate_check": false, "rtsp_path_in_response": "data/url" } ] }, "output": { "dis": { "stream_name": "dis-suxinxing" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "image_compression_ratio": 90, "trash_detect_sw": 1, "person_constraint_sw": 0, "min_trash_size": 1, "render_roi_sw": 1, "render_result_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } }} 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-urban-trash-detect-edge/tasks{ "name": "c-urban-trash-detect-edge-task", "description": "c-urban-trash-detect-edge test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type":1 } ] }, "output": { "dis": { "stream_name": "dis-suxinxing" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "image_compression_ratio": 90, "trash_detect_sw": 1, "person_constraint_sw": 0, "min_trash_size": 1, "render_roi_sw": 1, "render_result_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } }} 参数说明 参数 是否必选 类型 说明 name 是 String 作业名称,只能由中文、字母(a~zA~Z)、数字(0~9)、中划线(-)、下划线(_)组成,长度范围为[1,100]。 description 否 String 作业描述信息,最大长度为500字符长度。 input 是 Object 视频数据输入列表,支持从指定的边缘摄像头读取数据,即输入类型为“edgecamera”,“edgerestful”,“VCN”。 详细参数定义参见task.input(任务输入参数)。 service_version 是 String 功能版本号,版本号为3.0。边缘算法版本支持的显卡硬件为T4和华为自研Davinci芯片。 resource_order_id 是 String 购买的算法能力包ID,在服务界面购买算法能力包获取。 edge_pool_id 是 String 边缘运行池ID,获取方法参见创建边缘运行池。 output 是 Object 结果数据的输出列表,目前支持以下输出类型: DIS:将结果输出到您指定的DIS通道 。 Webhook:将结果输出到Webhook URL。 Localpath:将作业的运行结果保存在边缘节点本地(节点必须为linux系统),必须为linux路径,例如“/opt/cloud/”。 详细参数定义见task.output(任务输出参数)。 service_config 否 Object 服务的算法配置,配置参数见ServiceConfig参数说明。 service_config中common参数说明 字段 是否必选 类型 说明 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 trash_detect_sw 否 Int 对应控制台的界面参数“垃圾检测开关”。 "1":表示检测垃圾; "2":表示检测垃圾并检测疑似丢垃圾的人。 默认值为1。 person_constraint_sw 否 Int 对应控制台的界面参数“邻近行人约束开关”。当开关打开时,垃圾附近有行人逗留的告警将被过滤。 "0":表示不开启开关; "1":表示开启开关; 默认值为0。 min_trash_size 否 Int 对应控制台的界面参数“垃圾最小尺寸”。由于不同应用场景对垃圾的定义不同,用户可自定义配置垃圾最小尺寸,小于该尺寸的垃圾目标将不被告警。取值范围[1, 500]。 默认值为1。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制; "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制; "1":表示用黄色绘制用户设定区域。 默认值为0。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]],"name":"polygon"}]} 可为每个区域设置名称,后续输出结果时会连带输出区 域名 称。 参数没有携带时,默认区域为整个视频帧,默认区域名称为空字符串。
  • 响应 响应样例(VIS输入+DIS输出) { "id":"5a127c7844674d2382b7daae07794152", "name":"event-action-recog-cloud-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"event-action-recog task test", "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-22T08:08:39Z", "updated_at":"2020-09-22T08:08:39Z", "state":"PENDING", "input":{ "type":"vis", "data":[ { "stream_name":"event-action-recog-cloud-video", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-event-action-recog-cloud" } }, "service_config":{ "common":{ "smoking_detection_sw":1, "phoning_detection_sw":0, "render_result_sw":1, "render_roi_sw":1, "target_roi":"{"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } }} 响应参数说明 参数名称 字段类型 描述信息 task Object task详情,定义见 Task参数结构说明。
  • 请求 请求样例(VIS输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-fire-exit-occupation-cloud/tasks{ "name":"fire-exit-occupation-cloud-task", "description":"fire-exit-occupation task test", "input":{ "type":"vis", "data":[ { "stream_name":"fire-exit-occupation-stream", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-fire-exit-occupation" } }, "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "service_config":{ "common":{ "image_compression_ratio": 90, "render_roi_sw": 1, "render_result_sw": 1, "stacking_occupation_sw": 1, "vehicle_occupation_sw": 1, "stacking_residence_time": 40, "vehicle_residence_time": 50, "target_roi": "{\"polygons\":[{\"data\":[[0, 0], [0, 1000], [1920, 1000], [1920, 0]]}]}" } }} 参数说明 参数 是否必选 类型 说明 name 是 String 作业名称,只能由中文、字母(a~zA~Z)、数字(0~9)、中划线(-)、下划线(_)组成,长度范围为[1,100]。 description 否 String 作业描述信息,最大长度为500字符长度。 input 是 Object 视频数据输入列表,目前云上消防通道占用支持以下输入类型: vis:从 视频接入 服务中读取视频数据。 详细参数定义参见task.input(任务输入参数)。 service_version 是 String 功能版本号,版本号为3.0。 resource_order_id 是 String 购买的算法能力包ID,在服务界面购买算法能力包获取。 output 是 Object 结果数据的输出列表,目前支持将结果输出到您指定的通道中,输出类型为“dis”。 详细参数定义参见task.output(任务输出参数)。 service_config 否 Object 服务的算法配置,配置参数见ServiceConfig参数说明。 service_config中common的参数说明 字段 是否必选 类型 说明 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制。 "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。 stacking_occupation_sw 否 Int 对应控制台的界面参数“堆物占道检测开关”。 取值范围: "0":表示不开启。 "1":表示开启。 默认值为1。 vehicle_occupation_sw 否 Int 对应控制台的界面参数“车辆占道检测开关”。 取值范围: "0":表示不开启。 "1":表示开启。 默认值为1。 stacking_residence_time 否 Int 对应控制台的界面参数“堆物占道停留时间设置”。堆物在无明显遮挡的情况下停留时间超过该设置值则上报告警,其设置取值范围为[10, 3600],默认值为40,单位秒。 vehicle_residence_time 否 Int 对应控制台的界面参数“车辆占道停留时间设置”。车辆在无明显遮挡的情况下停留时间超过该设置值则上报告警,其设置取值范围为[10, 3600],默认值为50,单位秒。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。 详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]} 参数没有携带时,默认区域为整个视频帧。
  • 响应 响应样例 { "id":"6c4f45a2bf404c65961c8bbf63ff5bf3", "name":"pose-action-recog-edge-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"pose-action-recog-edge task test", "service_version":"3.0", "edge_pool_id":"8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-22T04:35:27Z", "updated_at":"2020-09-22T04:35:27Z", "state":"PENDING", "input":{ "type":"edgecamera", "data":[ { "id":"aec5857c-222f-4aa9-be39-23654e118886", "index":0 } ] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_config":{ "common":{ "climb_detection_sw":1, "fall_detection_sw":0, "wave_detection_sw":0, "bend_detection_sw":0, "render_result_sw":1, "render_roi_sw":1, "target_roi":"{"polygons":[{"data":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "image_compression_ratio":90 } }} 响应参数说明 参数名称 字段类型 描述信息 task Object task详情,定义见 Task参数结构说明。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-abnormal-detect-edge/tasks{ "name": "trashabnormaldetect-edge-task", "description": "trashabnormaldetect task test", "input": { "type": "edgecamera", "data": [ { "id": "9f8933c9-448c-48e5-8bc0-631ea83b92eb", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-trashabnormaldetect-edge" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "alert_time_threshold": 30, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[43,266],[42,645],[472,644],[416,212]]},{\"data\":[[311,182],[282,670],[941,661],[835,170]]}]}", "image_compression_ratio": 80 } }} 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-abnormal-detect-edge/tasks{ "name": "trashabnormaldetect-edge-task", "description": "trashabnormaldetect task test", "input": { "type": "edgerestful", "data": [ { "index": 0, "url":"https://100.127.134.69:554/test/data", "certificate_check": false, "rtsp_path_in_response": "data/url" } ] }, "output": { "dis": { "stream_name": "dis-trashabnormaldetect-edge" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "alert_time_threshold": 30, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[43,266],[42,645],[472,644],[416,212]]},{\"data\":[[311,182],[282,670],[941,661],[835,170]]}]}", "image_compression_ratio": 80 } }} 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-abnormal-detect-edge/tasks{ "name": "trashabnormaldetect-edge-task", "description": "trashabnormaldetect task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type":1 } ] }, "output": { "dis": { "stream_name": "dis-trashabnormaldetect-edge" }, "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "alert_time_threshold": 30, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[43,266],[42,645],[472,644],[416,212]]},{\"data\":[[311,182],[282,670],[941,661],[835,170]]}]}", "image_compression_ratio": 80 } }} 参数说明 参数 是否必选 类型 说明 name 是 String 作业名称,只能由中文、字母(a~zA~Z)、数字(0~9)、中划线(-)、下划线(_)组成,长度范围为[1,100]。 description 否 String 作业描述信息,最大长度为500字符长度。 input 是 Object 视频数据输入列表,支持从指定的边缘摄像头读取数据,即输入类型为“edgecamera”,“edgerestful”,“VCN”。 详细参数定义参见task.input(任务输入参数)。 service_version 是 String 功能版本号,版本号为3.0。边缘算法版本支持的显卡硬件为T4和华为自研Davinci芯片。 resource_order_id 是 String 购买的算法能力包ID,在服务界面购买算法能力包获取。 edge_pool_id 是 String 边缘运行池ID,获取方法参见创建边缘运行池。 output 是 Object 结果数据的输出列表,目前支持以下输出类型: DIS:将结果输出到您指定的DIS通道 。 Webhook:将结果输出到Webhook URL。 Localpath:将作业的运行结果保存在边缘节点本地(节点必须为linux系统),必须为linux路径,例如“/opt/cloud/”。 详细参数定义见task.output(任务输出参数)。 service_config 否 Object 服务的算法配置,配置参数见ServiceConfig参数说明。 service_config中common参数说明 字段 是否必选 类型 说明 alert_time_threshold 否 Int 对应控制台的界面参数“告警触发时间”。当检测到垃圾桶状态异常达到该时长是触发告警。取值范围[30, 3600], 单位秒。 默认值:30。 target_roi 否 String 对应控制台的界面参数“区域设置”。 垃圾桶检测区域,当在该区域内的垃圾桶被检测到异常状态时,触发告警。 该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[43,266],[42,645],[472,644],[416,212]]},{"data":[[311,182],[282,670],[941,661],[835,170]]}]} 参数没有携带时,默认全屏都是检测区域。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制。 "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 输出图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。
  • 请求 请求样例1(VCN输入+WEBHOOK输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-event-action-recog-edge/tasks{ "name": "event-action-recog-task", "description": "event-action-recog task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type":1 } ] }, "output": { "webhook": { "url": "https://apigw.huawei.com/api/event/callback", "headers": { "content-type": "application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "smoking_detection_sw": 1, "phoning_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } }} 请求样例2(摄像头输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-event-action-recog-edge/tasks{ "name": "event-action-recog-edge-task", "description": "event-action-recog-edge task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-event-action-recog-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "smoking_detection_sw": 1, "phoning_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } }} 请求样例3(edgerestful输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-event-action-recog-edge/tasks{ "name": "event-action-recog-task", "description": "event-action-recog task test", "input": { "type": "edgerestful", "data": [ { "url":"https://100.127.134.69:554/test/data", "certificate_check": false, "rtsp_path_in_response": "data/url" } ] }, "output": { "dis": { "stream_name": "dis-event-action-recog-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "smoking_detection_sw": 1, "phoning_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } }} 请求样例4(VCN输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-event-action-recog-edge/tasks{ "name": "event-action-recog-task", "description": "event-action-recog task test", "input": { "type": "vcn", "vcn":{ "ip":"172.100.119.6", "password":"CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port":"4675", "username":"testname" }, "data": [ { "index": 0, "device_id":"07211540881586160101#f7964493ff764bbf9294d58b22e63de6", "stream_type":1 } ] }, "output": { "dis": { "stream_name": "dis-event-action-recog-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "service_config": { "common": { "smoking_detection_sw": 1, "phoning_detection_sw": 0, "render_result_sw": 1, "render_roi_sw": 1, "target_roi": "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]]}]}", "image_compression_ratio":90 } }} 参数说明 参数 是否必选 类型 说明 name 是 String 作业名称,只能由中文、字母(a~zA~Z)、数字(0~9)、中划线(-)、下划线(_)组成,长度范围为[1,100]。 description 否 String 作业描述信息,最大长度为500字符长度。 input 是 Object 视频数据输入列表,支持从指定的边缘摄像头读取数据,即输入类型为“edgecamera”,“edgerestful”,“VCN”。 详细参数定义参见task.input(任务输入参数)。 service_version 是 String 功能版本号,版本号为3.0。边缘算法版本支持的显卡硬件为T4和华为自研Davinci芯片。 resource_order_id 是 String 购买的算法能力包ID,在服务界面购买算法能力包获取。 edge_pool_id 是 String 边缘运行池ID,获取方法参见创建边缘运行池。 output 是 Object 结果数据的输出列表,目前支持以下输出类型: DIS:将结果输出到您指定的DIS通道 。 Webhook:将结果输出到Webhook URL。 Localpath:将作业的运行结果保存在边缘节点本地(节点必须为linux系统),必须为linux路径,例如“/opt/cloud/”。 详细参数定义见task.output(任务输出参数)。 service_config 否 Object 服务的算法配置,配置参数见ServiceConfig参数结构说明。 service_config中common参数结构说明 参数 是否必选 类型 说明 smoking_detection_sw 否 Int 对应控制台的界面参数“吸烟检测开关”。 对输入视频流是否检测吸烟动作,取值范围: "0":表示不检测吸烟动作。 "1":表示检测吸烟动作。 默认值为1。 phoning_detection_sw 否 Int 对应控制台的界面参数“打手机检测开关”。 对输入视频流是否检测打手机动作,取值范围: "0":表示不检测打手机动作。 "1":表示检测打手机动作。 默认值为0。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,取值范围: "0":表示不绘制。 "1":表示用红色绘制告警目标边框。 默认值为0。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,取值范围: "0":表示不绘制。 "1":表示用黄色绘制用户设定区域。 默认值为0。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]} 参数没有携带时,默认区域为整个视频帧。 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。
  • 响应消息 删除失败时的响应示例 { "error_code": "IVA.0004", "error_msg": "The request param is invalid. parameter [task_id] does not match ^[0-9a-f]{32}|task\\w{8}$."} 响应参数说明 参数名称 描述信息 error_code 错误码。 error_msg 错误信息。
  • 返回值 正常 边缘作业的删除是异步删除,返回202。 异常 返回值 说明 400 Bad Request 请求错误,具体返回错误码请参考错误码。 401 Unauthorized 鉴权失败。 403 Forbidden 没有操作权限。 404 Not Found 找不到资源。 500 Internal Server Error 服务内部错误。 503 Service Unavailable 服务不可用。
  • 响应消息 删除失败时的响应示例 { "error_code": "IVA.0004", "error_msg": "The request param is invalid. parameter [task_id] does not match ^[0-9a-f]{32}|task\\w{8}$."} 响应参数说明 参数名称 描述信息 error_code 错误码。 error_msg 错误信息。
  • 返回值 正常 边缘作业的删除是异步删除,返回202。 异常 返回值 说明 400 Bad Request 请求错误,具体返回错误码请参考错误码。 401 Unauthorized 鉴权失败。 403 Forbidden 没有操作权限。 404 Not Found 找不到资源。 500 Internal Server Error 服务内部错误。 503 Service Unavailable 服务不可用。
  • 响应 响应样例 { "id":"9e64eeff407647f28201419e5ce3eacd", "name":"trash-overflow-edge-task", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"trash-overflow-edge task test", "service_version":"3.0", "edge_pool_id":"8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-22T04:48:30Z", "updated_at":"2020-09-22T04:48:30Z", "state":"PENDING", "input":{ "type":"edgecamera", "data":[ { "id":"aec5857c-222f-4aa9-be39-23654e118886", "index":0 } ] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_config":{ "common":{ "trash_overflow_interval":300, "render_result_sw":1, "render_roi_sw":1, "target_roi":"{"polygons":[{"data":[[80,570],[337,565],[339,889],[80,891]]}]}", "image_compression_ratio":90 } }} 响应参数说明 参数名称 字段类型 描述信息 task Object task详情,定义见 Task参数结构说明。
  • 响应 响应样例 { "id":"cb088e91e03b4e4a87d55bbaae1debe0", "name":"intrusion-T4M-edge_0", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"intrusion task test", "service_version":"3.0", "edge_pool_id":"42deafda231942cd810b592b9ed933dc", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-18T12:29:53Z", "updated_at":"2020-09-18T12:29:53Z", "state":"RUNNING", "input":{ "type":"edgecamera", "data":[ { "id":"6233039b-698f-4347-8ced-ef0d14605c0b", "index":0 } ] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_config":{ "common":{ "car_detection_sw":0, "person_detection_sw":1, "detection_min_size":60, "detection_max_size":1080, "line_detection_sw":1, "region_detection_sw":1, "loitering_detection_sw":0, "image_compression_ratio":90, "render_result_sw":1, "target_roi": "{"lines":[{"data":[[560,680],[1185,506]],"properties":{"side1_name":"Side1","side2_name":"Side2"}}],"polygons":[{"data":[[0,0],[0,1080],[1920,1080],[1920,0]]}]}", "render_roi_sw":1 } }} 响应参数说明 参数名称 字段类型 描述信息 task Object task详情,定义见•Task参数结构说明。
共99354条