Updated on 2025-08-19 GMT+08:00

Object Storage Service (OBS) Trigger

This section describes how to create an OBS trigger on the FunctionGraph console to trigger a function when a file in an OBS bucket is updated.

For details about the OBS event source, see Supported Event Sources.

Supported Event Types

Multiple event types can be applied to the same target object.

Select the event type to be used by referring to Table 1.

Table 1 Event types supported by OBS

Event

Description

ObjectCreated

All kinds of object creation operations, including PUT, POST, COPY, and CompleteMultipartUpload.

Constraints: If you select ObjectCreated, the others are automatically selected and cannot be selected again.

Put

Use the PUT method to upload objects.

Post

Use the POST method to upload objects.

Copy

Use the COPY method to replicate objects.

CompleteMultipartUpload

Merge parts of multi-part tasks.

ObjectRemoved

Indicate all object deletion operations, including Delete and DeleteMarkerCreated.

Constraints: If you select ObjectRemoved, Delete and DeleteMarkerCreated are automatically selected and cannot be selected again.

Delete

Delete objects by versions.

DeleteMarkerCreated

Delete objects without specifying versions.

Video Tutorial

This video shows how to use an OBS trigger to trigger a function when a file in an OBS bucket is updated.

Notes and Constraints

  • OBS triggers are available only in CN-Hong Kong, AP-Bangkok, AP-Singapore, AP-Jakarta, LA-Mexico City2, and TR-Istanbulregions. You can check whether the trigger type is supported on the console.
  • OBS triggers cannot be disabled and can only be deleted.
  • Ensure that the created function and the OBS bucket are in the same region. Buckets created in different regions are not shared.

Prerequisites

  • You have created a function.
  • You have created an OBS bucket. The following uses the obs-cff bucket as an example. For details, see Creating a Bucket.

Creating an OBS Trigger

  1. Log in to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click the function to be configured to go to the function details page.
  3. Choose Configuration > Triggers and click Create Trigger.

    Figure 1 Creating a trigger

  4. Configure the following parameters.

    Table 2 Parameters of an OBS trigger

    Parameter

    Description

    Example Value

    Trigger Type

    Mandatory.

    Select Object Storage Service (OBS).

    Object Storage Service (OBS)

    Bucket Name

    Mandatory.

    OBS bucket used as the event source. After the bucket is created, it cannot be modified.

    obs-cff

    Events

    Mandatory.

    Select events that will trigger the function. For details about the supported event types, see Table 1.

    Put, Post, and Delete

    (The function is triggered when files in the OBS bucket are updated, uploaded, or deleted.)

    Event Notification Name

    Optional.

    Specify the name of the event notification to be sent by SMN when an event occurs.

    obs-event-test

    Prefix

    Optional.

    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

    Optional.

    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.

    -

Triggering a Function

On the OBS console, upload a file to the obs-cff bucket. For details, see Uploading a File.

After the file is uploaded to the obs-cff bucket, the function is automatically triggered. You can view the execution result in the function execution logs.

Viewing the Execution Result

  1. Return to the FunctionGraph console. In the navigation pane, choose Functions > Function List.
  2. Click a function to go to the function details page.
  3. Choose Monitoring > Logs to query function running logs.

Helpful Links

Manage function triggers through APIs. For details, see Function Trigger APIs.