检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
Creating an EG Trigger (OBS Application Service) This section describes how to create an EG trigger (OBS Application Service) on the FunctionGraph console. The EG trigger triggers a function when a file in an OBS bucket is updated.
OBS Events Huawei Cloud functions can be triggered by different event sources, which can be defined and configured through events. OBS Events In this example, an OBS event is set.
Step 2: Modify the Metadata of Function: Modify the OBS address, bucket name, and file name in the function configurations. Step 3: Test the Function: Verify whether the function can successfully download files from the OBS bucket.
Upload the fss_examples_python2.7.zip package to the OBS bucket and record the link URL of the OBS bucket.
Using an OBS Trigger This section describes how to create an OBS trigger and upload an image package to a specified OBS bucket to trigger a function. For details about the OBS event source, see Supported Event Sources.
Select OBS Application Service for Trigger Type, and set the trigger information, as shown in Figure 1. Trigger Name: Customize a trigger name. Bucket Name: Select bucket-input-fg created in Creating OBS Buckets.
Parent topic: Using FunctionGraph to Encrypt and Decrypt Files in OBS
Value: OBS bucket created in Creating OBS Buckets for storing output watermark images. obs_region For example, cn-north-4. Key: region of the OBS bucket where the output watermark image is stored, which is defined in the index.py file.
To obtain the OBS endpoint, see Regions and Endpoints. Parent topic: Using FunctionGraph to Encrypt and Decrypt Files in OBS
Figure 4 Saving a flow Parent topic: Using FunctionGraph to Rotate Images Stored in OBS
with an OBS bucket.
Stored in OBS
with an OBS bucket.
For example, you can create a timer trigger to periodically analyze and process log data in an OBS bucket. Parent topic: Identifying Abnormal Service Logs in LTS and Storing Them in OBS
Preparation Before creating a function and adding an event source, you need to create two OBS buckets to respectively store uploaded and watermarked images. After creating the OBS buckets, you must create an agency to delegate FunctionGraph to access OBS resources.
Preparation Create an OBS bucket to store uploaded images. Then create an agency to delegate FunctionGraph to access OBS resources. Creating an OBS bucket The bucket and function must be in the same region.
Preparation Create two OBS buckets to store uploaded and encrypted/decrypted files, respectively. Create an agency to delegate FunctionGraph to access OBS resources.
Figure 2 Output image Figure 3 Watermarked image Parent topic: Using FunctionGraph to Watermark Images in OBS
Parent topic: Using FunctionGraph to Rotate Images Stored in OBS
Figure 2 Output file Parent topic: Using FunctionGraph to Encrypt and Decrypt Files in OBS