]> git.proxmox.com Git - ceph.git/blame - ceph/doc/radosgw/s3/bucketops.rst
update ceph source to reef 18.1.2
[ceph.git] / ceph / doc / radosgw / s3 / bucketops.rst
CommitLineData
7c673cae
FG
1===================
2 Bucket Operations
3===================
4
5PUT Bucket
6----------
7Creates a new bucket. To create a bucket, you must have a user ID and a valid AWS Access Key ID to authenticate requests. You may not
8create buckets as an anonymous user.
9
7c673cae
FG
10Constraints
11~~~~~~~~~~~
12In general, bucket names should follow domain name constraints.
13
14- Bucket names must be unique.
9f95a23c
TL
15- Bucket names cannot be formatted as IP address.
16- Bucket names can be between 3 and 63 characters long.
17- Bucket names must not contain uppercase characters or underscores.
18- Bucket names must start with a lowercase letter or number.
19- Bucket names must be a series of one or more labels. Adjacent labels are separated by a single period (.). Bucket names can contain lowercase letters, numbers, and hyphens. Each label must start and end with a lowercase letter or a number.
20
21.. note:: The above constraints are relaxed if the option 'rgw_relaxed_s3_bucket_names' is set to true except that the bucket names must still be unique, cannot be formatted as IP address and can contain letters, numbers, periods, dashes and underscores for up to 255 characters long.
7c673cae
FG
22
23Syntax
24~~~~~~
25
26::
27
28 PUT /{bucket} HTTP/1.1
29 Host: cname.domain.com
30 x-amz-acl: public-read-write
31
32 Authorization: AWS {access-key}:{hash-of-header-and-secret}
33
34Parameters
35~~~~~~~~~~
36
eafe8130 37
7c673cae
FG
38+---------------+----------------------+-----------------------------------------------------------------------------+------------+
39| Name | Description | Valid Values | Required |
40+===============+======================+=============================================================================+============+
41| ``x-amz-acl`` | Canned ACLs. | ``private``, ``public-read``, ``public-read-write``, ``authenticated-read`` | No |
42+---------------+----------------------+-----------------------------------------------------------------------------+------------+
eafe8130
TL
43| ``x-amz-bucket-object-lock-enabled`` | Enable object lock on bucket. | ``true``, ``false`` | No |
44+--------------------------------------+-------------------------------+---------------------------------------------+------------+
7c673cae 45
81eedcae
TL
46Request Entities
47~~~~~~~~~~~~~~~~
48
49+-------------------------------+-----------+----------------------------------------------------------------+
50| Name | Type | Description |
51+===============================+===========+================================================================+
52| ``CreateBucketConfiguration`` | Container | A container for the bucket configuration. |
53+-------------------------------+-----------+----------------------------------------------------------------+
54| ``LocationConstraint`` | String | A zonegroup api name, with optional :ref:`s3_bucket_placement` |
55+-------------------------------+-----------+----------------------------------------------------------------+
7c673cae
FG
56
57
58HTTP Response
59~~~~~~~~~~~~~
60
61If the bucket name is unique, within constraints and unused, the operation will succeed.
62If a bucket with the same name already exists and the user is the bucket owner, the operation will succeed.
63If the bucket name is already in use, the operation will fail.
64
65+---------------+-----------------------+----------------------------------------------------------+
66| HTTP Status | Status Code | Description |
67+===============+=======================+==========================================================+
68| ``409`` | BucketAlreadyExists | Bucket already exists under different user's ownership. |
69+---------------+-----------------------+----------------------------------------------------------+
70
71DELETE Bucket
72-------------
73
74Deletes a bucket. You can reuse bucket names following a successful bucket removal.
75
76Syntax
77~~~~~~
78
79::
80
81 DELETE /{bucket} HTTP/1.1
82 Host: cname.domain.com
83
84 Authorization: AWS {access-key}:{hash-of-header-and-secret}
85
86HTTP Response
87~~~~~~~~~~~~~
88
89+---------------+---------------+------------------+
90| HTTP Status | Status Code | Description |
91+===============+===============+==================+
92| ``204`` | No Content | Bucket removed. |
93+---------------+---------------+------------------+
94
95GET Bucket
96----------
97Returns a list of bucket objects.
98
99Syntax
100~~~~~~
101
102::
103
104 GET /{bucket}?max-keys=25 HTTP/1.1
105 Host: cname.domain.com
106
107Parameters
108~~~~~~~~~~
109
1adf2230
AA
110+---------------------+-----------+-------------------------------------------------------------------------------------------------+
111| Name | Type | Description |
112+=====================+===========+=================================================================================================+
113| ``prefix`` | String | Only returns objects that contain the specified prefix. |
114+---------------------+-----------+-------------------------------------------------------------------------------------------------+
115| ``delimiter`` | String | The delimiter between the prefix and the rest of the object name. |
116+---------------------+-----------+-------------------------------------------------------------------------------------------------+
117| ``marker`` | String | A beginning index for the list of objects returned. |
118+---------------------+-----------+-------------------------------------------------------------------------------------------------+
119| ``max-keys`` | Integer | The maximum number of keys to return. Default is 1000. |
120+---------------------+-----------+-------------------------------------------------------------------------------------------------+
121| ``allow-unordered`` | Boolean | Non-standard extension. Allows results to be returned unordered. Cannot be used with delimiter. |
122+---------------------+-----------+-------------------------------------------------------------------------------------------------+
7c673cae
FG
123
124HTTP Response
125~~~~~~~~~~~~~
126
127+---------------+---------------+--------------------+
128| HTTP Status | Status Code | Description |
129+===============+===============+====================+
130| ``200`` | OK | Buckets retrieved |
131+---------------+---------------+--------------------+
132
133Bucket Response Entities
134~~~~~~~~~~~~~~~~~~~~~~~~
135``GET /{bucket}`` returns a container for buckets with the following fields.
136
137+------------------------+-----------+----------------------------------------------------------------------------------+
138| Name | Type | Description |
139+========================+===========+==================================================================================+
140| ``ListBucketResult`` | Entity | The container for the list of objects. |
141+------------------------+-----------+----------------------------------------------------------------------------------+
142| ``Name`` | String | The name of the bucket whose contents will be returned. |
143+------------------------+-----------+----------------------------------------------------------------------------------+
144| ``Prefix`` | String | A prefix for the object keys. |
145+------------------------+-----------+----------------------------------------------------------------------------------+
146| ``Marker`` | String | A beginning index for the list of objects returned. |
147+------------------------+-----------+----------------------------------------------------------------------------------+
148| ``MaxKeys`` | Integer | The maximum number of keys returned. |
149+------------------------+-----------+----------------------------------------------------------------------------------+
150| ``Delimiter`` | String | If set, objects with the same prefix will appear in the ``CommonPrefixes`` list. |
151+------------------------+-----------+----------------------------------------------------------------------------------+
152| ``IsTruncated`` | Boolean | If ``true``, only a subset of the bucket's contents were returned. |
153+------------------------+-----------+----------------------------------------------------------------------------------+
154| ``CommonPrefixes`` | Container | If multiple objects contain the same prefix, they will appear in this list. |
155+------------------------+-----------+----------------------------------------------------------------------------------+
156
157Object Response Entities
158~~~~~~~~~~~~~~~~~~~~~~~~
159The ``ListBucketResult`` contains objects, where each object is within a ``Contents`` container.
160
161+------------------------+-----------+------------------------------------------+
162| Name | Type | Description |
163+========================+===========+==========================================+
164| ``Contents`` | Object | A container for the object. |
165+------------------------+-----------+------------------------------------------+
166| ``Key`` | String | The object's key. |
167+------------------------+-----------+------------------------------------------+
168| ``LastModified`` | Date | The object's last-modified date/time. |
169+------------------------+-----------+------------------------------------------+
170| ``ETag`` | String | An MD-5 hash of the object. (entity tag) |
171+------------------------+-----------+------------------------------------------+
172| ``Size`` | Integer | The object's size. |
173+------------------------+-----------+------------------------------------------+
174| ``StorageClass`` | String | Should always return ``STANDARD``. |
175+------------------------+-----------+------------------------------------------+
11fdf7f2
TL
176| ``Type`` | String | ``Appendable`` or ``Normal``. |
177+------------------------+-----------+------------------------------------------+
7c673cae
FG
178
179Get Bucket Location
180-------------------
181Retrieves the bucket's region. The user needs to be the bucket owner
182to call this. A bucket can be constrained to a region by providing
183``LocationConstraint`` during a PUT request.
184
185Syntax
186~~~~~~
187Add the ``location`` subresource to bucket resource as shown below
188
189::
190
191 GET /{bucket}?location HTTP/1.1
192 Host: cname.domain.com
193
194 Authorization: AWS {access-key}:{hash-of-header-and-secret}
195
196Response Entities
197~~~~~~~~~~~~~~~~~~~~~~~~
198
199+------------------------+-----------+------------------------------------------+
200| Name | Type | Description |
201+========================+===========+==========================================+
202| ``LocationConstraint`` | String | The region where bucket resides, empty |
11fdf7f2 203| | | string for default region |
7c673cae
FG
204+------------------------+-----------+------------------------------------------+
205
206
207
208Get Bucket ACL
209--------------
210Retrieves the bucket access control list. The user needs to be the bucket
211owner or to have been granted ``READ_ACP`` permission on the bucket.
212
213Syntax
214~~~~~~
215Add the ``acl`` subresource to the bucket request as shown below.
216
217::
218
219 GET /{bucket}?acl HTTP/1.1
220 Host: cname.domain.com
221
222 Authorization: AWS {access-key}:{hash-of-header-and-secret}
223
224Response Entities
225~~~~~~~~~~~~~~~~~
226
227+---------------------------+-------------+----------------------------------------------------------------------------------------------+
228| Name | Type | Description |
229+===========================+=============+==============================================================================================+
230| ``AccessControlPolicy`` | Container | A container for the response. |
231+---------------------------+-------------+----------------------------------------------------------------------------------------------+
232| ``AccessControlList`` | Container | A container for the ACL information. |
233+---------------------------+-------------+----------------------------------------------------------------------------------------------+
234| ``Owner`` | Container | A container for the bucket owner's ``ID`` and ``DisplayName``. |
235+---------------------------+-------------+----------------------------------------------------------------------------------------------+
236| ``ID`` | String | The bucket owner's ID. |
237+---------------------------+-------------+----------------------------------------------------------------------------------------------+
238| ``DisplayName`` | String | The bucket owner's display name. |
239+---------------------------+-------------+----------------------------------------------------------------------------------------------+
240| ``Grant`` | Container | A container for ``Grantee`` and ``Permission``. |
241+---------------------------+-------------+----------------------------------------------------------------------------------------------+
242| ``Grantee`` | Container | A container for the ``DisplayName`` and ``ID`` of the user receiving a grant of permission. |
243+---------------------------+-------------+----------------------------------------------------------------------------------------------+
244| ``Permission`` | String | The permission given to the ``Grantee`` bucket. |
245+---------------------------+-------------+----------------------------------------------------------------------------------------------+
246
247PUT Bucket ACL
248--------------
249Sets an access control to an existing bucket. The user needs to be the bucket
250owner or to have been granted ``WRITE_ACP`` permission on the bucket.
251
252Syntax
253~~~~~~
254Add the ``acl`` subresource to the bucket request as shown below.
255
256::
257
258 PUT /{bucket}?acl HTTP/1.1
259
260Request Entities
261~~~~~~~~~~~~~~~~
262
263+---------------------------+-------------+----------------------------------------------------------------------------------------------+
264| Name | Type | Description |
265+===========================+=============+==============================================================================================+
266| ``AccessControlPolicy`` | Container | A container for the request. |
267+---------------------------+-------------+----------------------------------------------------------------------------------------------+
268| ``AccessControlList`` | Container | A container for the ACL information. |
269+---------------------------+-------------+----------------------------------------------------------------------------------------------+
270| ``Owner`` | Container | A container for the bucket owner's ``ID`` and ``DisplayName``. |
271+---------------------------+-------------+----------------------------------------------------------------------------------------------+
272| ``ID`` | String | The bucket owner's ID. |
273+---------------------------+-------------+----------------------------------------------------------------------------------------------+
274| ``DisplayName`` | String | The bucket owner's display name. |
275+---------------------------+-------------+----------------------------------------------------------------------------------------------+
276| ``Grant`` | Container | A container for ``Grantee`` and ``Permission``. |
277+---------------------------+-------------+----------------------------------------------------------------------------------------------+
278| ``Grantee`` | Container | A container for the ``DisplayName`` and ``ID`` of the user receiving a grant of permission. |
279+---------------------------+-------------+----------------------------------------------------------------------------------------------+
280| ``Permission`` | String | The permission given to the ``Grantee`` bucket. |
281+---------------------------+-------------+----------------------------------------------------------------------------------------------+
282
283List Bucket Multipart Uploads
284-----------------------------
285
286``GET /?uploads`` returns a list of the current in-progress multipart uploads--i.e., the application initiates a multipart upload, but
287the service hasn't completed all the uploads yet.
288
289Syntax
290~~~~~~
291
292::
293
294 GET /{bucket}?uploads HTTP/1.1
295
296Parameters
297~~~~~~~~~~
298
299You may specify parameters for ``GET /{bucket}?uploads``, but none of them are required.
300
301+------------------------+-----------+--------------------------------------------------------------------------------------+
302| Name | Type | Description |
303+========================+===========+======================================================================================+
304| ``prefix`` | String | Returns in-progress uploads whose keys contains the specified prefix. |
305+------------------------+-----------+--------------------------------------------------------------------------------------+
306| ``delimiter`` | String | The delimiter between the prefix and the rest of the object name. |
307+------------------------+-----------+--------------------------------------------------------------------------------------+
308| ``key-marker`` | String | The beginning marker for the list of uploads. |
309+------------------------+-----------+--------------------------------------------------------------------------------------+
310| ``max-keys`` | Integer | The maximum number of in-progress uploads. The default is 1000. |
311+------------------------+-----------+--------------------------------------------------------------------------------------+
312| ``max-uploads`` | Integer | The maximum number of multipart uploads. The range from 1-1000. The default is 1000. |
313+------------------------+-----------+--------------------------------------------------------------------------------------+
c07f9fc5 314| ``upload-id-marker`` | String | Ignored if ``key-marker`` is not specified. Specifies the ``ID`` of first |
7c673cae
FG
315| | | upload to list in lexicographical order at or following the ``ID``. |
316+------------------------+-----------+--------------------------------------------------------------------------------------+
317
318
319Response Entities
320~~~~~~~~~~~~~~~~~
321
322+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
323| Name | Type | Description |
324+=========================================+=============+==========================================================================================================+
325| ``ListMultipartUploadsResult`` | Container | A container for the results. |
326+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
327| ``ListMultipartUploadsResult.Prefix`` | String | The prefix specified by the ``prefix`` request parameter (if any). |
328+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
329| ``Bucket`` | String | The bucket that will receive the bucket contents. |
330+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
331| ``KeyMarker`` | String | The key marker specified by the ``key-marker`` request parameter (if any). |
332+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
333| ``UploadIdMarker`` | String | The marker specified by the ``upload-id-marker`` request parameter (if any). |
334+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
335| ``NextKeyMarker`` | String | The key marker to use in a subsequent request if ``IsTruncated`` is ``true``. |
336+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
337| ``NextUploadIdMarker`` | String | The upload ID marker to use in a subsequent request if ``IsTruncated`` is ``true``. |
338+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
339| ``MaxUploads`` | Integer | The max uploads specified by the ``max-uploads`` request parameter. |
340+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
341| ``Delimiter`` | String | If set, objects with the same prefix will appear in the ``CommonPrefixes`` list. |
342+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
343| ``IsTruncated`` | Boolean | If ``true``, only a subset of the bucket's upload contents were returned. |
344+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
345| ``Upload`` | Container | A container for ``Key``, ``UploadId``, ``InitiatorOwner``, ``StorageClass``, and ``Initiated`` elements. |
346+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
347| ``Key`` | String | The key of the object once the multipart upload is complete. |
348+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
349| ``UploadId`` | String | The ``ID`` that identifies the multipart upload. |
350+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
351| ``Initiator`` | Container | Contains the ``ID`` and ``DisplayName`` of the user who initiated the upload. |
352+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
353| ``DisplayName`` | String | The initiator's display name. |
354+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
355| ``ID`` | String | The initiator's ID. |
356+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
357| ``Owner`` | Container | A container for the ``ID`` and ``DisplayName`` of the user who owns the uploaded object. |
358+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
359| ``StorageClass`` | String | The method used to store the resulting object. ``STANDARD`` or ``REDUCED_REDUNDANCY`` |
360+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
361| ``Initiated`` | Date | The date and time the user initiated the upload. |
362+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
363| ``CommonPrefixes`` | Container | If multiple objects contain the same prefix, they will appear in this list. |
364+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
365| ``CommonPrefixes.Prefix`` | String | The substring of the key after the prefix as defined by the ``prefix`` request parameter. |
366+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
367
368ENABLE/SUSPEND BUCKET VERSIONING
369--------------------------------
370
371``PUT /?versioning`` This subresource set the versioning state of an existing bucket. To set the versioning state, you must be the bucket owner.
372
373You can set the versioning state with one of the following values:
374
375- Enabled : Enables versioning for the objects in the bucket, All objects added to the bucket receive a unique version ID.
376- Suspended : Disables versioning for the objects in the bucket, All objects added to the bucket receive the version ID null.
377
378If the versioning state has never been set on a bucket, it has no versioning state; a GET versioning request does not return a versioning state value.
379
380Syntax
381~~~~~~
382
383::
384
385 PUT /{bucket}?versioning HTTP/1.1
386
387REQUEST ENTITIES
388~~~~~~~~~~~~~~~~
389
390+-----------------------------+-----------+---------------------------------------------------------------------------+
391| Name | Type | Description |
392+=============================+===========+===========================================================================+
393| ``VersioningConfiguration`` | Container | A container for the request. |
394+-----------------------------+-----------+---------------------------------------------------------------------------+
395| ``Status`` | String | Sets the versioning state of the bucket. Valid Values: Suspended/Enabled |
c07f9fc5 396+-----------------------------+-----------+---------------------------------------------------------------------------+
eafe8130
TL
397
398PUT BUCKET OBJECT LOCK
399--------------------------------
400
401Places an Object Lock configuration on the specified bucket. The rule specified in the Object Lock configuration will be
402applied by default to every new object placed in the specified bucket.
403
404Syntax
405~~~~~~
406
407::
408
409 PUT /{bucket}?object-lock HTTP/1.1
410
411Request Entities
412~~~~~~~~~~~~~~~~
413
414+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
415| Name | Type | Description | Required |
416+=============================+=============+========================================================================================+==========+
417| ``ObjectLockConfiguration`` | Container | A container for the request. | Yes |
418+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
419| ``ObjectLockEnabled`` | String | Indicates whether this bucket has an Object Lock configuration enabled. | Yes |
420+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
421| ``Rule`` | Container | The Object Lock rule in place for the specified bucket. | No |
422+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
423| ``DefaultRetention`` | Container | The default retention period applied to new objects placed in the specified bucket. | No |
424+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
425| ``Mode`` | String | The default Object Lock retention mode. Valid Values: GOVERNANCE/COMPLIANCE | Yes |
426+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
427| ``Days`` | Integer | The number of days specified for the default retention period. | No |
428+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
429| ``Years`` | Integer | The number of years specified for the default retention period. | No |
430+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
431
432HTTP Response
433~~~~~~~~~~~~~
434
435If the bucket object lock is not enabled when creating the bucket, the operation will fail.
436
437+---------------+-----------------------+----------------------------------------------------------+
438| HTTP Status | Status Code | Description |
439+===============+=======================+==========================================================+
440| ``400`` | MalformedXML | The XML is not well-formed |
441+---------------+-----------------------+----------------------------------------------------------+
442| ``409`` | InvalidBucketState | The bucket object lock is not enabled |
443+---------------+-----------------------+----------------------------------------------------------+
444
445GET BUCKET OBJECT LOCK
446--------------------------------
447
448Gets the Object Lock configuration for a bucket. The rule specified in the Object Lock configuration will be applied by
449default to every new object placed in the specified bucket.
450
451Syntax
452~~~~~~
453
454::
455
456 GET /{bucket}?object-lock HTTP/1.1
457
458
459Response Entities
460~~~~~~~~~~~~~~~~~
461
462+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
463| Name | Type | Description | Required |
464+=============================+=============+========================================================================================+==========+
465| ``ObjectLockConfiguration`` | Container | A container for the request. | Yes |
466+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
467| ``ObjectLockEnabled`` | String | Indicates whether this bucket has an Object Lock configuration enabled. | Yes |
468+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
469| ``Rule`` | Container | The Object Lock rule in place for the specified bucket. | No |
470+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
471| ``DefaultRetention`` | Container | The default retention period applied to new objects placed in the specified bucket. | No |
472+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
473| ``Mode`` | String | The default Object Lock retention mode. Valid Values: GOVERNANCE/COMPLIANCE | Yes |
474+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
475| ``Days`` | Integer | The number of days specified for the default retention period. | No |
476+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
477| ``Years`` | Integer | The number of years specified for the default retention period. | No |
478+-----------------------------+-------------+----------------------------------------------------------------------------------------+----------+
479
480Create Notification
481-------------------
482
483Create a publisher for a specific bucket into a topic.
484
485Syntax
486~~~~~~
487
488::
489
1e59de90 490 PUT /{bucket}?notification HTTP/1.1
eafe8130
TL
491
492
493Request Entities
494~~~~~~~~~~~~~~~~
495
496Parameters are XML encoded in the body of the request, in the following format:
497
498::
499
500 <NotificationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
501 <TopicConfiguration>
502 <Id></Id>
503 <Topic></Topic>
504 <Event></Event>
505 <Filter>
506 <S3Key>
507 <FilterRule>
508 <Name></Name>
509 <Value></Value>
510 </FilterRule>
511 </S3Key>
512 <S3Metadata>
513 <FilterRule>
514 <Name></Name>
515 <Value></Value>
516 </FilterRule>
9f95a23c
TL
517 </S3Metadata>
518 <S3Tags>
519 <FilterRule>
520 <Name></Name>
521 <Value></Value>
522 </FilterRule>
523 </S3Tags>
eafe8130
TL
524 </Filter>
525 </TopicConfiguration>
526 </NotificationConfiguration>
527
528+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
529| Name | Type | Description | Required |
530+===============================+===========+======================================================================================+==========+
531| ``NotificationConfiguration`` | Container | Holding list of ``TopicConfiguration`` entities | Yes |
532+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
533| ``TopicConfiguration`` | Container | Holding ``Id``, ``Topic`` and list of ``Event`` entities | Yes |
534+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
535| ``Id`` | String | Name of the notification | Yes |
536+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
537| ``Topic`` | String | Topic ARN. Topic must be created beforehand | Yes |
538+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
539| ``Event`` | String | List of supported events see: `S3 Notification Compatibility`_. Multiple ``Event`` | No |
540| | | entities can be used. If omitted, all events are handled | |
541+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
9f95a23c 542| ``Filter`` | Container | Holding ``S3Key``, ``S3Metadata`` and ``S3Tags`` entities | No |
eafe8130
TL
543+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
544| ``S3Key`` | Container | Holding a list of ``FilterRule`` entities, for filtering based on object key. | No |
545| | | At most, 3 entities may be in the list, with ``Name`` be ``prefix``, ``suffix`` or | |
546| | | ``regex``. All filter rules in the list must match for the filter to match. | |
547+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
548| ``S3Metadata`` | Container | Holding a list of ``FilterRule`` entities, for filtering based on object metadata. | No |
9f95a23c
TL
549| | | All filter rules in the list must match the metadata defined on the object. However, | |
550| | | the object still match if it has other metadata entries not listed in the filter. | |
551+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
552| ``S3Tags`` | Container | Holding a list of ``FilterRule`` entities, for filtering based on object tags. | No |
553| | | All filter rules in the list must match the tags defined on the object. However, | |
554| | | the object still match it it has other tags not listed in the filter. | |
eafe8130
TL
555+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
556| ``S3Key.FilterRule`` | Container | Holding ``Name`` and ``Value`` entities. ``Name`` would be: ``prefix``, ``suffix`` | Yes |
557| | | or ``regex``. The ``Value`` would hold the key prefix, key suffix or a regular | |
558| | | expression for matching the key, accordingly. | |
559+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
560| ``S3Metadata.FilterRule`` | Container | Holding ``Name`` and ``Value`` entities. ``Name`` would be the name of the metadata | Yes |
561| | | attribute (e.g. ``x-amz-meta-xxx``). The ``Value`` would be the expected value for | |
9f95a23c
TL
562| | | this attribute. | |
563+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
564| ``S3Tags.FilterRule`` | Container | Holding ``Name`` and ``Value`` entities. ``Name`` would be the tag key, | Yes |
565| | | and ``Value`` would be the tag value. | |
eafe8130
TL
566+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
567
568
569HTTP Response
570~~~~~~~~~~~~~
571
572+---------------+-----------------------+----------------------------------------------------------+
573| HTTP Status | Status Code | Description |
574+===============+=======================+==========================================================+
575| ``400`` | MalformedXML | The XML is not well-formed |
576+---------------+-----------------------+----------------------------------------------------------+
577| ``400`` | InvalidArgument | Missing Id; Missing/Invalid Topic ARN; Invalid Event |
578+---------------+-----------------------+----------------------------------------------------------+
579| ``404`` | NoSuchBucket | The bucket does not exist |
580+---------------+-----------------------+----------------------------------------------------------+
581| ``404`` | NoSuchKey | The topic does not exist |
582+---------------+-----------------------+----------------------------------------------------------+
583
584
585Delete Notification
586-------------------
587
588Delete a specific, or all, notifications from a bucket.
589
590.. note::
591
592 - Notification deletion is an extension to the S3 notification API
593 - When the bucket is deleted, any notification defined on it is also deleted
9f95a23c 594 - Deleting an unknown notification (e.g. double delete) is not considered an error
eafe8130
TL
595
596Syntax
597~~~~~~
598
599::
600
1e59de90 601 DELETE /{bucket}?notification[=<notification-id>] HTTP/1.1
eafe8130
TL
602
603
604Parameters
605~~~~~~~~~~
606
607+------------------------+-----------+----------------------------------------------------------------------------------------+
608| Name | Type | Description |
609+========================+===========+========================================================================================+
610| ``notification-id`` | String | Name of the notification. If not provided, all notifications on the bucket are deleted |
611+------------------------+-----------+----------------------------------------------------------------------------------------+
612
613HTTP Response
614~~~~~~~~~~~~~
615
616+---------------+-----------------------+----------------------------------------------------------+
617| HTTP Status | Status Code | Description |
618+===============+=======================+==========================================================+
619| ``404`` | NoSuchBucket | The bucket does not exist |
620+---------------+-----------------------+----------------------------------------------------------+
621
622Get/List Notification
623---------------------
624
625Get a specific notification, or list all notifications configured on a bucket.
626
627Syntax
628~~~~~~
629
630::
631
1e59de90 632 GET /{bucket}?notification[=<notification-id>] HTTP/1.1
eafe8130
TL
633
634
635Parameters
636~~~~~~~~~~
637
638+------------------------+-----------+----------------------------------------------------------------------------------------+
639| Name | Type | Description |
640+========================+===========+========================================================================================+
641| ``notification-id`` | String | Name of the notification. If not provided, all notifications on the bucket are listed |
642+------------------------+-----------+----------------------------------------------------------------------------------------+
643
644Response Entities
645~~~~~~~~~~~~~~~~~
646
647Response is XML encoded in the body of the request, in the following format:
648
649::
650
651 <NotificationConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
652 <TopicConfiguration>
653 <Id></Id>
654 <Topic></Topic>
655 <Event></Event>
656 <Filter>
657 <S3Key>
658 <FilterRule>
659 <Name></Name>
660 <Value></Value>
661 </FilterRule>
662 </S3Key>
663 <S3Metadata>
664 <FilterRule>
665 <Name></Name>
666 <Value></Value>
667 </FilterRule>
9f95a23c
TL
668 </S3Metadata>
669 <S3Tags>
670 <FilterRule>
671 <Name></Name>
672 <Value></Value>
673 </FilterRule>
674 </S3Tags>
eafe8130
TL
675 </Filter>
676 </TopicConfiguration>
677 </NotificationConfiguration>
678
679+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
680| Name | Type | Description | Required |
681+===============================+===========+======================================================================================+==========+
682| ``NotificationConfiguration`` | Container | Holding list of ``TopicConfiguration`` entities | Yes |
683+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
684| ``TopicConfiguration`` | Container | Holding ``Id``, ``Topic`` and list of ``Event`` entities | Yes |
685+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
686| ``Id`` | String | Name of the notification | Yes |
687+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
688| ``Topic`` | String | Topic ARN | Yes |
689+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
690| ``Event`` | String | Handled event. Multiple ``Event`` entities may exist | Yes |
691+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
692| ``Filter`` | Container | Holding the filters configured for this notification | No |
693+-------------------------------+-----------+--------------------------------------------------------------------------------------+----------+
694
695HTTP Response
696~~~~~~~~~~~~~
697
698+---------------+-----------------------+----------------------------------------------------------+
699| HTTP Status | Status Code | Description |
700+===============+=======================+==========================================================+
701| ``404`` | NoSuchBucket | The bucket does not exist |
702+---------------+-----------------------+----------------------------------------------------------+
703| ``404`` | NoSuchKey | The notification does not exist (if provided) |
704+---------------+-----------------------+----------------------------------------------------------+
705
9f95a23c 706.. _S3 Notification Compatibility: ../../s3-notification-compatibility