功能说明
数据万象支持自定义设置回调 URL,在任务完成后,系统向该 URL 发送 HTTP POST 请求,请求体中包含通知内容。您可通过配置的回调地址及时了解任务处理的进展和状态,以便进行其他业务操作。
回调内容
任务完成后,系统会向您设置的回调地址发送回调内容,包含完整节点数据的内容展示如下:
TaskFinish
Success 2023-05-06T16:04:13+0800 2023-05-06T16:04:41+0800 testpic-1253960454 test.mp4 ap-chongqing j96ca39faebe411eda9b5********* 0 0 0.000000 5.320000 1 5.320000 13.280000 2 13.280000 16.799999 3 16.799999 20.040001 4 20.040001 24.440001 5 24.440001 104.400002 6 104.400002 105.480003 7 105.480003 123.120003 8 123.120003 134.600006 9 134.600006 137.479996 SHOTDETECT p5f30ea2dad4443a08d53c6e2351ca31e 2023-05-06T16:04:14+0800 Success SplitVideoParts
具体的数据内容如下:
节点名称(关键字) | 父节点 | 描述 | 类型 |
Response | 无 | 保存结果的容器 | Container |
Container 节点 Response 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 |
EventName | Response | 固定值,为 TaskFinish | String |
JobsDetail | Response | 同提交视频拆条接口中的 Response.JobsDetail | Container 数组 |
如果任务是通过工作流触发的,Response.JobsDetail.Input 还会包含 CosHeaders 节点,类型为 Container 数组。Container 节点 CosHeaders 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 |
Key | Response.JobsDetail.Input.CosHeaders | 自定义 Header 的名称 | String |
Value | Response.JobsDetail.Input.CosHeaders | 自定义 Header 的值 | String |
如果任务是通过工作流触发的,Response.JobsDetail 还会包含 Workflow 节点,类型为 Container。Container 节点 Workflow 的内容:
节点名称(关键字) | 父节点 | 描述 | 类型 |
RunId | Response.Workflow | 工作流实例 ID | String |
WorkflowId | Response.Workflow | 工作流 ID | String |
WorkflowName | Response.Workflow | 工作流名称 | String |
Name | Response.Workflow | 工作流节点名称 | String |
实际案例
案例 1:通过任务接口触发的任务回调
TaskFinishSuccess 2023-05-06T16:04:13+0800 2023-05-06T16:04:41+0800 testpic-1253960454 test.mp4 ap-chongqing j96ca39faebe411eda9b5********* 0 0 0.000000 5.320000 1 5.320000 13.280000 2 13.280000 16.799999 3 16.799999 20.040001 4 20.040001 24.440001 5 24.440001 104.400002 6 104.400002 105.480003 7 105.480003 123.120003 8 123.120003 134.600006 9 134.600006 137.479996 SHOTDETECT p5f30ea2dad4443a08d53c6e2351ca31e 2023-05-06T16:04:14+0800 Success SplitVideoParts
案例 2:通过任务触发的任务回调, 格式为 JSON
{ "EventName":"TaskFinish", "JobsDetail":[ { "Code":"Success", "CreationTime":"2023-05-08T14:53:35+0800", "EndTime":"2023-05-08T14:54:01+0800", "Input":{ "BucketId":"testpic-1253960454", "Object":"test.mp4", "Region":"ap-chongqing" }, "JobId":"j0d7759e6ed6d11edb28***********", "Message":"", "Operation":{ "JobLevel":"0", "SplitVideoInfoResult":{ "TimeInfo":[ { "Index":"0", "PartBegin":"0.000000", "PartEnd":"5.320000" }, { "Index":"1", "PartBegin":"5.320000", "PartEnd":"13.280000" }, { "Index":"2", "PartBegin":"13.280000", "PartEnd":"16.799999" }, { "Index":"3", "PartBegin":"16.799999", "PartEnd":"20.040001" }, { "Index":"4", "PartBegin":"20.040001", "PartEnd":"24.440001" }, { "Index":"5", "PartBegin":"24.440001", "PartEnd":"104.400002" }, { "Index":"6", "PartBegin":"104.400002", "PartEnd":"105.480003" }, { "Index":"7", "PartBegin":"105.480003", "PartEnd":"123.120003" }, { "Index":"8", "PartBegin":"123.120003", "PartEnd":"134.600006" }, { "Index":"9", "PartBegin":"134.600006", "PartEnd":"137.479996" }, ] }, "SplitVideoParts":{ "Mode":"SHOTDETECT" } }, "QueueId":"p5f30ea2dad4443a08d5*********", "StartTime":"2023-05-08T14:53:36+0800", "State":"Success", "Tag":"SplitVideoParts" } ]}
对象存储官网1折活动,限时活动,即将结束,速速收藏
同尘科技为腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利。同意关联立享优惠
转转请注明出处:https://www.yunxiaoer.com/145187.html