Help Center/
FunctionGraph/
User Guide (Kuala Lumpur Region)/
Creating Triggers/
Using an OBS Trigger
Updated on 2024-08-07 GMT+08:00
Using an OBS Trigger
Prerequisites
Before creating a trigger, ensure that you have prepared the following:
- You have created a function. For details, see Creating a Function from Scratch.
- You have created an OBS bucket, for example, obs_cff.
Creating an OBS Trigger
- Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
- Click the function to be configured to go to the function details page.
- Choose Configuration > Triggers and click Create Trigger.
Figure 1 Creating a 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 a Function
On the OBS console, upload an image ZIP package to the obs-cff bucket.
![](https://support.huaweicloud.com/intl/en-us/my-kualalumpur-1-usermanual-functiongraph/public_sys-resources/note_3.0-en-us.png)
After the ZIP package is uploaded to the obs-cff bucket, the HelloWorld function is triggered.
Viewing the Execution Result
- Return to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
- Click a function to go to the function details page.
- Choose Monitoring > Logs to query function running logs.
Parent topic: Creating Triggers
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot