Membuat alur kerja media.
Deskripsi operasi
You can call this operation to define the topology, activities, and dependencies of a media workflow. The topology is represented by a directed acyclic graph (DAG) in the console. For more information, see Workflow activities. You can view and run the workflows that are created by calling this operation in the ApsaraVideo Media Processing (MPS) console.
MPS media workflows can be automatically triggered only by using the prefix of the file path. Automatic triggering by using the suffix is not supported. For more information about the trigger rules, see Workflow triggering rules for files.
QPS limits
You can call this API operation up to 100 times per second per account. Requests that exceed this limit are dropped, and you will experience service interruptions. We recommend that you take note of this limit when you call this operation. For more information, see QPS limits.
Coba sekarang
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
mts:AddMediaWorkflow |
create |
*全部资源
|
None | None |
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| Name |
string |
Yes |
Nama alur kerja media.
|
mediaworkflow-example |
| Topology |
string |
Yes |
Topologi Alur kerja media. Nilai harus berupa objek JSON yang berisi aktivitas dan dependensi aktivitas. Untuk informasi lebih lanjut, lihat bagian Topologi contoh pada topik ini. Catatan
Bucket Object Storage Service (OSS) harus berada di wilayah yang sama dengan layanan MPS Anda. |
{"Activities": {"mediaworkflow-example": {"Parameters": {"Outputs": "[{\"OutputObject\":\"examplebucket/output/{RunId}/TRANSCODE_165941222****/{FileName}\",\"TemplateId\":\"S00000001-200010\",\"TemplateName\":\"MP4-流畅\"}]","OutputBucket": "examplebucket","OutputLocation": "oss-cn-shanghai"},"Type": "Transcode"},"Act-Start": {"Parameters": {"PipelineId": "a7d481f07d8c45da88c71853ce7d****","InputFile": "{\"Bucket\":\"example-input\",\"Location\":\"oss-cn-shanghai\",\"ObjectPrefix\":\"mps-test/input/\"}"},"Type": "Start"},"Act-Report": {"Parameters": {"PublishType": "Manual"},"Type": "Report"}},"Dependencies": {"mediaworkflow-example": ["Act-Report"],"Act-Start": ["mediaworkflow-example"],"Act-Report": []}} |
| TriggerMode |
string |
No |
Mode pemicu alur kerja media. Nilai valid:
|
OssAutoTrigger |
Topologi contoh.
Bucket OSS harus berada di wilayah yang sama dengan layanan MPS Anda.
{
"Activities": {
"mediaworkflow-example": {
"Parameters": {
"Outputs": "[{\"OutputObject\":\"examplebucket/output/{RunId}/TRANSCODE_165941222****/{FileName}\",\"TemplateId\":\"S00000001-200010\",\"TemplateName\":\"MP4-Low definition\"}]",
"OutputBucket": "examplebucket",
"OutputLocation": "oss-cn-shanghai"
},
"Type": "Transcode"
},
"Act-Start": {
"Parameters": {
"PipelineId": "a7d481f07d8c45da88c71853ce7d****",
"InputFile": "{\"Bucket\":\"example-input\",\"Location\":\"oss-cn-shanghai\",\"ObjectPrefix\":\"mps-test/input/\"}"
},
"Type": "Start"
},
"Act-Report": {
"Parameters": {
"PublishType": "Manual"
},
"Type": "Report"
}
},
"Dependencies": {
"mediaworkflow-example": ["Act-Report"],
"Act-Start": ["mediaworkflow-example"],
"Act-Report": []
}
}
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
The response parameters. |
||
| RequestId |
string |
The request ID. |
F1D21261-ADB9-406A-1234-491382139D59 |
| MediaWorkflow |
object |
The information about the media workflow. |
|
| CreationTime |
string |
The time when the media workflow was created. |
016-04-01T05:29:37Z |
| MediaWorkflowId |
string |
The ID of the media workflow. We recommend that you keep this ID for later operations on this workflow. |
e00732b977da427d9177a4deb1aa**** |
| State |
string |
The state of the media workflow. By default, the created workflow is in the Active state. |
Active |
| TriggerMode |
string |
The triggering mode of the media workflow. Valid values:
|
OssAutoTrigger |
| Name |
string |
The name of the media workflow. |
mediaworkflow-example |
| Topology |
string |
The topology of the media workflow. The value is a JSON object that contains the activities and activity dependencies. |
{"Activities": {"mediaworkflow-example": {"Parameters": {"Outputs": "[{\"OutputObject\":\"examplebucket/output/{RunId}/TRANSCODE_165941222****/{FileName}\",\"TemplateId\":\"S00000001-200010\",\"TemplateName\":\"MP4-流畅\"}]","OutputBucket": "examplebucket","OutputLocation": "oss-cn-shanghai"},"Type": "Transcode"},"Act-Start": {"Parameters": {"PipelineId": "a7d481f07d8c45da88c71853ce7d****","InputFile": "{\"Bucket\":\"example-input\",\"Location\":\"oss-cn-shanghai\",\"ObjectPrefix\":\"mps-test/input/\"}"},"Type": "Start"},"Act-Report": {"Parameters": {"PublishType": "Manual"},"Type": "Report"}},"Dependencies": {"mediaworkflow-example": ["Act-Report"],"Act-Start": ["mediaworkflow-example"],"Act-Report": []}} |
Contoh
Respons sukses
JSONformat
{
"RequestId": "F1D21261-ADB9-406A-1234-491382139D59",
"MediaWorkflow": {
"CreationTime": "016-04-01T05:29:37Z",
"MediaWorkflowId": "e00732b977da427d9177a4deb1aa****",
"State": "Active",
"TriggerMode": "OssAutoTrigger",
"Name": "mediaworkflow-example",
"Topology": "{\"Activities\": {\"mediaworkflow-example\": {\"Parameters\": {\"Outputs\": \"[{\\\"OutputObject\\\":\\\"examplebucket/output/{RunId}/TRANSCODE_165941222****/{FileName}\\\",\\\"TemplateId\\\":\\\"S00000001-200010\\\",\\\"TemplateName\\\":\\\"MP4-流畅\\\"}]\",\"OutputBucket\": \"examplebucket\",\"OutputLocation\": \"oss-cn-shanghai\"},\"Type\": \"Transcode\"},\"Act-Start\": {\"Parameters\": {\"PipelineId\": \"a7d481f07d8c45da88c71853ce7d****\",\"InputFile\": \"{\\\"Bucket\\\":\\\"example-input\\\",\\\"Location\\\":\\\"oss-cn-shanghai\\\",\\\"ObjectPrefix\\\":\\\"mps-test/input/\\\"}\"},\"Type\": \"Start\"},\"Act-Report\": {\"Parameters\": {\"PublishType\": \"Manual\"},\"Type\": \"Report\"}},\"Dependencies\": {\"mediaworkflow-example\": [\"Act-Report\"],\"Act-Start\": [\"mediaworkflow-example\"],\"Act-Report\": []}}"
}
}
Kode kesalahan
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.