视频智能分析服务 VIAS-创建任务:请求示例

时间:2025-02-12 14:54:47

请求示例

  • 创建输入类型为“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"}
support.huaweicloud.com/vias-api/CreateTask.html