华为云用户手册

  • 请求示例 云上高密度人群统计作业创建,使用输入源为video_source,输出为dis。 POST /v2/{project_id}/services/c-crowdcount-cloud/tasks { "name" : "crowdcount-task", "description" : "CrowdCountDetection task test", "input" : { "type" : "video_source", "data" : [ { "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" } ] }, "output" : { "dis" : { "stream_name" : "crowdcount" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "banner_detection_sw" : 1, "banner_threshold" : "2", "alarm_threshold" : "5", "sampling_time_interval" : 8, "density_sw" : 1, "visualization_output_sw" : 1, "image_compression_ratio" : 80, "target_roi" : "{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}" } } } 云上高密度人群统计作业创建,使用输入源为obs,输出为dis。 POST /v2/{project_id}/services/c-crowdcount-cloud/tasks { "name" : "crowdcount-task", "description" : "CrowdCountDetection task test", "input" : { "type" : "obs", "data" : [ { "bucket" : "obs_test_video", "path" : "test.mp4", "index" : 0 } ] }, "output" : { "dis" : { "stream_name" : "crowdcount" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "banner_detection_sw" : 1, "banner_threshold" : "2", "alarm_threshold" : "5", "sampling_time_interval" : 8, "density_sw" : 1, "visualization_output_sw" : 1, "image_compression_ratio" : 80, "target_roi" : "{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}" } } } 云上高密度人群统计作业创建,使用输入源为url,输出为dis。 POST /v2/{project_id}/services/c-crowdcount-cloud/tasks { "name" : "crowdcount-task", "description" : "CrowdCountDetection task test", "input" : { "type" : "url", "data" : [ { "url" : "https://obs_test/test.mp4", "index" : 0 } ] }, "output" : { "dis" : { "stream_name" : "crowdcount" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "banner_detection_sw" : 1, "banner_threshold" : "2", "alarm_threshold" : "5", "sampling_time_interval" : 8, "density_sw" : 1, "visualization_output_sw" : 1, "image_compression_ratio" : 80, "target_roi" : "{\"polygons\":[{\"data\":[[100,100],[1800,100],[1800,1000],[100,1000]]}]}" } } }
  • 响应参数 状态码: 200 表14 响应Body参数 参数 参数类型 描述 tasks Array of TaskResponse objects VIAS平台创建作业的作业id列表 表15 TaskResponse 参数 参数类型 描述 id String VIAS平台创建的作业id。 状态码: 400 表16 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息描述。 detail String 错误详情。 params Array of strings 错误参数列举。 数组长度:0 - 1 reason String 错误原因。 advice String 建议。 状态码: 500 表17 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息描述。 detail String 错误详情。 params Array of strings 错误参数列举。 数组长度:0 - 1 reason String 错误原因。 advice String 建议。
  • 请求示例 边缘个体事件动作检测作业创建,使用输入源为video_source,输出为webhook。 POST /v2/{project_id}/services/c-pose-action-recog-edge/tasks { "name" : "pose-action-detection-task", "description" : "pose-action detection task test", "input" : { "type" : "video_source", "data" : [ { "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" } ] }, "output" : { "webhook" : { "url" : "https://127.0.0.1:8080/webhook", "headers" : { "x-auth-token" : "tokentest" } } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "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 } } } 边缘个体事件动作检测作业创建,使用输入源为VCN,输出为dis。 POST /v2/{project_id}/services/c-pose-action-recog-edge/tasks { "name" : "pose-action-detection-task", "description" : "pose-action detection task test", "input" : { "type" : "vcn", "data" : [ { "device_id" : "aec5857c-222f-4aa9-be39-23654e118886", "stream_type" : 2 } ], "vcn" : { "ip" : "127.0.0.1", "port" : 8080, "username" : "vcntest", "password" : "123456abcd" } }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "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 } } } 边缘个体事件动作检测作业创建,使用输入源为边缘摄像头,输出为dis。 POST /v2/{project_id}/services/c-pose-action-recog-edge/tasks { "name" : "pose-action-detection-task", "description" : "pose-action detection task test", "input" : { "type" : "edgecamera", "data" : [ { "id" : "aec5857c-222f-4aa9-be39-23654e118886", "index" : 0 } ] }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "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 } } } 边缘个体事件动作检测作业创建,使用输入源为restful,输出为webhook。 POST /v2/{project_id}/services/c-pose-action-recog-edge/tasks { "name" : "pose-action-detection-task", "description" : "pose-action detection task test", "input" : { "type" : "restful", "data" : [ { "url" : "https://restfultest", "certificate_check" : false, "node_id" : "aec5857c-222f-4aa9-be39-23654e118886", "rtsp_path_in_response" : "http://testpath" } ] }, "output" : { "webhook" : { "url" : "https://127.0.0.1:8080/webhook", "headers" : { "x-auth-token" : "tokentest" } } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "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 } } }
  • 请求示例 边缘城管事件-违规广告牌检测作业创建,使用输入源为video_source,输出为dis。 POST /v2/{project_id}/services/c-urban-sign-detect-edge/tasks { "name" : "sign-detect-task", "description" : "sign task test", "input" : { "type" : "video_source", "data" : [ { "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" } ] }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "image_compression_ratio" : 90, "render_roi_sw" : 1, "render_result_sw" : 1, "target_roi" : "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } } 边缘城管事件-违规广告牌检测作业创建,使用输入源为restful,输出为webhook。 POST /v2/{project_id}/services/c-urban-sign-detect-edge/tasks { "name" : "sign-detect-task", "description" : "sign task test", "input" : { "type" : "restful", "data" : [ { "index" : 0, "url" : "http://xxx.xxx.xxx.xxx:xxx/test/data", "certificate_check" : false, "rtsp_path_in_response" : "data/url" } ] }, "output" : { "webhook" : { "url" : "https://apigw.huawei.com/xxx/xxx/callback", "headers" : { "content-type" : "application/json" } } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "image_compression_ratio" : 90, "render_roi_sw" : 1, "render_result_sw" : 1, "target_roi" : "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } } 边缘城管事件-违规广告牌检测作业创建,使用输入源为VCN,输出为dis。 POST /v2/{project_id}/services/c-urban-sign-detect-edge/tasks { "name" : "sign-detect-task", "description" : "sign task test", "input" : { "type" : "vcn", "vcn" : { "ip" : "xxx.xxx.xxx.xxx", "password" : "CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port" : "xxx", "username" : "testname" }, "data" : [ { "index" : 0, "stream_type" : 1, "device_id" : "07211540881586160101#f7964493ff764bbf9294d58b22e63de6" } ] }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "image_compression_ratio" : 90, "render_roi_sw" : 1, "render_result_sw" : 1, "target_roi" : "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } } 边缘城管事件-违规广告牌检测作业创建,使用输入源为边缘摄像头,输出为dis。 POST /v2/{project_id}/services/c-urban-sign-detect-edge/tasks { "name" : "sign-detect-task", "description" : "sign task test", "input" : { "type" : "edgecamera", "data" : [ { "id" : "aec5857c-222f-4aa9-be39-23654e118886", "index" : 0 } ] }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "image_compression_ratio" : 90, "render_roi_sw" : 1, "render_result_sw" : 1, "target_roi" : "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } }
  • 响应参数 状态码: 200 表14 响应Body参数 参数 参数类型 描述 tasks Array of TaskResponse objects VIAS平台创建作业的作业id列表 表15 TaskResponse 参数 参数类型 描述 id String VIAS平台创建的作业id。 状态码: 400 表16 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息描述。 detail String 错误详情。 params Array of strings 错误参数列举。 数组长度:0 - 1 reason String 错误原因。 advice String 建议。 状态码: 500 表17 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息描述。 detail String 错误详情。 params Array of strings 错误参数列举。 数组长度:0 - 1 reason String 错误原因。 advice String 建议。
  • 响应示例 状态码: 200 查询作业列表响应体 { "count" : 2, "tasks" : [ { "id" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "name" : "qqqq_task", "service_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx", "created_at" : "1686034773024", "state" : "PENDING", "video_source_name" : "url_test", "title" : "testwjh", "type" : "0", "algorithm_publish_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" }, { "id" : "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "name" : "task_test1", "service_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx", "created_at" : "1686027880205", "state" : "STOPPED", "video_source_name" : "test_g11", "title" : "alg_test", "type" : "0", "algorithm_publish_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" } ], "page" : 1, "page_size" : 10 }
  • URI GET /v2/{project_id}/tasks 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID,获取方法参见获取项目ID和名称 表2 Query参数 参数 是否必选 参数类型 描述 source_data_type 否 String 任务类型,用作查询过滤。仅支持async_task与sync_task两种类型。 title 否 String 算法中文名,需要满足正则表达式^[a-zA-Z0-9\u4e00-\u9fa5-_,]{2,64}$ camera_name 否 String 摄像头名称 最大长度:255 task_state 否 String 作业状态,状态可选PENDING|RECOVERING|STARTING|UPGRADING|CREATE_FAILED|START_FAILED|RUNNING|STOPPING|STOPPED|ABNORMAL|SUCCEEDED|FAILED|DELETING|FREEZING|FROZEN|SCHEDULING|LACK_OF_RESOURCES task_name 否 String 作业名称 最大长度:1024 page_size 否 Integer 每页显示的条目数量 最小值:5 最大值:1000 缺省值:10 page 否 Integer 偏移量 缺省值:1 sort_dir 否 String 展示服务作业时的排序规则 缺省值:desc batch_id 否 String 批量配置ID,需要满足正则表达式^[a-z0-9-_]{4,36}$ video_group_id 否 String 视频分组ID(多个ID英文逗号分隔拼接),长度要求[4,2048] company 否 String 厂商(多选时逗号分隔拼接) alg_id 否 String 算法ID,需要满足正则表达式^[0-9a-f]{8}-[0-9a-f]{4}-[4][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$
  • 请求示例 边缘城管事件-乱堆物料检测作业创建,使用输入源为video_source,输出为dis。 POST /v2/{project_id}/services/c-urban-stacking-edge/tasks { "name" : "stacking-detect-task", "description" : "stacking task test", "input" : { "type" : "video_source", "data" : [ { "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" } ] }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "image_compression_ratio" : 90, "render_roi_sw" : 1, "render_result_sw" : 1, "target_roi" : "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } } 边缘城管事件-乱堆物料检测作业创建,使用输入源为restful,输出为webhook。 POST /v2/{project_id}/services/c-urban-stacking-edge/tasks { "name" : "stacking-detect-task", "description" : "stacking task test", "input" : { "type" : "restful", "data" : [ { "index" : 0, "url" : "http://xxx.xxx.xxx.xxx:xxx/test/data", "certificate_check" : false, "rtsp_path_in_response" : "data/url" } ] }, "output" : { "webhook" : { "url" : "https://apigw.huawei.com/xxx/xxx/callback", "headers" : { "content-type" : "application/json" } } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "image_compression_ratio" : 90, "render_roi_sw" : 1, "render_result_sw" : 1, "target_roi" : "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } } 边缘城管事件-乱堆物料检测作业创建,使用输入源为边缘摄像头,输出为dis。 POST /v2/{project_id}/services/c-urban-stacking-edge/tasks { "name" : "stacking-detect-task", "description" : "stacking task test", "input" : { "type" : "edgecamera", "data" : [ { "id" : "aec5857c-222f-4aa9-be39-23654e118886", "index" : 0 } ] }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "image_compression_ratio" : 90, "render_roi_sw" : 1, "render_result_sw" : 1, "target_roi" : "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } } 边缘城管事件-乱堆物料检测作业创建,使用输入源为VCN,输出为dis。 POST /v2/{project_id}/services/c-urban-stacking-edge/tasks { "name" : "stacking-detect-task", "description" : "stacking task test", "input" : { "type" : "vcn", "vcn" : { "ip" : "xxx.xxx.xxx.xxx", "password" : "CQeNfcRLwyMvH77AkDBaPS+BKXdFu/1bAXtIMNTx3QPbVewjipNq06nNodxWI28I1lCUsvv2+wB1joepzynLVW3g2nz0k9vaCRDoK6=", "port" : "xxx", "username" : "testname" }, "data" : [ { "index" : 0, "stream_type" : 1, "device_id" : "07211540881586160101#f7964493ff764bbf9294d58b22e63de6" } ] }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "image_compression_ratio" : 90, "render_roi_sw" : 1, "render_result_sw" : 1, "target_roi" : "{\"polygons\":[{\"data\":[[84,389],[1840,349],[1824,526],[78,526]],\"name\":\"a\"}]}" } } }
  • 响应参数 状态码: 200 表14 响应Body参数 参数 参数类型 描述 tasks Array of TaskResponse objects VIAS平台创建作业的作业id列表 表15 TaskResponse 参数 参数类型 描述 id String VIAS平台创建的作业id。 状态码: 400 表16 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息描述。 detail String 错误详情。 params Array of strings 错误参数列举。 数组长度:0 - 1 reason String 错误原因。 advice String 建议。 状态码: 500 表17 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息描述。 detail String 错误详情。 params Array of strings 错误参数列举。 数组长度:0 - 1 reason String 错误原因。 advice String 建议。
  • 响应参数 状态码: 200 表15 响应Body参数 参数 参数类型 描述 tasks Array of TaskResponse objects VIAS平台创建作业的作业id列表 表16 TaskResponse 参数 参数类型 描述 id String VIAS平台创建的作业id。 状态码: 400 表17 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息描述。 detail String 错误详情。 params Array of strings 错误参数列举。 数组长度:0 - 1 reason String 错误原因。 advice String 建议。 状态码: 500 表18 响应Body参数 参数 参数类型 描述 error_code String 错误码。 error_msg String 错误信息描述。 detail String 错误详情。 params Array of strings 错误参数列举。 数组长度:0 - 1 reason String 错误原因。 advice String 建议。
  • 请求示例 边缘视频车辆作业创建,使用输入源为video_source,输出为webhook。 POST /v2/{project_id}/services/c-vehicle-detection-edge/tasks { "name" : "vehicle-task", "description" : "vehicle detection task test", "input" : { "type" : "video_source", "data" : [ { "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" } ] }, "output" : { "webhook" : { "url" : "https://127.0.0.1:8080/webhook", "headers" : { "x-auth-token" : "tokentest" } } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "target_roi" : "{\"lines\":[{\"data\":[[50,756],[100,616]],\"properties\":{\"type\":0}},{\"data\":[[50,256],[100,116]],\"properties\":{\"type\":1}}],\"polygons\":[{\"data\":[[487,465],[1850,450],[1905,1013],[515,1050]]}]}", "license_plate" : { "local_city" : "B", "local_province" : "津" }, "output_image_sw" : 1, "image_compression_ratio" : 100 } } } 边缘视频车辆作业创建,使用输入源为VCN,输出为dis。 POST /v2/{project_id}/services/c-vehicle-detection-edge/tasks { "name" : "vehicle-task", "description" : "vehicle detection task test", "input" : { "type" : "vcn", "data" : [ { "device_id" : "aec5857c-222f-4aa9-be39-23654e118886", "stream_type" : 2 } ], "vcn" : { "ip" : "127.0.0.1", "port" : 8080, "username" : "vcntest", "password" : "123456abcd" } }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "target_roi" : "{\"lines\":[{\"data\":[[50,756],[100,616]],\"properties\":{\"type\":0}},{\"data\":[[50,256],[100,116]],\"properties\":{\"type\":1}}],\"polygons\":[{\"data\":[[487,465],[1850,450],[1905,1013],[515,1050]]}]}", "license_plate" : { "local_city" : "B", "local_province" : "津" }, "output_image_sw" : 1, "image_compression_ratio" : 100 } } } 边缘视频车辆作业创建,使用输入源为边缘摄像头,输出为dis。 POST /v2/{project_id}/services/c-vehicle-detection-edge/tasks { "name" : "vehicle-task", "description" : "vehicle detection task test", "input" : { "type" : "edgecamera", "data" : [ { "id" : "aec5857c-222f-4aa9-be39-23654e118886", "index" : 0 } ] }, "output" : { "dis" : { "stream_name" : "dis-test" } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "target_roi" : "{\"lines\":[{\"data\":[[50,756],[100,616]],\"properties\":{\"type\":0}},{\"data\":[[50,256],[100,116]],\"properties\":{\"type\":1}}],\"polygons\":[{\"data\":[[487,465],[1850,450],[1905,1013],[515,1050]]}]}", "license_plate" : { "local_city" : "B", "local_province" : "津" }, "output_image_sw" : 1, "image_compression_ratio" : 100 } } } 边缘视频车辆作业创建,使用输入源为restful,输出为webhook。 POST /v2/{project_id}/services/c-vehicle-detection-edge/tasks { "name" : "vehicle-task", "description" : "vehicle detection task test", "input" : { "type" : "restful", "data" : [ { "url" : "https://restfultest", "certificate_check" : false, "node_id" : "aec5857c-222f-4aa9-be39-23654e118886", "rtsp_path_in_response" : "http://testpath" } ] }, "output" : { "webhook" : { "url" : "https://127.0.0.1:8080/webhook", "headers" : { "x-auth-token" : "tokentest" } } }, "service_version" : "3.0", "resource_order_id" : "840a5cf90d4a4bbaa71f251dfe8fe64e", "config" : { "common" : { "target_roi" : "{\"lines\":[{\"data\":[[50,756],[100,616]],\"properties\":{\"type\":0}},{\"data\":[[50,256],[100,116]],\"properties\":{\"type\":1}}],\"polygons\":[{\"data\":[[487,465],[1850,450],[1905,1013],[515,1050]]}]}", "license_plate" : { "local_city" : "B", "local_province" : "津" }, "output_image_sw" : 1, "image_compression_ratio" : 100 } } }
  • 请求示例 新增配置名称为“wdwd”使用算法名为“烟火演示算法”版本为“1.0”厂商为“VIAS”不保存模板输入方式为“video_source”输出方式为“webhook”有相关算法配置的批量配置 /v2/{project_id}/batch-tasks { "name" : "wdwd", "service_name" : "烟火演示算法", "service_version" : "1.0", "manufacturer" : "VIAS", "is_saved_as_template" : false, "description" : "", "priority" : "low", "batch_input" : { "video_source_group" : [ { "video_source_group_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx", "video_source_list" : [ { "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" } ] } ] }, "output" : { "webhook" : { "url" : "http://test", "headers" : { "a" : "a" } } }, "config" : { "common" : { "render_result_sw" : 1, "fire_detection_sw" : 1, "smoke_detection_sw" : 1 } } }
  • 响应参数 状态码: 200 表13 响应Body参数 参数 参数类型 描述 total_count Integer 作业总数 failed_count Integer 失败作业数量 succeed_count Integer 成功作业数量 id String 批量作业id error_list Array of strings 错误信息列表 状态码: 400 表14 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议 状态码: 500 表15 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议
  • 请求示例 创建输入类型为“video_source”,输出类型为“webhook”,算法版本为1.1,没有任务启动参数,不保存作业模板的请求体 /v2/{project_id}/services/{service_name}/tasks { "name" : "Test", "input" : { "type" : "video_source", "data" : [ { "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" } ] }, "output" : { "webhook" : { "url" : "http://test", "headers" : { "a" : "a" } } }, "config" : { "common" : { } }, "service_version" : "1.1", "is_saved_as_template" : false } 兼容IVA的老接口,采用此请求体 /v2/{project_id}/services/{service_name}/tasks { "name" : "test-alg-819", "input" : { "type" : "url", "data" : [ { "url" : "https://iuwhediue-input.com", "index" : 0 } ] }, "output" : { "webhook" : { "url" : "https://iuwhediue-output.com", "headers" : { "AA" : "AA" } } }, "config" : { "common" : { "viewpoint" : 1 } }, "service_version" : "3.0", "is_saved_as_template" : false, "resource_order_id" : "029b34a69efd48769215e429deff0cec" } 创建定时任务,若存在相邻两天前一天结束时间为23:59:00,第二天开始为00:00:00,则为跨天任务,保持运行中状态。 /v2/{project_id}/services/{service_name}/tasks { "name" : "test-alg-819", "schedule" : { "type" : "weekly", "timezone" : "+08:00", "days_of_week" : [ 1, 2, 3, 4, 5, 6, 7 ], "periods" : [ [ ], [ ], [ ], [ ], [ { "begin_at" : "22:15:00", "end_at" : "23:59:00" } ], [ { "begin_at" : "00:00:00", "end_at" : "23:59:00" } ], [ { "begin_at" : "22:15:00", "end_at" : "23:59:00" } ] ] }, "input" : { "type" : "url", "data" : [ { "url" : "https://iuwhediue-input.com", "index" : 0 } ] }, "output" : { "webhook" : { "url" : "https://iuwhediue-output.com", "headers" : { "AA" : "AA" } } }, "config" : { "common" : { "viewpoint" : 1 } }, "service_version" : "3.0", "is_saved_as_template" : false, "resource_order_id" : "029b34a69efd48769215e429deff0cec" }
  • 响应参数 状态码: 200 表13 响应Body参数 参数 参数类型 描述 id String 任务创建成功生成的任务ID 状态码: 400 表14 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议 状态码: 500 表15 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议
  • 响应示例 状态码: 200 我的算法服务列表响应体 { "count" : 3, "service_list" : [ { "alg_id" : "068ed4d8-077e-4ec9-aa19-bc******e925", "service_id" : "331bcb4a-5b3c-4e67-87cc-6c******d77b", "service_name" : "边缘入侵检测", "function_version" : "1.0", "created_at" : 1680008856502, "alg_status" : "service_running", "deploy_type" : "edge", "alg_class" : "self", "request_mode" : "async", "can_update" : true, "new_alg_id" : "3320b2b9-562b-4bee-bfee-0e******01c1" }, { "alg_id" : "5c73bd3f-6498-40e5-a40f-7b******1139", "service_id" : "04dc08b7-da07-46ee-83e7-c3******f668", "service_name" : "test-event-01", "function_version" : "1.0", "created_at" : 1680005185627, "alg_status" : "service_stopped", "deploy_type" : "cloud", "alg_class" : "self", "request_mode" : "async" }, { "alg_id" : "c01ec07f-874f-42f1-ba1d-15******d71b", "service_id" : "db1ec2d2-d023-4d20-ab6f-bc******4eeb", "service_name" : "TEST-CLOUD-ALG", "function_version" : "1.0", "created_at" : 1680008219078, "alg_status" : "service_failed", "deploy_type" : "cloud", "alg_class" : "self", "request_mode" : "async", "description" : "测试云上算法" } ], "total" : 3 }
  • URI GET /v2/{project_id}/algorithm/services/user 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID,获取方法参见获取项目ID和名称 表2 Query参数 参数 是否必选 参数类型 描述 name_like 否 String 服务名称,支持模糊匹配 is_paged 否 Boolean 是否分页 缺省值:false page_size 否 Integer 每页的最大条目数 最小值:5 最大值:200 缺省值:10 page_num 否 Integer 第几页 最小值:1 最大值:10000 缺省值:1 order_by 否 String 排序方式,可选“asc”或“desc”,代表递增排序及递减排序 缺省值:desc sort_name 否 String 排序字段,可选“created_at”或“function_version” 缺省值:created_at alg_status 否 Array 服务状态,支持多选。可选“service_running”、“service_deploying”、“service_failed”、“service_stopping”、“service_stopped”、“service_upgrading”、“service_finished”、“service_concerning”、“not_deployed”
  • 响应参数 状态码: 200 表4 响应Body参数 参数 参数类型 描述 count Integer 数量 service_list Array of ServicesListInfoDto objects 服务列表 total Integer 总数数量 表5 ServicesListInfoDto 参数 参数类型 描述 alg_id String 算法ID service_id String 服务ID service_name String 服务名称 package_id String 算法服务包ID package_name String 算法服务包名称 company String 厂商名称 alg_version String 算法版本 function_version String 功能版本 tags Array of strings 应用场景标签 created_at Long 创建时间 alg_status String 算法状态,取值为“service_running”、“service_deploying”、“service_failed”、“service_stopping”、“service_stopped”、“service_upgrading”、“service_finished”、“service_concerning”或者“not_deployed” deploy_type String 部署类型,取值为“cloud”或者“edge” alg_class String 算法类别,取值为“self”或者“partner” request_mode String 请求模式,取值为“sync”或者“async” description String 算法描述,信息非空时返回 error_msg String 服务异常信息,信息非空时返回 can_update Boolean 是否可升级,值为true时返回 new_alg_id String 升级后的算法ID,可升级时返回
  • 响应参数 状态码: 400 表3 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议 状态码: 500 表4 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议
  • 响应参数 状态码: 400 表3 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议 状态码: 500 表4 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议
  • 请求示例 对任务ID为{task_id}的任务做停止操作 /v2/{project_id}/tasks/{task_id}/action/{command} { "id" : "String", "status_code" : 200, "status_msg" : "success" } 对任务ID为{task_id}的任务做启动操作 /v2/{project_id}/tasks/{task_id}/action/{command} { "id" : "String", "status_code" : 200, "status_msg" : "success" }
  • 请求示例 任务修改接口,用于修改任务配置(支持修改任务名称,视频源,调度模式,输出配置) /v2/{project_id}/tasks/{task_id} { "name" : "TestA", "input" : { "type" : "video_source", "data" : [ { "video_source_id" : "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" } ] }, "output" : { "webhook" : { "url" : "http://test", "headers" : { "a" : "a" } } }, "config" : { "common" : { } }, "priority" : "low", "service_version" : "1.1", "manufacturer" : "VIAS", "is_saved_as_template" : false }
  • 响应参数 状态码: 400 表13 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议 状态码: 500 表14 响应Body参数 参数 参数类型 描述 error_code String 错误码 error_msg String 错误信息描述 detail String 错误详情 params Array of strings 错误参数列举 数组长度:0 - 1 reason String 错误原因 advice String 建议
  • URI PUT /v2/{project_id}/video-group/{video_group_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID,获取方法参见获取项目ID和名称 video_group_id 是 String 已创建成功的视频源分组id。只能由小写英文字母(a~z)、数字(0~9)、中划线(-)、下划线(_)组成长度范围是[4,36]
  • 请求参数 表2 请求Header参数 参数 是否必选 参数类型 描述 X-Auth-Token 是 String 用户Token,获取方法参见认证鉴权 表3 请求Body参数 参数 是否必选 参数类型 描述 video_group_name 否 String 视频源分组名称。如不传入则不修改名称,传入则只能由中文、中划线(-)、下划线(_)、英文字母(a~z)、数字(0~9)组成长度范围为[1, 20] 最小长度:1 最大长度:20 description 否 String 描述。如不传入则不修改描述。 最大长度:100 video_source_ids 是 Array of strings 分组中的视频源id集。id个数需在1~50,每个id只能由小写英文字母(a~z,)、数字(0~9)、中划线(-)、下划线(_)组成长度范围为[4, 36] 数组长度:1 - 50
  • 请求示例 修改视频源分组请求体 /v2/{project_id}/video-group/{video_group_id} { "video_source_ids" : [ "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx", "xxxxxxx-xxxxxxx-xxxxxxx-xxxxx-xxxxxx" ], "video_group_name" : "test000", "description" : "" }
  • URI DELETE /v2/{project_id}/source/{video_source_id} 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID,获取方法参见获取项目ID和名称 最大长度:64 video_source_id 是 String 已创建成功的视频源id,只能由小写英文字母(a~z)、数字(0~9)组成、 中划线(-)、下划线(_)长度范围为[4, 36] 最大长度:36
  • 响应参数 状态码: 200 表3 响应Body参数 参数 参数类型 描述 service_id String 服务ID service_name String 服务名称 logo String 算法图标,Base64编码格式的字符串,非空时返回 function_version String 功能版本 release_flag Boolean 是否已发布,取值为“true”或者“false” description String 算法描述,非空时返回 created_at Long 创建时间 updated_at Long 更新时间 release_at Long 发布时间 api String API pool_id String 资源池ID alg_name String 算法名称 alg_id String 算法ID request_mode String 请求模式,取值为“sync”或者“async” package_name String 算法包名称 package_id String 算法包ID alg_version String 算法版本 alg_versions Array of strings 算法历史版本 diagram String 算法场景图,Base64编码格式的字符串,非空时返回 service_api_list Array of ServiceApiDto objects 服务API列表 deployment_constraints DeploymentConstraintsDto object 模型部署约束 company String 厂商名称 tags Array of strings 应用场景标签 deploy_type String 部署类型,取值为“cloud”或者“edge” alg_class String 算法类别,取值为“self”或者“partner” alg_status String 算法状态,取值为“service_running”、“service_deploying”、“service_failed”、“service_stopping”、“service_stopped”、“service_upgrading”、“service_finished”、“service_concerning”或者“not_deployed” error_msg String 服务异常信息,非空时返回 表4 ServiceApiDto 参数 参数类型 描述 request_type String 请求类型,get, post zh String 中文描述 en String 英文描述 request_url String 请求url 表5 DeploymentConstraintsDto 参数 参数类型 描述 request_mode String 请求模式,取值为“sync”或者“async” cpu_type String CPU类型,取值为“x86_64”或者“aarch64” accelerators Array of AcceleratorsDto objects 推理加速卡 input_types Array of strings 支持的输入类型,列表元素取值为“OBS”、“URL”、“Restful”、“VCN”、“EdgeCamera” output_types Array of strings 支持的输出类型,列表元素取值为“OBS”、“DIS”或者“Webhook” service_config String 服务启动参数 task_config String 作业配置参数 表6 AcceleratorsDto 参数 参数类型 描述 type String 加速卡类型 最小长度:1 最大长度:256 name String 加速卡名称 最小长度:1 最大长度:256 cuda_version String CUDA版本 最小长度:1 最大长度:256 driver_version_section String 昇腾驱动版本 最小长度:1 最大长度:256
  • 响应示例 状态码: 200 获取边缘资源池列表响应体 { "count" : 2, "edge_pools" : [ { "id" : "xxx", "name" : "test1", "state" : "Running", "project_id" : "xxx", "workspace_id" : "0", "created_at" : 1685611513591, "updated_at" : 1685611513591 }, { "id" : "xxx", "name" : "test2", "state" : "Running", "project_id" : "xxx", "workspace_id" : "0", "created_at" : 1683344661036, "updated_at" : 1683344661036 } ] }
  • URI GET /v2/{project_id}/edge-pools 表1 路径参数 参数 是否必选 参数类型 描述 project_id 是 String 用户项目ID,获取方法参见获取项目ID和名称 表2 Query参数 参数 是否必选 参数类型 描述 is_paged 否 Boolean 是否分页 缺省值:false page_size 否 Integer 第几页 最小值:1 最大值:1000 缺省值:100 page_num 否 Integer 页大小 最小值:1 最大值:10000 缺省值:1 name_like 否 String 模糊查询名称,满足正则表达式^[a-z0-9-]{1,30}$ order_by 否 String 排序方式,根据传入的sort_name的值进行正序或倒序地排序。asc为正序,desc为倒序。 枚举值: asc desc 缺省值:desc sort_name 否 String 排序字段。枚举值: created_at updated_at 缺省值:created_at state 否 String 状态筛选,单选。枚举值: Running Abnormal
共100000条