Using an OBS Trigger
For details about the OBS event source, see Supported Event Sources.
Prerequisites
Before creating an OBS trigger, make sure you have prepared the following:
- You have created a function on FunctionGraph. For details, see Creating and Initializing a Function.
- You have created an OBS bucket, for example, obs_cff. For details, see Creating a Bucket.
Creating an OBS Trigger
- Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
- Click the HelloWorld function.
- On the displayed function details page, click the Triggers tab.
- Click Create Trigger.
- Set the following parameters:
- Trigger Type: Select Object Storage Service (OBS).
- Bucket Name: Specify the OBS bucket to be used as an event source, for example, obs-cff.
- Events: Select events that will trigger the function. In this example, select Put, Post, and Delete. When files in the obs_cff bucket are updated, uploaded, or deleted, the function is triggered.
- Event Notification Name: Specify the name of the event notification to be sent by SMN when an event occurs.
- Prefix: Enter a keyword for limiting notifications to those about objects whose names start with the matching characters. This limit can be used to filter the names of OBS objects.
- Suffix: Enter a keyword for limiting notifications to those about objects whose names end with the matching characters. This limit can be used to filter the names of OBS objects.
- Click OK.
Triggering the Function
On the OBS console, upload an image ZIP package to the obs-cff bucket. For details, see Uploading a File.
After the ZIP package is uploaded to the obs-cff bucket, the HelloWorld function is triggered.
Viewing the Execution Result
- Log in to the FunctionGraph console, and choose Functions > Function List in the navigation pane.
- Click the HelloWorld function.
- On the displayed function details page, click the Logs tab to query the function running logs.
- Click View Context in the same row as a log to view log details.
Last Article: Using an APIG Trigger
Next Article: Using a DIS Trigger
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.