A trigger initiates data processing tasks for matched incremental objects stored in an Object Storage Service (OSS) bucket. For example, you can create a trigger that converts incremental DOCX objects in a specific directory of a bucket into PDF objects or transcodes incremental MOV objects into MP4 objects. Unlike a batch processor, a trigger initiates tasks only for incremental objects in a bucket, not for existing objects in the bucket.
You can use the features of the new version of Intelligent Media Management (IMM) in all supported regions by calling API operations or using SDKs.
Usage notes
A trigger initiates data processing tasks for all objects that meet the specified conditions. After you create a trigger, you can upload several objects to test the trigger.
If you suspend a trigger, the trigger no longer initiates new data processing tasks. However, tasks that have already been submitted remain unaffected.
To prevent unexpected behaviors, such as trigger loops and overwriting of source objects, avoid specifying an output path that begins with the input path.
The output path cannot end with a forward slash (
/
). The output path must contain the object name with an extension. Variables can be used in the object name. For more information about variables, see Variables.The output path must include at least one variable. Otherwise, output objects may overwrite each other.
If you use the {key}, {barename}, or {basename} variable as the output path, make sure that the output path is different from the input path. Otherwise, source objects are overwritten or the tasks run in a loop.
Output objects of a trigger cannot serve as input objects for another trigger.
Triggers support only Standard objects.
Create a trigger
In the left-side navigation pane, click Buckets. On the Buckets page, click the name of the bucket.
In the left-side navigation tree, click Data Processing.
Click Document Processing, Media Processing, or other data processing capabilities provided by IMM based on your business requirements. In this example, Document Processing is used.
Click the Trigger tab. Then, click Create Trigger.
In the Create Trigger panel, configure parameters in the Input Configuration, Output Configuration, Permission Configuration, and Notification Configuration section.
Parameter
Description
Input Storage Bucket
The name of the bucket that contains the objects to be processed.
Path Prefix
The path prefix of the objects to be processed.
Filter Rule
The filter for filtering objects within the specified path prefix
All: All objects in the directory specified by the Path Prefix parameter are processed.
Prefix: Objects whose names contain a specific prefix in the directory specified by the Path Prefix parameter are processed. To specify multiple prefixes, separate them with commas (,).
Suffix: Objects whose names contain a specific suffix in the directory specified by the Path Prefix parameter are processed. To specify multiple suffixes, separate them with commas (,).
Style
The style that you want to use to process objects. If no style is available, select Add Style from the drop-down list to create a style.
Output Path
The storage path of the processed objects.
The storage path cannot end with a forward slash (/). We recommend that you use variables in the output path. Otherwise, multiple output objects may overwrite each other. For more information, see Variables.
Service Role
The service role. IMM assumes the service role to access resources in other cloud services, such as OSS. We recommend that you select
AliyunIMMBatchTriggerRole
. You can create the AliyunIMMBatchTriggerRole role on the Cloud Resource Access Authorization page.Message Queue
The Simple Message Queue (SMQ) topic to which you want to send the task notification. For more information, see Overview.
Click OK.
After a trigger is created, a corresponding data processing task is initiated for each matched incremental object in the bucket. Data processing tasks generate corresponding fees. For more information, see Billable items.
Query a trigger
Log on to the OSS console.
In the left-side navigation tree, click Data Processing and then click the type of the task, such as Document Processing or Media Processing.
Click the Trigger tab.
The following table describes the trigger status.
Status
Description
Ready
The trigger is ready.
Running
The trigger is running.
Succeeded
The trigger is successful.
Suspended
The trigger is suspended. The trigger no longer initiates tasks. However, the tasks that have been initiated and are not completed will continue to run.
Failed
The trigger failed.
Enter the ID of the trigger in the Trigger ID search box to search for a specific trigger.
To view the details of the trigger, click View Details in the Actions column.
Click the icon next to the trigger ID to view information about all data processing tasks that are initiated by the trigger. You can search for a data processing task based on the source object path and status.