功能说明
数据万象支持自定义设置回调 URL,在任务完成后,系统向该 URL 发送 HTTP POST 请求,请求体中包含通知内容。您可通过配置的回调地址及时了解任务处理的进展和状态,以便进行其他业务操作。
回调内容
任务完成后,系统会向您设置的回调地址发送回调内容,包含完整节点数据的内容展示如下:
TaskFinish
Success 2022-06-30T19:55:05+0800 2022-06-30T19:55:19+0800 test-123456789 input/demo.mp4 ap-chongqing j7b0dfbe2f86b11ec995acf5cffaf6664 14044.868000 2.067000 QuickTime / MOV mov,mp4,m4a,3gp,3g2,mj2 0 2 3628843 0.000000 126.400000 2 stereo AAC (Advanced Audio Coding) aac 0x6134706d mp4a 1/44100 2.066576 1 und fltp 44100 0.000000 1/44100 25.000000 14664.836000 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 h264 0x31637661 avc1 1/90000 bt470bg tv smpte170m 1.960000 25.000000 2 960 0 und 41 49 yuv420p High 1 0.000000 0.086000 1/90000 544 test-123456789 6080b31ea94defa6c19cc4def539a291 output/videoMontage.mp4 output/videoMontage.mp4 ap-chongqing test-123456789 output/videoMontage.${ext} ap-chongqing t164ac18da8bdc403fa27ac4b077a962a1 videoMontage This is my VideoMontage job. 0 p09d709939fef48a0a5c247ef39d90cec 2022-06-30T19:55:05+0800 Success VideoMontage
具体的数据内容如下:
节点名称(关键字) | 父节点 | 描述 | 类型 |
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:通过任务接口触发的任务回调
TaskFinish
Success 2022-06-30T19:55:05+0800 2022-06-30T19:55:19+0800 test-123456789 input/demo.mp4 ap-chongqing j7b0dfbe2f86b11ec995acf5cffaf6664 14044.868000 2.067000 QuickTime / MOV mov,mp4,m4a,3gp,3g2,mj2 0 2 3628843 0.000000 126.400000 2 stereo AAC (Advanced Audio Coding) aac 0x6134706d mp4a 1/44100 2.066576 1 und fltp 44100 0.000000 1/44100 25.000000 14664.836000 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 h264 0x31637661 avc1 1/90000 bt470bg tv smpte170m 1.960000 25.000000 2 960 0 und 41 49 yuv420p High 1 0.000000 0.086000 1/90000 544 test-123456789 6080b31ea94defa6c19cc4def539a291 output/videoMontage.mp4 output/videoMontage.mp4 ap-chongqing test-123456789 output/videoMontage.${ext} ap-chongqing t164ac18da8bdc403fa27ac4b077a962a1 videoMontage This is my VideoMontage job. 0 p09d709939fef48a0a5c247ef39d90cec 2022-06-30T19:55:05+0800 Success VideoMontage
案例 2:通过工作流触发的任务回调
TaskFinish
Success 2022-06-30T19:55:05+0800 2022-06-30T19:55:19+0800 test-123456789 input/demo.mp4 ap-chongqing Content-Type video/mp4 x-cos-request-id NjJiZDYwYTFfNjUzYTYyNjRfZjEwZl8xMmZhYzY5 EventName cos:ObjectCreated:Put Size 1424687 j7b0dfbe2f86b11ec995acf5cffaf6664 14044.868000 2.067000 QuickTime / MOV mov,mp4,m4a,3gp,3g2,mj2 0 2 3628843 0.000000 126.400000 2 stereo AAC (Advanced Audio Coding) aac 0x6134706d mp4a 1/44100 2.066576 1 und fltp 44100 0.000000 1/44100 25.000000 14664.836000 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 h264 0x31637661 avc1 1/90000 bt470bg tv smpte170m 1.960000 25.000000 2 960 0 und 41 49 yuv420p High 1 0.000000 0.086000 1/90000 544 test-123456789 6080b31ea94defa6c19cc4def539a291 output/videoMontage.mp4 output/videoMontage.mp4 ap-chongqing test-123456789 output/videoMontage.${ext} ap-chongqing t164ac18da8bdc403fa27ac4b077a962a1 videoMontage This is my VideoMontage job. 0 p09d709939fef48a0a5c247ef39d90cec 2022-06-30T19:55:05+0800 Success VideoMontage VideoMontage_1581665960537 ic90edd59f84f11ec9d4f525400a3c59f web6ac56c1ef54dbfa44d7f4103203be9 workflow-test
案例 3:通过工作流触发的任务回调, 格式为 JSON
{ "EventName": "TaskFinish", "JobsDetail": [{ "Code": "Success", "CreationTime": "2022-06-30T19:55:05+0800", "EndTime": "2022-06-30T19:55:19+0800", "Input": { "BucketId": "test-123456789", "Object": "input/demo.mp4", "Region": "ap-chongqing", "CosHeaders": [{ "Key": "Content-Type", "Value": "video/mp4" }, { "Key": "x-cos-request-id", "Value": "NjJiZDYwYTFfNjUzYTYyNjRfZjEwZl8xMmZhYzY5" }, { "Key": "EventName", "Value": "cos:ObjectCreated:Put" }, { "Key": "Size", "Value": "1424687" } ] }, "JobId": "j7b0dfbe2f86b11ec995acf5cffaf6664", "Operation": { "MediaInfo": { "Format": { "Bitrate": "14044.868000", "Duration": "2.067000", "FormatLongName": "QuickTime / MOV", "FormatName": "mov,mp4,m4a,3gp,3g2,mj2", "NumProgram": "0", "NumStream": "2", "Size": "3628843", "StartTime": "0.000000" }, "Stream": { "Audio": [{ "Bitrate": "126.400000", "Channel": "2", "ChannelLayout": "stereo", "CodecLongName": "AAC (Advanced Audio Coding)", "CodecName": "aac", "CodecTag": "0x6134706d", "CodecTagString": "mp4a", "CodecTimeBase": "1/44100", "Duration": "2.066576", "Index": "1", "Language": "und", "SampleFmt": "fltp", "SampleRate": "44100", "StartTime": "0.000000", "Timebase": "1/44100" }], "Video": [{ "AvgFps": "25.000000", "Bitrate": "14664.836000", "CodecLongName": "H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10", "CodecName": "h264", "CodecTag": "0x31637661", "CodecTagString": "avc1", "CodecTimeBase": "1/90000", "ColorPrimaries": "bt470bg", "ColorRange": "tv", "ColorTransfer": "smpte170m", "Duration": "1.960000", "Fps": "25.000000", "HasBFrame": "2", "Height": "960", "Index": "0", "Language": "und", "Level": "41", "NumFrames": "49", "PixFormat": "yuv420p", "Profile": "High", "RefFrames": "1", "Rotation": "0.000000", "StartTime": "0.086000", "Timebase": "1/90000", "Width": "544" }] } }, "MediaResult": { "OutputFile": { "Bucket": "test-123456789", "Md5Info": [{ "Md5": "6080b31ea94defa6c19cc4def539a291", "ObjectName": "output/videoMontage.mp4" }], "ObjectName": ["output/videoMontage.mp4"], "Region": "ap-chongqing" } }, "Output": { "Bucket": "test-123456789", "Object": "output/videoMontage.${ext}", "Region": "ap-chongqing" }, "TemplateId": "t164ac18da8bdc403fa27ac4b077a962a1", "TemplateName": "videoMontage", "UserData": "This is my VideoMontage job.", "JobLevel": 0 }, "QueueId": "p09d709939fef48a0a5c247ef39d90cec", "StartTime": "2022-06-30T19:55:05+0800", "State": "Success", "Tag": "VideoMontage", "Workflow": { "Name": "VideoMontage_1581665960537", "RunId": "ic90edd59f84f11ec9d4f525400a3c59f", "WorkflowId": "web6ac56c1ef54dbfa44d7f4103203be9", "WorkflowName": "workflow-test" } }]}
对象存储官网1折活动,限时活动,即将结束,速速收藏
同尘科技为腾讯云授权服务中心。
购买腾讯云产品享受折上折,更有现金返利。同意关联立享优惠
转转请注明出处:https://www.yunxiaoer.com/145157.html