GET Bucket Notification

You can perform this operation to obtain the notification configuration of a bucket.

The s3:PutBucketNotification permission is required to perform this operation. By default, the permission is granted to the bucket owner only. However, it can be granted to other users by configuring the bucket policy or user policy.

Request Syntax

GET /?notification HTTP/1.1
Host: bucketname.obs.cn-north-1.myhwclouds.com
Date: date
Authorization: authorization

Request Parameters

This request contains no parameter.

Request Headers

This request uses common headers. For details, see Common Request Headers.

Request Elements

This request involves no elements.

Response Syntax

HTTP/1.1 status_code
Content-Type: type
Date: date
Content-Length: length

<?xml version="1.0" encoding="UTF-8"?>
<NotificationConfiguration xmlns="http://obs.company.com/doc/2015-06-30/">
    <TopicConfiguration> 
        <Id>ConfigurationId</Id> 
        <Filter> 
            <S3Key> 
                <FilterRule> 
                    <Name>prefix</Name> 
                    <Value>prefix-value</Value> 
                </FilterRule> 
                <FilterRule> 
                    <Name>suffix</Name> 
                    <Value>suffix-value</Value> 
                </FilterRule> 
           </S3Key> 
        </Filter> 
        <Topic>TopicARN</Topic> 
        <Event>event-type</Event> 
        <Event>event-type</Event> 
        ... 
    </TopicConfiguration> 
    <CloudFunctionConfiguration>
        <Id>ConfigurationId</Id>
        <Filter>
        ...
        </Filter>
        <CloudFunction>cloud-function-arn</CloudFunction>
        <Event>event-type</Event>
        ...
    </CloudFunctionConfiguration>
        ...
    <FunctionGraphConfiguration>
        <Id>ConfigurationId</Id>
        <Filter>
        ...
        </Filter>
        <FunctionGraph>function-graph-arn</FunctionGraph>
        <Event>event-type</Event>
        ...
    </FunctionGraphConfiguration>
    ...
</NotificationConfiguration>

Response Headers

This response uses common headers. For details about common response headers, see Common Response Headers.

Response Elements

The following table describes the elements contained in this response.

Table 1 Response elements

Element

Description

NotificationConfiguration

Element for configuring the event notification function of a bucket. If this element is null, the function is disabled.

Type: element

Ancestor: none

Children: one or more TopicConfigurationCloudFunctionConfiguration, or FunctionGraphConfiguration items

TopicConfiguration

Element for configuring the event notification topic.

Type: element

Ancestor: NotificationConfiguration

Children: Id, Filter, Topic, Event, or Events

Topic

URN of the event notification topic. After detecting a specific event, OBS sends a message to the topic.

Type: string

Ancestor: TopicConfiguration

CloudFunctionConfiguration

Element of configuring FunctionStage.

Type: element

Ancestor: NotificationConfiguration

Children: Id, Filter, Topic, Event, or Events

CloudFunction

URN of FunctionStage. When OBS detects a specific event in the bucket, it sends a message to FunctionStage and calls FunctionStage.

Type: string

Ancestor: CloudFunctionConfiguration

FunctionGraphConfiguration

Element of configuring FunctionGraph.

Type: element

Ancestor: NotificationConfiguration

Children: Id, Filter, Topic, Event, or Events

FunctionGraph

URN of FunctionGraph. When OBS detects a specific event in the bucket, it sends a message to FunctionGraph and calls FunctionGraph.

Type: string

Ancestor: FunctionGraphConfiguration

Id

Unique ID of each event notification. If the user does not specify an ID, the system assigns an ID automatically.

Type: string

Ancestor: TopicConfiguration, CloudFunctionConfiguration, or FunctionGraphConfiguration

Filter

Element of S3Key used to store rules of filtering object names

Type: element

Ancestor: TopicConfiguration, CloudFunctionConfiguration, or FunctionGraphConfiguration

Children: S3Key

S3Key

Element of S3Key used to store rules of filtering object names

Type: element

Ancestor: TopicConfiguration, CloudFunctionConfiguration, or FunctionGraphConfiguration

FilterRule

Element that defines key-value pairs of the filtering rule.

Type: element

Ancestor: S3Key

Children: Name, Value

Name

Prefix or suffix of object names for filtering

Type: string

Ancestor: FilterRule

Valid value: prefix or suffix

Value

Keywords of object names so that objects can be filtered based on the prefixes or suffixes

Type: string

Ancestor: FilterRule

Event

Type of events that need to be notified

NOTE:

Multiple event types can be added in one TopicConfigurationCloudFunctionConfiguration, or FunctionGraphConfiguration configuration item.

Type: string

Valid value: See the content about event types in the Object Storage Service Developer Guide.

Ancestor: TopicConfiguration, CloudFunctionConfiguration, or FunctionGraphConfiguration

Error Responses

No special error responses are returned. For details about error responses, see Table 1.

Registration