新增媒體工作流程,定義媒體工作流程的拓撲結構(DAG),定義活動以及依賴關係。

说明 關於活動詳情,參見 活動

請求參數

名稱 類型 是否必須 描述
Action String 操作介面名,系統規定參數,取值:AddMediaWorkflow
Name String 媒體工作流程名稱。
  • 不可為空串,
  • 不可重複,
  • 不超過64個字元,
  • utf-8編碼。
Topology String 媒體工作流程拓撲結構。

Json對象,包括活動列表及活動依賴,見Topology樣本。

TriggerMode String 觸發模式。

範圍:OssAutoTrigger、NotInAuto

Topology樣本
{
  "Activities": {
    "Act-Transcode-M3U8": {
      "Parameters": {
        "Outputs": [
          {
            "OutputObject": "transcode%2F%7BObjectPrefix%7D%7BFileName%7D",
            "TemplateId": "957d1719ee85ed6527b90cf62726cbef"
          }
        ],
        "OutputBucket": "panda-vod-hls",
        "OutputLocation": "oss-cn-hangzhou"
      },
      "Type": "Transcode"
    },
    "Act-Start": {
      "Name": "Act-Start",
      "Parameters": {
        "PipelineId": "130266f58161436a80bf07cb12c8009a",
        "InputFile": {
          "Bucket": "panda-vod",
          "Location": "oss-cn-hangzhou"
        }
      },
      "Type": "Start"
    },
    "Act-Report": {
      "Name": "Act-Report",
      "Parameters": {
      },
      "Type": "Report"
    }
  },
  "Dependencies": {
    "Act-Transcode-M3U8": [
      "Act-Report"
    ],
    "Act-Start": [
      "Act-Transcode-M3U8"
    ],
    "Act-Report": [
    ]
  }
}

返回參數

名稱 類型 描述
MediaWorkflow MediaWorkflow 媒體工作流程

樣本

請求樣本
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&<公用參數>

返回樣本

XML
<AddMediaWorkflowResponse> 
      <RequestId>F1D21261-ADB9-406A-BF6F-491382139D59</RequestId>  
      <MediaWorkflow> 
        <CreationTime>2016-04-01T05:29:37Z</CreationTime>  
        <Name>mediaworkflow-test</Name>  
        <State>Inactive</State>  
        <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>  
        <MediaWorkflowId>e00732b977da427d9177a4dee646b1aa</MediaWorkflowId> 
      </MediaWorkflow> 
    </AddMediaWorkflowResponse>
JSON
{
        "RequestId": "F1D21261-ADB9-406A-BF6F-491382139D59",
        "MediaWorkflow": {
            "CreationTime": "2016-04-01T05:29:37Z",
            "Name": "mediaworkflow-test",
            "State": "Inactive",
            "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\"]}}",
            "MediaWorkflowId": "93ab850b4f6f44eab54b6e91d24d81d4"
        }
    }