forked from docs/doc-exports
Reviewed-by: Hasko, Vladimir <vladimir.hasko@t-systems.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
241 lines
18 KiB
HTML
241 lines
18 KiB
HTML
<a name="EN-US_TOPIC_0125560248"></a><a name="EN-US_TOPIC_0125560248"></a>
|
|
|
|
<h1 class="topictitle1">PUT Bucket Notification</h1>
|
|
<div id="body1472107434300"><p id="EN-US_TOPIC_0125560248__p11463331144723">When the notification function is enabled, you will be notified of all the specified operations on your bucket. </p>
|
|
<p id="EN-US_TOPIC_0125560248__p56114620144723">By default, the notification function of your bucket is not enabled. Namely, the NotificationConfiguration element is null. If you want to disable the function, set the NotificationConfiguration element to null.</p>
|
|
<p id="EN-US_TOPIC_0125560248__p35269540144723">After receiving the notification request, OBS verifies whether the specified Simple Message Notification (SMN) topic exists and whether the topic is authorized to OBS. If the topic exists and is authorized to OBS, OBS sends a test notification to the topic.</p>
|
|
<p id="EN-US_TOPIC_0125560248__p48990406144723">The <strong id="EN-US_TOPIC_0125560248__b11712195020398">s3:PutBucketNotification</strong> permission is required to configure the notification function. By default, the permission is granted to the bucket owner only. However, it can be granted to other users by configuring the bucket policy.</p>
|
|
<div class="note" id="EN-US_TOPIC_0125560248__note49724760"><img src="public_sys-resources/note_3.0-en-us.png"><span class="notetitle"> </span><div class="notebody"><p id="EN-US_TOPIC_0125560248__p66906095112756">For details about how to authorize topics to OBS, see the <em id="EN-US_TOPIC_0125560248__i355886517637">SMN User Guide</em></p>
|
|
</div></div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section35786508144743"><h4 class="sectiontitle">Request Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560248__screen13025998144743">PUT /?notification HTTP/1.1
|
|
User-Agent: agent
|
|
Host: bucketname.obs.example.com
|
|
Accept: */*
|
|
Date: date
|
|
Authorization: authorization
|
|
Content-Length: length
|
|
Expect: expect
|
|
|
|
<NotificationConfiguration>
|
|
<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>
|
|
</NotificationConfiguration></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section27343126145027"><h4 class="sectiontitle">Request Parameters</h4><p id="EN-US_TOPIC_0125560248__p200694145027">This request contains no parameter.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section1806247145027"><h4 class="sectiontitle">Request Headers</h4><p id="EN-US_TOPIC_0125560248__p12088313145027">This request uses common headers. For details, see section <a href="en-us_topic_0125560462.html">Common Request Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section41685955145027"><h4 class="sectiontitle">Request Elements</h4><p class="litext" id="EN-US_TOPIC_0125560248__p21119233145027">This request contains elements to specify the notification configuration for the bucket in XML format. The following table lists the request elements.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560248__table55855374145027" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Request elements of notification function configuration</caption><thead align="left"><tr id="EN-US_TOPIC_0125560248__row43394869145027"><th align="left" class="cellrowborder" valign="top" width="20.200000000000003%" id="mcps1.3.9.3.2.4.1.1"><p id="EN-US_TOPIC_0125560248__p25323481145027">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="60.61%" id="mcps1.3.9.3.2.4.1.2"><p id="EN-US_TOPIC_0125560248__p37936074145027">Description</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="19.189999999999998%" id="mcps1.3.9.3.2.4.1.3"><p id="EN-US_TOPIC_0125560248__p52923119145027">Mandatory or Not</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560248__row58914224145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p7322871145027">NotificationConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p56281641145027">Container for configuring the event notification function of a bucket. If this element is null, the function is disabled.</p>
|
|
<p id="EN-US_TOPIC_0125560248__p36772727145027">Type: Container</p>
|
|
<p id="EN-US_TOPIC_0125560248__p62519088145027">Ancestor: None</p>
|
|
<p id="EN-US_TOPIC_0125560248__p25800887145027">Children: zero TopicConfiguration, one TopicConfiguration, or TopicConfigurations</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p9497112145027">Yes</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row18365148145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p11182033145027">TopicConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p33329466145027">Container for configuring the event notification topic</p>
|
|
<p id="EN-US_TOPIC_0125560248__p31529742145027">Type: Container</p>
|
|
<p id="EN-US_TOPIC_0125560248__p15332224145027">Ancestor: NotificationConfiguration</p>
|
|
<p id="EN-US_TOPIC_0125560248__p3772289145027">Children: Id, Filter, Topic, Event or Events</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p37119964145027">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row65644224145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p15581964145027">Topic</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p54179539145027">URN of the event notification topic. After detecting a specific event, OBS sends a message to the topic.</p>
|
|
<p id="EN-US_TOPIC_0125560248__p17853809145027">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560248__p26466559145027">Ancestor: TopicConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p63416568145027">Yes if ancestor TopicConfiguration is added</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row33878205145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p59780051145027">Id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p10345962145027">Unique ID of each event notification. If the user does not specify an ID, the system assigns an ID automatically.</p>
|
|
<p id="EN-US_TOPIC_0125560248__p26004797145027">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560248__p32716585145027">Ancestor: TopicConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p32797753145027">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row26744327145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p18806867145027">Filter</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p46961219145027">Container of S3Key used to store rules of filtering object names</p>
|
|
<p id="EN-US_TOPIC_0125560248__p19997788145027">Type: Container</p>
|
|
<p id="EN-US_TOPIC_0125560248__p45762367145027">Ancestor: TopicConfiguration</p>
|
|
<p id="EN-US_TOPIC_0125560248__p9208126145027">Children: S3Key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p7660728145027">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row1837694145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p14635536145027">S3Key</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p44627791145027">Container that defines filtering rules. The rules filter objects based on the prefixes and suffixes of object names.</p>
|
|
<p id="EN-US_TOPIC_0125560248__p66105802145027">Type: Container</p>
|
|
<p id="EN-US_TOPIC_0125560248__p58081314145027">Ancestor: Filter</p>
|
|
<p id="EN-US_TOPIC_0125560248__p52969783145027">Children: One FilterRule or FilterRules</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p62694020145027">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row27375270145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p2804391145027">FilterRule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p25829084145027">Container that defines key-value pairs of filtering rules</p>
|
|
<p id="EN-US_TOPIC_0125560248__p31135165145027">Type: Container</p>
|
|
<p id="EN-US_TOPIC_0125560248__p11781037145027">Ancestor: S3Key</p>
|
|
<p id="EN-US_TOPIC_0125560248__p38920476145027">Children: Name, Value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p65550884145027">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row53087046145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p5083485145027">Name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p9109169145027">Specifies the prefix or suffix of object names for filtering.</p>
|
|
<p id="EN-US_TOPIC_0125560248__p14873661145027">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560248__p66754089145027">Ancestor: FilterRule</p>
|
|
<p id="EN-US_TOPIC_0125560248__p63915894145027">Legal value: prefix or suffix</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p9804960145027">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row21135783145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p34276861145027">Value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p24962327145027">Specifies keywords of object names so that objects can be filtered based on the prefixes or suffixes. The value contains a maximum of 1024 characters.</p>
|
|
<p id="EN-US_TOPIC_0125560248__p23334353145027">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560248__p8682589145027">Ancestor: FilterRule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p32201145145027">No</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row21374849145027"><td class="cellrowborder" valign="top" width="20.200000000000003%" headers="mcps1.3.9.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p53641238145027">Event</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="60.61%" headers="mcps1.3.9.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p49973044145027">Type of events that need to be notified</p>
|
|
<div class="note" id="EN-US_TOPIC_0125560248__note47104213145027"><span class="notetitle"> NOTE: </span><div class="notebody"><p class="textintable" id="EN-US_TOPIC_0125560248__p21284738145027">Multiple event types can be added in one TopicConfiguration configuration item.<em id="EN-US_TOPIC_0125560248__i57344914145027"></em></p>
|
|
</div></div>
|
|
<p id="EN-US_TOPIC_0125560248__p46342184145027">Type: String</p>
|
|
<p id="EN-US_TOPIC_0125560248__p27693898145027">Ancestor: TopicConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="19.189999999999998%" headers="mcps1.3.9.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p28613269145027">Yes if ancestor TopicConfiguration is added</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section5866353914519"><h4 class="sectiontitle">Response Syntax</h4><pre class="screen" id="EN-US_TOPIC_0125560248__screen5412621714519">HTTP/1.1 status_code
|
|
x-amz-request-id: request id
|
|
x-amz-id-2: id
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Date: date
|
|
Content-Length: length </pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section1737390614519"><h4 class="sectiontitle">Response Headers</h4><p id="EN-US_TOPIC_0125560248__p6510911714519">This response uses common headers. For details, see section <a href="en-us_topic_0125560484.html">Common Response Headers</a>.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section4911114514519"><h4 class="sectiontitle">Response Elements</h4><p id="EN-US_TOPIC_0125560248__p1857984514519">This response involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section3300087714519"><h4 class="sectiontitle">Error Responses</h4><p id="EN-US_TOPIC_0125560248__p5582541014519">When the user invokes the interface, the system checks whether the NotificationConfiguration element and the configuration are valid. The following table lists common errors and possible causes.</p>
|
|
|
|
<div class="tablenoborder"><table cellpadding="4" cellspacing="0" summary="" id="EN-US_TOPIC_0125560248__table3266664814519" frame="border" border="1" rules="all"><caption><b>Table 2 </b>Error codes and possible causes</caption><thead align="left"><tr id="EN-US_TOPIC_0125560248__row4080837914519"><th align="left" class="cellrowborder" valign="top" width="22.45%" id="mcps1.3.13.3.2.4.1.1"><p id="EN-US_TOPIC_0125560248__p1714439414519">Error Code</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="59.18%" id="mcps1.3.13.3.2.4.1.2"><p id="EN-US_TOPIC_0125560248__p4651869814519">Possible Cause</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="18.37%" id="mcps1.3.13.3.2.4.1.3"><p id="EN-US_TOPIC_0125560248__p991821114519">HTTP Status Code</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="EN-US_TOPIC_0125560248__row6517759614519"><td class="cellrowborder" valign="top" width="22.45%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p4489388514519">InvalidArgument</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.18%" headers="mcps1.3.13.3.2.4.1.2 "><ul id="EN-US_TOPIC_0125560248__ul1252606314519"><li id="EN-US_TOPIC_0125560248__li4562570514519">Unsupported events were specified.</li><li id="EN-US_TOPIC_0125560248__li797816914519">The specified URN does not exist or is incorrect.</li><li id="EN-US_TOPIC_0125560248__li469466314519">The specified region in the URN is different as the region where the bucket resides.</li><li id="EN-US_TOPIC_0125560248__li4225197214519">The specified filtering rules overlap.</li></ul>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p6696658414519">400 Bad Request</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="EN-US_TOPIC_0125560248__row6582834414519"><td class="cellrowborder" valign="top" width="22.45%" headers="mcps1.3.13.3.2.4.1.1 "><p id="EN-US_TOPIC_0125560248__p3049564314519">AccessDenied</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="59.18%" headers="mcps1.3.13.3.2.4.1.2 "><p id="EN-US_TOPIC_0125560248__p5422802714519">The operator is not the bucket owner and not granted with the s3:PutBucketNotification permission.</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="18.37%" headers="mcps1.3.13.3.2.4.1.3 "><p id="EN-US_TOPIC_0125560248__p3039404714519">403 Forbidden</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section21401127145254"><h4 class="sectiontitle">Sample Request</h4><pre class="screen" id="EN-US_TOPIC_0125560248__screen55769758145254">PUT /?notification HTTP/1.1
|
|
User-Agent: curl/7.19.0 (x86_64-suse-linux-gnu) libcurl/7.19.0
|
|
OpenSSL/0.9.8{ zlib/1.2.3 libidn/1.10
|
|
Host: bucketname.obs.example.com
|
|
Pragma: no-cache
|
|
Accept: */*Date: Tue, 28 Apr 2015 08:56:07 +0000
|
|
Authorization:AWS D13E0C94E722DD69423C:QhHpU6Amg/2r6wIYdU3RXIx7Tlc=
|
|
Content-Length: 468 [request body]
|
|
Expect: 100-continue
|
|
|
|
<NotificationConfiguration>
|
|
<TopicConfiguration>
|
|
<Id>Id001</Id>
|
|
<Topic>urn:smn:example:35667523564:topic001</Topic>
|
|
<Event>s3:ObjectCreated:*</Event>
|
|
<Filter>
|
|
<S3Key>
|
|
<FilterRule>
|
|
<Name>prefix</Name>
|
|
<Value>smn/</Value>
|
|
</FilterRule>
|
|
<FilterRule>
|
|
<Name>suffix</Name>
|
|
<Value>.jpg</Value>
|
|
</FilterRule>
|
|
</S3Key>
|
|
</Filter>
|
|
</TopicConfiguration>
|
|
</NotificationConfiguration></pre>
|
|
</div>
|
|
<div class="section" id="EN-US_TOPIC_0125560248__section32165774145254"><h4 class="sectiontitle">Sample Response</h4><pre class="screen" id="EN-US_TOPIC_0125560248__screen55290886145254">HTTP/1.1 200 OK
|
|
x-amz-request-id: C2D2F581B3C5AF6C6698322AB56836F6
|
|
x-amz-id-2: lDGZAj4h+A33eYauDCTsPvFSHzBXEtZon6Eg1idIZl18/2/odotyqJUJ/lTh80uA
|
|
x-reserved: amazon, aws and amazon web services are trademarks or registered trademarks of Amazon Technologies, Inc
|
|
Content-Type: text/xml
|
|
Date: Tue, 28 Apr 2015 08:56:07 GMT
|
|
Content-Length: 0</pre>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="en-us_topic_0125560493.html">Operations on Buckets</a></div>
|
|
</div>
|
|
</div>
|
|
|