forked from docs/doc-exports
Reviewed-by: gtema <artem.goncharov@gmail.com> Co-authored-by: Jawei, Li <lijiawei5@huawei.com> Co-committed-by: Jawei, Li <lijiawei5@huawei.com>
266 lines
16 KiB
HTML
266 lines
16 KiB
HTML
<a name="obs_04_0040"></a><a name="obs_04_0040"></a>
|
|
|
|
<h1 class="topictitle1">Obtaining the Event Notification Configuration of a Bucket</h1>
|
|
<div id="body55047167"><div class="section" id="obs_04_0040__section5584184924715"><h4 class="sectiontitle">Functions</h4><p class="msonormal" id="obs_04_0040__p28292332">This operation obtains the notification configuration of a bucket.</p>
|
|
<p class="msonormal" id="obs_04_0040__p53304400">To perform this operation, you must have the <strong id="obs_04_0040__b11700031151215">GetBucketNotification</strong> permission. 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.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section9977559"><h4 class="sectiontitle">Request Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0040__screen29635581"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4</pre></div></td><td class="code"><div class="highlight"><pre><span></span>GET /?notification HTTP/1.1
|
|
Host: bucketname.obs.region.example.com
|
|
Date: date
|
|
Authorization: authorization
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section22689168"><h4 class="sectiontitle">Request Parameters</h4><p class="msonormal" id="obs_04_0040__p6716721">This request contains no parameter.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section2875926"><h4 class="sectiontitle">Request Headers</h4><p class="msonormal" id="obs_04_0040__p7183509">This request uses common headers. For details, see <a href="obs_04_0007.html#obs_04_0007__table25197309">Table 3</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section25883337"><h4 class="sectiontitle">Request Elements</h4><p class="msonormal" id="obs_04_0040__p2286966">This request involves no elements.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section31623442"><h4 class="sectiontitle">Response Syntax</h4><div class="codecoloring" codetype="Xml" id="obs_04_0040__screen51026564"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21
|
|
22
|
|
23
|
|
24
|
|
25
|
|
26
|
|
27</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 status_code
|
|
Content-Type: type
|
|
Date: date
|
|
Content-Length: length
|
|
|
|
<span class="cp"><?xml version="1.0" encoding="UTF-8"?></span>
|
|
<span class="nt"><NotificationConfiguration</span> <span class="na">xmlns=</span><span class="s">"http://obs.example.com/doc/2015-06-30/"</span><span class="nt">></span>
|
|
<span class="nt"><TopicConfiguration></span>
|
|
<span class="nt"><Id></span>ConfigurationId<span class="nt"></Id></span>
|
|
<span class="nt"><Filter></span>
|
|
<span class="nt"><Object></span>
|
|
<span class="nt"><FilterRule></span>
|
|
<span class="nt"><Name></span>prefix<span class="nt"></Name></span>
|
|
<span class="nt"><Value></span>prefix-value<span class="nt"></Value></span>
|
|
<span class="nt"></FilterRule></span>
|
|
<span class="nt"><FilterRule></span>
|
|
<span class="nt"><Name></span>suffix<span class="nt"></Name></span>
|
|
<span class="nt"><Value></span>suffix-value<span class="nt"></Value></span>
|
|
<span class="nt"></FilterRule></span>
|
|
<span class="nt"></Object></span>
|
|
<span class="nt"></Filter></span>
|
|
<span class="nt"><Topic></span>TopicARN<span class="nt"></Topic></span>
|
|
<span class="nt"><Event></span>event-type<span class="nt"></Event></span>
|
|
<span class="nt"><Event></span>event-type<span class="nt"></Event></span>
|
|
...
|
|
<span class="nt"></TopicConfiguration></span>
|
|
<span class="nt"></NotificationConfiguration></span>
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section16175522"><h4 class="sectiontitle">Response Headers</h4><p class="msonormal" id="obs_04_0040__p1512332591013">The response to the request uses common headers. For details, see <a href="obs_04_0013.html#obs_04_0013__d0e686">Table 1</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section11361970"><h4 class="sectiontitle">Response Elements</h4><p class="msonormal" id="obs_04_0040__p56568670">This response contains elements to detail the configuration. <a href="#obs_04_0040__table6153252715448">Table 1</a> describes the elements.</p>
|
|
|
|
<div class="tablenoborder"><a name="obs_04_0040__table6153252715448"></a><a name="table6153252715448"></a><table cellpadding="4" cellspacing="0" summary="" id="obs_04_0040__table6153252715448" frame="border" border="1" rules="all"><caption><b>Table 1 </b>Response elements for configuring event notification</caption><thead align="left"><tr id="obs_04_0040__row50150680"><th align="left" class="cellrowborder" valign="top" width="28.28282828282828%" id="mcps1.3.8.3.2.3.1.1"><p id="obs_04_0040__p35673257">Element</p>
|
|
</th>
|
|
<th align="left" class="cellrowborder" valign="top" width="71.71717171717171%" id="mcps1.3.8.3.2.3.1.2"><p id="obs_04_0040__p3852736">Description</p>
|
|
</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody><tr id="obs_04_0040__row43636162"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p44868249">NotificationConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p10449581">Element for configuring the event notification function of a bucket. If this element is <strong id="obs_04_0040__b75553017460">null</strong>, the function is disabled.</p>
|
|
<p id="obs_04_0040__p26937369">Type: element</p>
|
|
<p id="obs_04_0040__p41109733">Ancestor: none</p>
|
|
<p id="obs_04_0040__p34443282">Children: one or more</p>
|
|
<p id="obs_04_0040__p45224194610">TopicConfiguration </p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0040__row41554090"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p10438115">TopicConfiguration</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p40180985">Element for configuring the event notification topic.</p>
|
|
<p id="obs_04_0040__p26084546">Type: element</p>
|
|
<p id="obs_04_0040__p33434323">Ancestor: NotificationConfiguration</p>
|
|
<p id="obs_04_0040__p32473453">Children: Id, Filter, Topic, Event, or Events</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0040__row23825625"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p50827509">Topic</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p23387532">URN of the event notification topic. After detecting a specific event in the bucket, OBS sends a message to the topic.</p>
|
|
<p id="obs_04_0040__p9161202">Type: string</p>
|
|
<p id="obs_04_0040__p15341960">Ancestor: TopicConfiguration</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0040__row50412549"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p56884650">Id</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p44253952">Unique ID of each event notification. If the user does not specify an ID, the system assigns an ID automatically.</p>
|
|
<p id="obs_04_0040__p62741253">Type: string</p>
|
|
<p id="obs_04_0040__p27800366">Ancestor:</p>
|
|
<p id="obs_04_0040__p14140135095115">TopicConfiguration</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0040__row48876710"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p66699469">Filter</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p33947871">Element used to store rules of filtering object names.</p>
|
|
<p id="obs_04_0040__p37095389">Type: element</p>
|
|
<p id="obs_04_0040__p65423046">Ancestor:</p>
|
|
<p id="obs_04_0040__p871181715528">TopicConfiguration</p>
|
|
<p id="obs_04_0040__p51936509">Children: Object</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0040__row64775402"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p12316210">Object</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p58088967">Element used to store rules of filtering object names.</p>
|
|
<p id="obs_04_0040__p53038657">Type: element</p>
|
|
<p id="obs_04_0040__p7585872">Ancestor:</p>
|
|
<p id="obs_04_0040__p1364312211526">TopicConfiguration</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0040__row1163988"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p27174183">FilterRule</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p53625186">Element that defines key-value pairs of the filtering rule.</p>
|
|
<p id="obs_04_0040__p12864630">Type: element</p>
|
|
<p id="obs_04_0040__p48672814">Ancestor: Object</p>
|
|
<p id="obs_04_0040__p35402146">Children: Name, Value</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0040__row50183858"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p38360727">Name</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p20211205">Prefix or suffix of object names for filtering</p>
|
|
<p id="obs_04_0040__p47683118">Type: string</p>
|
|
<p id="obs_04_0040__p26494883">Ancestor: FilterRule</p>
|
|
<p id="obs_04_0040__p37127355">Value options: prefix, suffix</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0040__row65710745"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p20970128">Value</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p20858799">Keywords of object names so that objects can be filtered based on the prefixes or suffixes</p>
|
|
<p id="obs_04_0040__p53511470">Type: string</p>
|
|
<p id="obs_04_0040__p11841183">Ancestor: FilterRule</p>
|
|
</td>
|
|
</tr>
|
|
<tr id="obs_04_0040__row39461789"><td class="cellrowborder" valign="top" width="28.28282828282828%" headers="mcps1.3.8.3.2.3.1.1 "><p id="obs_04_0040__p42288329">Event</p>
|
|
</td>
|
|
<td class="cellrowborder" valign="top" width="71.71717171717171%" headers="mcps1.3.8.3.2.3.1.2 "><p id="obs_04_0040__p2802585">Type of events that need to be notified</p>
|
|
<div class="note" id="obs_04_0040__note25223266"><span class="notetitle"> NOTE: </span><div class="notebody"><p class="textintable" id="obs_04_0040__p17816446175316">Multiple event types can be added in one TopicConfiguration item.</p>
|
|
</div></div>
|
|
<p id="obs_04_0040__p29818660">Type: string</p>
|
|
<p id="obs_04_0040__p67041350">Value options:</p>
|
|
<p id="obs_04_0040__p24071933194218">The following values can be used to upload an object:</p>
|
|
<ul id="obs_04_0040__ul1538104184210"><li id="obs_04_0040__li1238174194214">ObjectCreated:Put</li><li id="obs_04_0040__li53824104219">ObjectCreated:Post</li><li id="obs_04_0040__li1438741154210">ObjectCreated:Copy</li><li id="obs_04_0040__li16381241104214">ObjectCreated:CompleteMultipartUpload</li></ul>
|
|
<p id="obs_04_0040__p20291144164114">Or use wildcard characters to support all upload operations:</p>
|
|
<ul id="obs_04_0040__ul8608204404216"><li id="obs_04_0040__li1060814494218">ObjectCreated:*</li></ul>
|
|
<p id="obs_04_0040__p1131143617425">The following values can be used to delete an object:</p>
|
|
<ul id="obs_04_0040__ul22321848124217"><li id="obs_04_0040__li122329482421">ObjectRemoved:Delete</li><li id="obs_04_0040__li72327489421">ObjectRemoved:DeleteMarkerCreated</li></ul>
|
|
<p id="obs_04_0040__p11153933104112">Or use wildcard characters to support all delete operations:</p>
|
|
<ul id="obs_04_0040__ul1853491410432"><li id="obs_04_0040__li10534111494311">ObjectRemoved:*</li></ul>
|
|
<p id="obs_04_0040__p840815203431"></p>
|
|
<p id="obs_04_0040__p66501246">Ancestor:</p>
|
|
<p id="obs_04_0040__p20191756175319">TopicConfiguration</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section35148867"><h4 class="sectiontitle">Error Responses</h4><p class="msonormal" id="obs_04_0040__p17891865">No special error responses are involved. For details about error responses, see <a href="obs_04_0115.html#obs_04_0115__d0e843">Table 2</a>.</p>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section14482163815396"><h4 class="sectiontitle">Sample Request</h4><div class="codecoloring" codetype="Xml" id="obs_04_0040__screen8484163863919"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6</pre></div></td><td class="code"><div class="highlight"><pre><span></span>GET /?notification HTTP/1.1
|
|
User-Agent: curl/7.29.0
|
|
Host: examplebucket.obs.region.example.com
|
|
Accept: */*
|
|
Date: WED, 01 Jul 2015 03:16:32 GMT
|
|
Authorization: OBS H4IPJX0TQTHTHEBQQCEC:r5+2zwPTKwupMg6lkeTUUqPcHfQ=
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
<div class="section" id="obs_04_0040__section76081155815"><h4 class="sectiontitle">Sample Response</h4><div class="codecoloring" codetype="Xml" id="obs_04_0040__screen8485113814"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre> 1
|
|
2
|
|
3
|
|
4
|
|
5
|
|
6
|
|
7
|
|
8
|
|
9
|
|
10
|
|
11
|
|
12
|
|
13
|
|
14
|
|
15
|
|
16
|
|
17
|
|
18
|
|
19
|
|
20
|
|
21
|
|
22
|
|
23
|
|
24
|
|
25
|
|
26
|
|
27
|
|
28</pre></div></td><td class="code"><div class="highlight"><pre><span></span>HTTP/1.1 200 OK
|
|
Server: OBS
|
|
x-obs-request-id: 900B000001643FDDD751B37BA87590D8
|
|
x-obs-id-2: 32AAAQAAEAABAAAQAAEAABAAAQAAEAABCSJRBSladan5ZCVw6ZIY/DAs0zs6z7Hh
|
|
Content-Type: application/xml
|
|
Date: WED, 01 Jul 2015 03:16:32 GMT
|
|
Content-Length: 490
|
|
|
|
<span class="cp"><?xml version="1.0" encoding="UTF-8" standalone="yes"?></span>
|
|
<span class="nt"><NotificationConfiguration</span> <span class="na">xmlns=</span><span class="s">"http://obs.example.com/doc/2015-06-30/"</span><span class="nt">></span>
|
|
<span class="nt"><TopicConfiguration></span>
|
|
<span class="nt"><Topic></span>urn:smn:region:4b29a3cb5bd64581bda5714566814bb7:tet522<span class="nt"></Topic></span>
|
|
<span class="nt"><Id></span>ConfigurationId<span class="nt"></Id></span>
|
|
<span class="nt"><Filter></span>
|
|
<span class="nt"><Object></span>
|
|
<span class="nt"><FilterRule></span>
|
|
<span class="nt"><Name></span>prefix<span class="nt"></Name></span>
|
|
<span class="nt"><Value></span>object<span class="nt"></Value></span>
|
|
<span class="nt"></FilterRule></span>
|
|
<span class="nt"><FilterRule></span>
|
|
<span class="nt"><Name></span>suffix<span class="nt"></Name></span>
|
|
<span class="nt"><Value></span>txt<span class="nt"></Value></span>
|
|
<span class="nt"></FilterRule></span>
|
|
<span class="nt"></Object></span>
|
|
<span class="nt"></Filter></span>
|
|
<span class="nt"><Event></span>ObjectCreated:Put<span class="nt"></Event></span>
|
|
<span class="nt"></TopicConfiguration></span>
|
|
<span class="nt"></NotificationConfiguration></span>
|
|
</pre></div>
|
|
</td></tr></table></div>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<div class="familylinks">
|
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="obs_04_0026.html">Advanced Bucket Settings</a></div>
|
|
</div>
|
|
</div>
|
|
|