• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. User Guide
  4. OBS Console Operation Guide
  5. Event Notification
  6. An Example of Configuring Event Notification

An Example of Configuring Event Notification

Context

An enterprise has a large number of files to archive but it does not want to put efforts on storage resources. Once they have subscribed to OBS for storing the files, the enterprise expects that all operations performed on OBS and included in event notification can be sent to a certain employee by email.

Procedure

  1. Log in to OBS Console as an enterprise user.
  2. Create a bucket.

    Click Create Bucket in the upper right corner of the page. Figure 1 displays the Create Bucket page. Select Region, select Storage Class, enter the bucket name, and click Create Now. In the following example, testbucket is the bucket name.

    Figure 1 Creating a bucket

  3. Create a folder.

    Click the bucket created in Step 2 to go to the Summary page. Choose Objects > Create Folder, enter the folder name, and click OKFigure 2 displays Summary Page and illustrates these operations. In the following example, SMN is the folder name.

    Figure 2 Creating a folder

  4. On the upper part of the page, click Service ListSimple Message Notification to go to the SMN page and create an SMN topic. In the following example, TestTopic is the SMN topic and the notification method is email.

    Use SMN to create a notification topic for OBS as follows:

    1. Create an SMN topic.
    2. Add subscription.
    3. Modify the topic policy. Select OBS under Services that can publish messages on the Modify Topic Policy page.

    For details, see Table 1.

  5. On the upper part of the page, click Service List and choose Object Storage Service to return to the OBS page.
  6. Configure an event.

    In the bucket list, select the bucket created in Step 2 and choose Event Notification > AddFigure 3 displays the following page. Then click OK.

    According to the configurations in the following figure, all operations performed on folder SMN in bucket testbucket and included in event notification can be sent to certain employees by email. For details about parameters, see Table 1.

    Figure 3 Configuring an event notification

Verification

  1. Log in to OBS Console as an enterprise user.
  2. Upload the test.txt file to the folder created in Step 3.

    After the file is uploaded, an employee receives an email similar to the one shown in Figure 4. Keyword ObjectCreated:Post in the email indicates that the object is successfully uploaded.

    Figure 4 Email details about the object uploading

  3. Delete the test.txt file uploaded in Step 2.

    After the file is successfully deleted, an employee receives an email similar to the one shown in Figure 5. Keyword ObjectRemoved:DeleteMarkerCreated in the email indicates that the object is successfully deleted.

    Figure 5 Email details about the object deleting