云服务器内容精选

  • 请求 请求样例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%。
  • 请求 请求样例1(摄像头输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-urban-roadside-stall-edge/tasks{ "name": "c-urban-roadside-stall-edge-task", "description": "c-urban-roadside-stall-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, "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]],\"name\":\"a\"}]}" } }} 请求样例2(edgerestful输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-urban-roadside-stall-edge/tasks{ "name": "c-urban-roadside-stall-edge-task", "description": "c-urban-roadside-stall-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, "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]],\"name\":\"a\"}]}" } }} 请求样例3(VCN输入+DIS/Webhook输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-urban-roadside-stall-edge/tasks{ "name": "c-urban-roadside-stall-edge-task", "description": "c-urban-roadside-stall-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, "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]],\"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。 详细参数定义参见task.output(任务输出参数)。 service_config 否 Object 服务的算法配置,配置参数见ServiceConfig参数说明。 service_config中common参数说明 字段 是否必选 类型 说明 image_compression_ratio 否 Int 对应控制台的界面参数“图片压缩比”。 图片压缩百分比,取值范围为[20,100]。 默认值:90,表示图片压缩比为90%。 roadside_stall_detect_sw 否 Int 对应控制台的界面参数“占道经营开关”。 "0":表示不检测占道经营; "1":表示检测占道经营。 默认值为1。 outstore_stall_detect_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]],"name":"polygon"}]} 可为每个区域设置名称,后续输出结果时会连带输出区域名称。 参数没有携带时,默认区域为整个视频帧,默认区域名称为空字符串。 repeat_alert_sw 否 Int 对应控制台的界面参数“重复告警开关”。 是否对同一目标进行重复告警,取值范围: "0":表示关闭,不重复告警; "1":表示开启,重复告警。 默认值为0。 重复告警开关开启后,周期性的告警所有目标,同一目标每次告警的detection_id相同,参数repeat_alert_interval才会生效。 repeat_alert_interval 否 Int 对应控制台的界面参数“重复告警间隔”。 在参数repeat_alert_sw为1时才会生效。 控制重复告警的时间间隔,单位为秒。取值范围:[30, 86400],最长时间间隔为24小时。 默认值为30。每30秒告警一次,同一个告警目标detection_id相同。
  • 响应消息 删除失败时的响应示例 { "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":"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参数结构说明。
  • 响应 响应样例(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参数结构说明。
  • 终端节点 终端节点(Endpoint)即调用API的请求地址,不同服务不同区域的终端节点不同,您可以从地区和终端节点中查询所有服务的终端节点。 园区智能体服务的终端节点如表1所示,请您根据业务需要选择对应区域的终端节点。 表1 园区智能体Endpoint 区域名称 区域 终端节点(Endpoint) 协议类型 华北-北京一 cn-north-1 iva.cn-north-1.myhuaweicloud.com HTTPS 华北-北京四 cn-north-4 iva.cn-north-4.myhuaweicloud.com HTTPS 华东-上海一 cn-east-1 iva.cn-east-1.myhuaweicloud.com HTTPS 华东-上海二 cn-east-2 iva.cn-east-2.myhuaweicloud.com HTTPS 华南-广州 cn-south-1 iva.cn-south-1.myhuaweicloud.com HTTPS 父主题: 使用前必读
  • 响应 响应样例(VIS输入+DIS输出) { "id":"3d7c81cf35784d88a4e26066bcc5debd", "name":"staffonduty_cloud_0", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description":"staffonduty task test", "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at":"2020-09-22T07:55:13Z", "updated_at":"2020-09-22T07:55:13Z", "state":"RUNNING", "input":{ "type":"vis", "data":[ { "stream_name":"staffonduty", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-staffonduty" } }, "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 } }} 响应参数说明 参数名称 字段类型 描述信息 task Object task详情,定义见Task参数结构说明。
  • 请求 请求样例(VIS输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-queue-status-analysis-cloud/tasks{ "name":"queue-status-analysis-cloud-task", "description":"queue-status-analysis-cloud task test", "input":{ "type":"vis", "data":[ { "stream_name":"queue-status-analysis-stream", "index":0 } ] }, "output":{ "dis":{ "stream_name":"dis-queue-status-analysis" } }, "service_version":"3.0", "resource_order_id":"840a5cf90d4a4bbaa71f251dfe8fe64e", "service_config":{ "common":{ "image_compression_ratio": 90, "render_result_sw": 1, "render_roi_sw": 1, "queue_status_analysis_sw": 1, "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。 queue_status_analysis_sw 否 Int 对应控制台的界面参数“排队状态分析开关”。 取值范围: "0":表示不开启。 "1":表示开启。 默认值为1。 target_roi 否 String 对应控制台的界面参数“检测区域设置”。 表示检测区域,该字段为JSON格式的字符串,API调用时需要加转义符。详细JSON格式参见target_roi(目标区域)。 例如: {"polygons":[{"data":[[84,389],[1840,349],[1824,526],[78,526]]}]} 参数没有携带时,默认区域为整个视频帧中间的1/4。 当target_roi参数未设置时,区域默认位置如图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": "8d7c029b01c64abf9630f40b7dbfb067", "name": "人脸提取-T4M-edge-0", "creator":"user_test", "project_id":"1f793beac00d4801874db741cbfe10fa", "description": "face detection task test", "service_version": "3.0", "edge_pool_id": "e9bf9ebe497d4c9bb2e65d1f99fe1ff9", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "created_at": "2020-09-10T06:56:56Z", "updated_at": "2020-09-10T07:01:43Z", "state": "RUNNING", "input": { "type": "edgecamera", "data": [{ "id": "5213039b-698f-4347-8ced-ef0d14605c0b" }] }, "output": { "webhook":{ "url":"https://apigw.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" }, "data_category":[ "FaceImage", "OriginImage" ] } }, "service_config": { "common": { "detection_max_size": 800, "detection_min_size": 120, "origin_image_send_sw": 0, "face_first_send_threshold": 0.0, "face_must_send_sw": 0, "face_repeat_send_sw": 1, "face_repeat_send_mode": "PERIOD", "face_repeat_send_step": 1, "face_repeat_send_interval": 1, "target_roi": "{"polygons":[{"data":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}", "image_compression_ratio": 90 } }} 响应参数说明 参数名称 字段类型 描述信息 task Object task详情,定义见•Task参数结构说明。
  • AK/SK认证 AK/SK签名认证方式仅支持消息体大小12MB以内,12MB以上的请求请使用Token认证。 AK/SK认证就是使用AK/SK对请求进行签名,在请求时将签名信息添加到消息头,从而通过身份认证。 AK(Access Key ID):访问密钥ID。与私有访问密钥关联的唯一标识符;访问密钥ID和私有访问密钥一起使用,对请求进行加密签名。 SK(Secret Access Key):与访问密钥ID结合使用的密钥,对请求进行加密签名,可标识发送方,并防止请求被修改。 使用AK/SK认证时,您可以基于签名算法使用AK/SK对请求进行签名,也可以使用专门的签名SDK对请求进行签名。详细的签名方法和SDK使用方法请参见API签名指南。 签名SDK只提供签名功能,与服务提供的SDK不同,使用时请注意。
  • Token认证 Token的有效期为24小时,需要使用同一个Token鉴权时,可以缓存起来,避免频繁调用。 Token在计算机系统中代表令牌(临时)的意思,拥有Token就代表拥有某种权限。Token认证就是在调用API的时候将Token加到请求消息头,从而通过身份认证,获得操作API的权限。 Token可通过调用获取用户Token接口获取,调用本服务API需要project级别的Token,即调用获取用户Token接口时,请求body中“auth.scope”的取值需要选择“project”,请求示例如下。 { "auth": { "identity": { "methods": ["password"], "password": { "user": { "name": "username", //替换为实际用户名 "password": "**********",//替换为实际的用户密码 "domain": { "name": "domianname" //替换为实际帐号名 } } } }, "scope": { "project": { "name": "cn-north-1 " //替换为实际的project name,获取作用范围为指定project的Token } } }} 获取Token后,再调用其他接口时,您需要在请求消息头中添加“X-Auth-Token”,其值即为获取到的Token。例如Token值为“ABCDEFJ....”,则调用接口时将“X-Auth-Token: ABCDEFJ....”加到请求消息头即可,如下所示。 GET https://iva.cn-north-1.myhuaweicloud.com/v3/auth/projectsContent-Type: application/jsonX-Auth-Token: ABCDEFJ....
  • 响应消息 删除失败时的响应示例 { "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 服务不可用。
  • 请求 请求样例1(VCN输入+WEBHOOK输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-overflow-edge/tasks{ "name": "trash-overflow-task", "description": "trash-overflow 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.xx.com/api/mqs/sit", "headers":{ "content-type":"application/json" } } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "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 } }} 请求样例2(摄像头输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-overflow-edge/tasks{ "name": "trash-overflow-edge-task", "description": "trash-overflow-edge task test", "input": { "type": "edgecamera", "data": [ { "id": "aec5857c-222f-4aa9-be39-23654e118886", "index": 0 } ] }, "output": { "dis": { "stream_name": "dis-trash-overflow-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "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 } }} 请求样例3(edgerestful输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-overflow-edge/tasks{ "name": "trash-overflow-edge-task", "description": "trash-overflow-edge-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-trash-overflow-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "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 } }} 请求样例4(VCN输入+DIS输出) POST /v2/6204a5bd270343b5885144cf9c8c158d/services/c-trash-overflow-edge/tasks{ "name": "trash-overflow-task", "description": "trash-overflow 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-trash-overflow-edge" } }, "service_version": "3.0", "resource_order_id": "840a5cf90d4a4bbaa71f251dfe8fe64e", "edge_pool_id": "8dcf5ec7bc4d4a26aa1d3e1bb5ed2b5a", "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 } }} 参数说明 参数 是否必选 类型 说明 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参数结构说明 字段 是否必选 类型 说明 trash_overflow_interval 否 Int 对应控制台的界面参数“检测周期”。 垃圾桶满溢检测周期,单位为秒。取值范围为[300, 3600],默认值为300。当时间到达检测周期整数倍时,触发算法检测设定区域中的垃圾桶是否满溢。 render_result_sw 否 Int 对应控制台的界面参数“目标框渲染开关”。 输出图像是否绘制告警目标边框,默认值为0,取值范围: 0:表示不绘制。 1:表示用红色绘制告警目标边框。 render_roi_sw 否 Int 对应控制台的界面参数“检测区域渲染开关”。 输出图像是否绘制检测区域,默认值为0,取值范围: 0:表示不绘制。 1:表示用黄色绘制用户设定区域。 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%。