An Object Storage Service (OSS) event trigger can automatically trigger a function when an OSS event occurs, and then perform custom data processing in OSS based on your function logic. This topic uses an example where a function is triggered when an image is stored into an OSS bucket, to describe how to configure an OSS event trigger.
You can configure an OSS event trigger and set the prefix to
source/ in the trigger rule. When an image is stored in the
source/ directory of a specified OSS bucket, a function is automatically triggered, which will zoom in or out and store the image in the
processed/ directory of the same bucket. Specifically,
source/serverless.png is processed into
Configure a trigger
Function Compute allows you to configure a trigger in multiple ways:
- Configure a trigger in the Function Compute console.
- Use Funcraft to configure a trigger. For more information, see Funcraft.
- Use fcli to configure a trigger. For more information, see fcli.
- Configure a trigger by using the SDK. For more information, see SDK list.