edit-icon download-icon

AddMediaWorkflow

Last Updated: Apr 20, 2018

Description

The AddMediaWorkflow API adds a media workflow and defines the topology of the media workflow, and Activity and dependencies.

Request parameters

Parameter Type Required or not Description
Action String Yes API of the action, system required parameter. Set this parameter to AddMediaWorkflow.
Name String Yes Media workflow name, which consists of up to 64 bytes. It must be UTF-8 encoded and cannot be a null string. The name must be unique.
Topology String Yes Topology of the media workflow, which is a JSON object. The topology includes the activity list and activity dependencies, as shown in the following topology example.
TriggerMode String No Trigger mode. Range: OssAutoTrigger, NotInAuto.

Topology example

  1. {
  2. "Activities": {
  3. "Act-Transcode-M3U8": {
  4. "Parameters": {
  5. "Outputs": [
  6. {
  7. "OutputObject": "transcode%2F%7BObjectPrefix%7D%7BFileName%7D",
  8. "TemplateId": "957d1719ee85ed6527b90cf62726cbef"
  9. }
  10. ],
  11. "OutputBucket": "panda-vod-hls",
  12. "OutputLocation": "oss-cn-hangzhou"
  13. },
  14. "Type": "Transcode"
  15. },
  16. "Act-Start": {
  17. "Name": "Act-Start",
  18. "Parameters": {
  19. "PipelineId": "130266f58161436a80bf07cb12c8009a",
  20. "InputFile": {
  21. "Bucket": "panda-vod",
  22. "Location": "oss-cn-hangzhou"
  23. }
  24. },
  25. "Type": "Start"
  26. },
  27. "Act-Report": {
  28. "Name": "Act-Report",
  29. "Parameters": {
  30. },
  31. "Type": "Report"
  32. }
  33. },
  34. "Dependencies": {
  35. "Act-Transcode-M3U8": [
  36. "Act-Report"
  37. ],
  38. "Act-Start": [
  39. "Act-Transcode-M3U8"
  40. ],
  41. "Act-Report": [
  42. ]
  43. }
  44. }

Return parameters

Name Type Description
MediaWorkflow MediaWorkflow Media workflow

Example

Request example

  1. https://mts.cn-hangzhou.aliyuncs.com/?Name=mediaworkflow-test&Action=AddMediaWorkflow&Topology=%7B%22Activities%22%3A%7B%22Act-Start%22%3A%7B%22Parameters%22%3A%7B%22PipelineId%22%3A%22130266f58161436a80bf07cb12c8009a%22%2C%22InputFile%22%3A%22%7B%5C%22Bucket%5C%22%3A+%5C%22panda-vod%5C%22%2C%5C%22Location%5C%22%3A+%5C%22oss-cn-hangzhou%5C%22%7D%22%7D%2C%22Type%22%3A%22Start%22%7D%2C%22Act-Report%22%3A%7B%22Parameters%22%3A%7B%7D%2C%22Type%22%3A%22Report%22%7D%2C%22Act-Transcode-M3U8%22%3A%7B%22Parameters%22%3A%7B%22Outputs%22%3A%22%5B%7B%5C%22OutputObject%5C%22%3A%5C%22transcode%252F%257BObjectPrefix%257D%257BFileName%257D%5C%22%2C%5C%22TemplateId%5C%22%3A+%5C%22957d1719ee85ed6527b90cf62726cbef%5C%22%7D%5D%22%2C%22OutputBucket%22%3A%22panda-vod-hls%22%2C%22OutputLocation%22%3A%22oss-cn-hangzhou%22%7D%2C%22Type%22%3A%22Transcode%22%7D%7D%2C%22Dependencies%22%3A%7B%22Act-Start%22%3A%5B%22Act-Transcode-M3U8%22%5D%2C%22Act-Report%22%3A%5B%5D%2C%22Act-Transcode-M3U8%22%3A%5B%22Act-Report%22%5D%7D%7D&<Public parameter>

Return example

XML

  1. <AddMediaWorkflowResponse>
  2. <RequestId>F1D21261-ADB9-406A-BF6F-491382139D59</RequestId>
  3. <MediaWorkflow>
  4. <CreationTime>2016-04-01T05:29:37Z</CreationTime>
  5. <Name>mediaworkflow-test</Name>
  6. <State>Inactive</State>
  7. <Topology>{"Activities":{"Act-Start":{"Parameters":{"PipelineId":"130266f58161436a80bf07cb12c8009a","InputFile":"{\"Bucket\": \"panda-vod\",\"Location\": \"oss-cn-hangzhou\"}"},"Type":"Start"},"Act-Report":{"Parameters":{},"Type":"Report"},"Act-Transcode-M3U8":{"Parameters":{"Outputs":"[{\"OutputObject\":\"transcode%2F%7BObjectPrefix%7D%7BFileName%7D\",\"TemplateId\": \"957d1719ee85ed6527b90cf62726cbef\"}]","OutputBucket":"panda-vod-hls","OutputLocation":"oss-cn-hangzhou"},"Type":"Transcode"}},"Dependencies":{"Act-Start":["Act-Transcode-M3U8"],"Act-Report":[],"Act-Transcode-M3U8":["Act-Report"]}}</Topology>
  8. <MediaWorkflowId>e00732b977da427d9177a4dee646b1aa</MediaWorkflowId>
  9. </MediaWorkflow>
  10. </AddMediaWorkflowResponse>

JSON

  1. {
  2. "RequestId": "F1D21261-ADB9-406A-BF6F-491382139D59",
  3. "MediaWorkflow": {
  4. "CreationTime": "2016-04-01T05:29:37Z",
  5. "Name": "mediaworkflow-test",
  6. "State": "Inactive",
  7. "Topology": "{\"Activities\":{\"Act-Start\":{\"Parameters\":{\"PipelineId\":\"130266f58161436a80bf07cb12c8009a\",\"InputFile\":\"{\\\"Bucket\\\": \\\"panda-vod\\\",\\\"Location\\\": \\\"oss-cn-hangzhou\\\"}\"},\"Type\":\"Start\"},\"Act-Report\":{\"Parameters\":{},\"Type\":\"Report\"},\"Act-Transcode-M3U8\":{\"Parameters\":{\"Outputs\":\"[{\\\"OutputObject\\\":\\\"transcode%2F%7BObjectPrefix%7D%7BFileName%7D\\\",\\\"TemplateId\\\": \\\"957d1719ee85ed6527b90cf62726cbef\\\"}]\",\"OutputBucket\":\"panda-vod-hls\",\"OutputLocation\":\"oss-cn-hangzhou\"},\"Type\":\"Transcode\"}},\"Dependencies\":{\"Act-Start\":[\"Act-Transcode-M3U8\"],\"Act-Report\":[],\"Act-Transcode-M3U8\":[\"Act-Report\"]}}",
  8. "MediaWorkflowId": "93ab850b4f6f44eab54b6e91d24d81d4"
  9. }
  10. }
Thank you! We've received your feedback.