]> git.proxmox.com Git - ceph.git/blame - ceph/doc/radosgw/s3/objectops.rst
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / doc / radosgw / s3 / objectops.rst
CommitLineData
7c673cae
FG
1Object Operations
2=================
3
4Put Object
5----------
6Adds an object to a bucket. You must have write permissions on the bucket to perform this operation.
7
8
9Syntax
10~~~~~~
11
12::
13
14 PUT /{bucket}/{object} HTTP/1.1
15
16Request Headers
17~~~~~~~~~~~~~~~
18
19+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
20| Name | Description | Valid Values | Required |
21+======================+============================================+===============================================================================+============+
22| **content-md5** | A base64 encoded MD-5 hash of the message. | A string. No defaults or constraints. | No |
23+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
24| **content-type** | A standard MIME type. | Any MIME type. Default: ``binary/octet-stream`` | No |
25+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
26| **x-amz-meta-<...>** | User metadata. Stored with the object. | A string up to 8kb. No defaults. | No |
27+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
28| **x-amz-acl** | A canned ACL. | ``private``, ``public-read``, ``public-read-write``, ``authenticated-read`` | No |
29+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
30
31
32Copy Object
33-----------
34To copy an object, use ``PUT`` and specify a destination bucket and the object name.
35
36Syntax
37~~~~~~
38
39::
40
41 PUT /{dest-bucket}/{dest-object} HTTP/1.1
42 x-amz-copy-source: {source-bucket}/{source-object}
43
44Request Headers
45~~~~~~~~~~~~~~~
46
47+--------------------------------------+-------------------------------------------------+------------------------+------------+
48| Name | Description | Valid Values | Required |
49+======================================+=================================================+========================+============+
50| **x-amz-copy-source** | The source bucket name + object name. | {bucket}/{obj} | Yes |
51+--------------------------------------+-------------------------------------------------+------------------------+------------+
52| **x-amz-acl** | A canned ACL. | ``private``, | No |
53| | | ``public-read``, | |
54| | | ``public-read-write``, | |
55| | | ``authenticated-read`` | |
56+--------------------------------------+-------------------------------------------------+------------------------+------------+
57| **x-amz-copy-if-modified-since** | Copies only if modified since the timestamp. | Timestamp | No |
58+--------------------------------------+-------------------------------------------------+------------------------+------------+
59| **x-amz-copy-if-unmodified-since** | Copies only if unmodified since the timestamp. | Timestamp | No |
60+--------------------------------------+-------------------------------------------------+------------------------+------------+
61| **x-amz-copy-if-match** | Copies only if object ETag matches ETag. | Entity Tag | No |
62+--------------------------------------+-------------------------------------------------+------------------------+------------+
63| **x-amz-copy-if-none-match** | Copies only if object ETag doesn't match. | Entity Tag | No |
64+--------------------------------------+-------------------------------------------------+------------------------+------------+
65
66Response Entities
67~~~~~~~~~~~~~~~~~
68
69+------------------------+-------------+-----------------------------------------------+
70| Name | Type | Description |
71+========================+=============+===============================================+
72| **CopyObjectResult** | Container | A container for the response elements. |
73+------------------------+-------------+-----------------------------------------------+
74| **LastModified** | Date | The last modified date of the source object. |
75+------------------------+-------------+-----------------------------------------------+
76| **Etag** | String | The ETag of the new object. |
77+------------------------+-------------+-----------------------------------------------+
78
79Remove Object
80-------------
81
82Removes an object. Requires WRITE permission set on the containing bucket.
83
84Syntax
85~~~~~~
86
87::
88
89 DELETE /{bucket}/{object} HTTP/1.1
90
91
92
93Get Object
94----------
95Retrieves an object from a bucket within RADOS.
96
97Syntax
98~~~~~~
99
100::
101
102 GET /{bucket}/{object} HTTP/1.1
103
104Request Headers
105~~~~~~~~~~~~~~~
106
107+---------------------------+------------------------------------------------+--------------------------------+------------+
108| Name | Description | Valid Values | Required |
109+===========================+================================================+================================+============+
110| **range** | The range of the object to retrieve. | Range: bytes=beginbyte-endbyte | No |
111+---------------------------+------------------------------------------------+--------------------------------+------------+
112| **if-modified-since** | Gets only if modified since the timestamp. | Timestamp | No |
113+---------------------------+------------------------------------------------+--------------------------------+------------+
114| **if-unmodified-since** | Gets only if not modified since the timestamp. | Timestamp | No |
115+---------------------------+------------------------------------------------+--------------------------------+------------+
116| **if-match** | Gets only if object ETag matches ETag. | Entity Tag | No |
117+---------------------------+------------------------------------------------+--------------------------------+------------+
118| **if-none-match** | Gets only if object ETag matches ETag. | Entity Tag | No |
119+---------------------------+------------------------------------------------+--------------------------------+------------+
120
121Response Headers
122~~~~~~~~~~~~~~~~
123
124+-------------------+--------------------------------------------------------------------------------------------+
125| Name | Description |
126+===================+============================================================================================+
127| **Content-Range** | Data range, will only be returned if the range header field was specified in the request |
128+-------------------+--------------------------------------------------------------------------------------------+
129
130Get Object Info
131---------------
132
133Returns information about object. This request will return the same
134header information as with the Get Object request, but will include
135the metadata only, not the object data payload.
136
137Syntax
138~~~~~~
139
140::
141
142 HEAD /{bucket}/{object} HTTP/1.1
143
144Request Headers
145~~~~~~~~~~~~~~~
146
147+---------------------------+------------------------------------------------+--------------------------------+------------+
148| Name | Description | Valid Values | Required |
149+===========================+================================================+================================+============+
150| **range** | The range of the object to retrieve. | Range: bytes=beginbyte-endbyte | No |
151+---------------------------+------------------------------------------------+--------------------------------+------------+
152| **if-modified-since** | Gets only if modified since the timestamp. | Timestamp | No |
153+---------------------------+------------------------------------------------+--------------------------------+------------+
154| **if-unmodified-since** | Gets only if not modified since the timestamp. | Timestamp | No |
155+---------------------------+------------------------------------------------+--------------------------------+------------+
156| **if-match** | Gets only if object ETag matches ETag. | Entity Tag | No |
157+---------------------------+------------------------------------------------+--------------------------------+------------+
158| **if-none-match** | Gets only if object ETag matches ETag. | Entity Tag | No |
159+---------------------------+------------------------------------------------+--------------------------------+------------+
160
161Get Object ACL
162--------------
163
164Syntax
165~~~~~~
166
167::
168
169 GET /{bucket}/{object}?acl HTTP/1.1
170
171Response Entities
172~~~~~~~~~~~~~~~~~
173
174+---------------------------+-------------+----------------------------------------------------------------------------------------------+
175| Name | Type | Description |
176+===========================+=============+==============================================================================================+
177| ``AccessControlPolicy`` | Container | A container for the response. |
178+---------------------------+-------------+----------------------------------------------------------------------------------------------+
179| ``AccessControlList`` | Container | A container for the ACL information. |
180+---------------------------+-------------+----------------------------------------------------------------------------------------------+
181| ``Owner`` | Container | A container for the object owner's ``ID`` and ``DisplayName``. |
182+---------------------------+-------------+----------------------------------------------------------------------------------------------+
183| ``ID`` | String | The object owner's ID. |
184+---------------------------+-------------+----------------------------------------------------------------------------------------------+
185| ``DisplayName`` | String | The object owner's display name. |
186+---------------------------+-------------+----------------------------------------------------------------------------------------------+
187| ``Grant`` | Container | A container for ``Grantee`` and ``Permission``. |
188+---------------------------+-------------+----------------------------------------------------------------------------------------------+
189| ``Grantee`` | Container | A container for the ``DisplayName`` and ``ID`` of the user receiving a grant of permission. |
190+---------------------------+-------------+----------------------------------------------------------------------------------------------+
191| ``Permission`` | String | The permission given to the ``Grantee`` object. |
192+---------------------------+-------------+----------------------------------------------------------------------------------------------+
193
194
195
196Set Object ACL
197--------------
198
199Syntax
200~~~~~~
201
202::
203
204 PUT /{bucket}/{object}?acl
205
206Request Entities
207~~~~~~~~~~~~~~~~
208
209+---------------------------+-------------+----------------------------------------------------------------------------------------------+
210| Name | Type | Description |
211+===========================+=============+==============================================================================================+
212| ``AccessControlPolicy`` | Container | A container for the response. |
213+---------------------------+-------------+----------------------------------------------------------------------------------------------+
214| ``AccessControlList`` | Container | A container for the ACL information. |
215+---------------------------+-------------+----------------------------------------------------------------------------------------------+
216| ``Owner`` | Container | A container for the object owner's ``ID`` and ``DisplayName``. |
217+---------------------------+-------------+----------------------------------------------------------------------------------------------+
218| ``ID`` | String | The object owner's ID. |
219+---------------------------+-------------+----------------------------------------------------------------------------------------------+
220| ``DisplayName`` | String | The object owner's display name. |
221+---------------------------+-------------+----------------------------------------------------------------------------------------------+
222| ``Grant`` | Container | A container for ``Grantee`` and ``Permission``. |
223+---------------------------+-------------+----------------------------------------------------------------------------------------------+
224| ``Grantee`` | Container | A container for the ``DisplayName`` and ``ID`` of the user receiving a grant of permission. |
225+---------------------------+-------------+----------------------------------------------------------------------------------------------+
226| ``Permission`` | String | The permission given to the ``Grantee`` object. |
227+---------------------------+-------------+----------------------------------------------------------------------------------------------+
228
229
230
231Initiate Multi-part Upload
232--------------------------
233
234Initiate a multi-part upload process.
235
236Syntax
237~~~~~~
238
239::
240
241 POST /{bucket}/{object}?uploads
242
243Request Headers
244~~~~~~~~~~~~~~~
245
246+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
247| Name | Description | Valid Values | Required |
248+======================+============================================+===============================================================================+============+
249| **content-md5** | A base64 encoded MD-5 hash of the message. | A string. No defaults or constraints. | No |
250+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
251| **content-type** | A standard MIME type. | Any MIME type. Default: ``binary/octet-stream`` | No |
252+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
253| **x-amz-meta-<...>** | User metadata. Stored with the object. | A string up to 8kb. No defaults. | No |
254+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
255| **x-amz-acl** | A canned ACL. | ``private``, ``public-read``, ``public-read-write``, ``authenticated-read`` | No |
256+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
257
258
259Response Entities
260~~~~~~~~~~~~~~~~~
261
262+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
263| Name | Type | Description |
264+=========================================+=============+==========================================================================================================+
265| ``InitiatedMultipartUploadsResult`` | Container | A container for the results. |
266+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
267| ``Bucket`` | String | The bucket that will receive the object contents. |
268+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
269| ``Key`` | String | The key specified by the ``key`` request parameter (if any). |
270+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
271| ``UploadId`` | String | The ID specified by the ``upload-id`` request parameter identifying the multipart upload (if any). |
272+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
273
274
275Multipart Upload Part
276---------------------
277
278Syntax
279~~~~~~
280
281::
282
283 PUT /{bucket}/{object}?partNumber=&uploadId= HTTP/1.1
284
285HTTP Response
286~~~~~~~~~~~~~
287
288The following HTTP response may be returned:
289
290+---------------+----------------+--------------------------------------------------------------------------+
291| HTTP Status | Status Code | Description |
292+===============+================+==========================================================================+
293| **404** | NoSuchUpload | Specified upload-id does not match any initiated upload on this object |
294+---------------+----------------+--------------------------------------------------------------------------+
295
296List Multipart Upload Parts
297---------------------------
298
299Syntax
300~~~~~~
301
302::
303
304 GET /{bucket}/{object}?uploadId=123 HTTP/1.1
305
306Response Entities
307~~~~~~~~~~~~~~~~~
308
309+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
310| Name | Type | Description |
311+=========================================+=============+==========================================================================================================+
312| ``ListPartsResult`` | Container | A container for the results. |
313+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
314| ``Bucket`` | String | The bucket that will receive the object contents. |
315+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
316| ``Key`` | String | The key specified by the ``key`` request parameter (if any). |
317+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
318| ``UploadId`` | String | The ID specified by the ``upload-id`` request parameter identifying the multipart upload (if any). |
319+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
320| ``Initiator`` | Container | Contains the ``ID`` and ``DisplayName`` of the user who initiated the upload. |
321+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
322| ``ID`` | String | The initiator's ID. |
323+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
324| ``DisplayName`` | String | The initiator's display name. |
325+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
326| ``Owner`` | Container | A container for the ``ID`` and ``DisplayName`` of the user who owns the uploaded object. |
327+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
328| ``StorageClass`` | String | The method used to store the resulting object. ``STANDARD`` or ``REDUCED_REDUNDANCY`` |
329+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
330| ``PartNumberMarker`` | String | The part marker to use in a subsequent request if ``IsTruncated`` is ``true``. Precedes the list. |
331+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
332| ``NextPartNumberMarker`` | String | The next part marker to use in a subsequent request if ``IsTruncated`` is ``true``. The end of the list. |
333+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
334| ``MaxParts`` | Integer | The max parts allowed in the response as specified by the ``max-parts`` request parameter. |
335+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
336| ``IsTruncated`` | Boolean | If ``true``, only a subset of the object's upload contents were returned. |
337+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
338| ``Part`` | Container | A container for ``LastModified``, ``PartNumber``, ``ETag`` and ``Size`` elements. |
339+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
340| ``LastModified`` | Date | Date and time at which the part was uploaded. |
341+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
342| ``PartNumber`` | Integer | The identification number of the part. |
343+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
344| ``ETag`` | String | The part's entity tag. |
345+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
346| ``Size`` | Integer | The size of the uploaded part. |
347+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
348
349
350
351Complete Multipart Upload
352-------------------------
353Assembles uploaded parts and creates a new object, thereby completing a multipart upload.
354
355Syntax
356~~~~~~
357
358::
359
360 POST /{bucket}/{object}?uploadId= HTTP/1.1
361
362Request Entities
363~~~~~~~~~~~~~~~~
364
365+----------------------------------+-------------+-----------------------------------------------------+----------+
366| Name | Type | Description | Required |
367+==================================+=============+=====================================================+==========+
368| ``CompleteMultipartUpload`` | Container | A container consisting of one or more parts. | Yes |
369+----------------------------------+-------------+-----------------------------------------------------+----------+
370| ``Part`` | Container | A container for the ``PartNumber`` and ``ETag``. | Yes |
371+----------------------------------+-------------+-----------------------------------------------------+----------+
372| ``PartNumber`` | Integer | The identifier of the part. | Yes |
373+----------------------------------+-------------+-----------------------------------------------------+----------+
374| ``ETag`` | String | The part's entity tag. | Yes |
375+----------------------------------+-------------+-----------------------------------------------------+----------+
376
377
378Response Entities
379~~~~~~~~~~~~~~~~~
380
381+-------------------------------------+-------------+-------------------------------------------------------+
382| Name | Type | Description |
383+=====================================+=============+=======================================================+
384| **CompleteMultipartUploadResult** | Container | A container for the response. |
385+-------------------------------------+-------------+-------------------------------------------------------+
386| **Location** | URI | The resource identifier (path) of the new object. |
387+-------------------------------------+-------------+-------------------------------------------------------+
388| **Bucket** | String | The name of the bucket that contains the new object. |
389+-------------------------------------+-------------+-------------------------------------------------------+
390| **Key** | String | The object's key. |
391+-------------------------------------+-------------+-------------------------------------------------------+
392| **ETag** | String | The entity tag of the new object. |
393+-------------------------------------+-------------+-------------------------------------------------------+
394
395Abort Multipart Upload
396----------------------
397
398Syntax
399~~~~~~
400
401::
402
403 DELETE /{bucket}/{object}?uploadId= HTTP/1.1
11fdf7f2
TL
404
405
406Append Object
407-------------
408Append data to an object. You must have write permissions on the bucket to perform this operation.
409It is used to upload files in appending mode. The type of the objects created by the Append Object
410operation is Appendable Object, and the type of the objects uploaded with the Put Object operation is Normal Object.
411**Append Object can't be used if bucket versioning is enabled or suspended.**
412**Synced object will become normal in multisite, but you can still append to the original object.**
413
414
415Syntax
416~~~~~~
417
418::
419
420 PUT /{bucket}/{object}?append&position= HTTP/1.1
421
422Request Headers
423~~~~~~~~~~~~~~~
424
425+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
426| Name | Description | Valid Values | Required |
427+======================+============================================+===============================================================================+============+
428| **content-md5** | A base64 encoded MD-5 hash of the message. | A string. No defaults or constraints. | No |
429+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
430| **content-type** | A standard MIME type. | Any MIME type. Default: ``binary/octet-stream`` | No |
431+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
432| **x-amz-meta-<...>** | User metadata. Stored with the object. | A string up to 8kb. No defaults. | No |
433+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
434| **x-amz-acl** | A canned ACL. | ``private``, ``public-read``, ``public-read-write``, ``authenticated-read`` | No |
435+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
436
437Response Headers
438~~~~~~~~~~~~~~~~
439
440+--------------------------------+------------------------------------------------------------------+
441| Name | Description |
442+================================+==================================================================+
443| **x-rgw-next-append-position** | Next position to append object |
444+--------------------------------+------------------------------------------------------------------+
445
446HTTP Response
447~~~~~~~~~~~~~
448
449The following HTTP response may be returned:
450
451+---------------+----------------------------+---------------------------------------------------+
452| HTTP Status | Status Code | Description |
453+===============+============================+===================================================+
454| **409** | PositionNotEqualToLength | Specified position does not match object length |
455+---------------+----------------------------+---------------------------------------------------+
456| **409** | ObjectNotAppendable | Specified object can not be appended |
457+---------------+----------------------------+---------------------------------------------------+
458| **409** | InvalidBucketstate | Bucket versioning is enabled or suspended |
459+---------------+----------------------------+---------------------------------------------------+
460