summaryrefslogtreecommitdiffstats
path: root/src/ceph/doc/radosgw/s3/objectops.rst
blob: b8a2475bf9d684ca2be26ffdd229aa283cbe962d (plain)
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
Object Operations
=================

Put Object
----------
Adds an object to a bucket. You must have write permissions on the bucket to perform this operation.


Syntax
~~~~~~

::

    PUT /{bucket}/{object} HTTP/1.1

Request Headers
~~~~~~~~~~~~~~~

+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
| Name                 | Description                                | Valid Values                                                                  | Required   |
+======================+============================================+===============================================================================+============+
| **content-md5**      | A base64 encoded MD-5 hash of the message. | A string. No defaults or constraints.                                         | No         |
+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
| **content-type**     | A standard MIME type.                      | Any MIME type. Default: ``binary/octet-stream``                               | No         |
+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
| **x-amz-meta-<...>** | User metadata.  Stored with the object.    | A string up to 8kb. No defaults.                                              | No         |
+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
| **x-amz-acl**        | A canned ACL.                              | ``private``, ``public-read``, ``public-read-write``, ``authenticated-read``   | No         |
+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+


Copy Object
-----------
To copy an object, use ``PUT`` and specify a destination bucket and the object name.

Syntax
~~~~~~

::

    PUT /{dest-bucket}/{dest-object} HTTP/1.1
    x-amz-copy-source: {source-bucket}/{source-object}

Request Headers
~~~~~~~~~~~~~~~

+--------------------------------------+-------------------------------------------------+------------------------+------------+
| Name                                 | Description                                     | Valid Values           | Required   |
+======================================+=================================================+========================+============+
| **x-amz-copy-source**                | The source bucket name + object name.           | {bucket}/{obj}         | Yes        |
+--------------------------------------+-------------------------------------------------+------------------------+------------+
| **x-amz-acl**                        | A canned ACL.                                   | ``private``,           | No         |
|                                      |                                                 | ``public-read``,       |            |
|                                      |                                                 | ``public-read-write``, |            |
|                                      |                                                 | ``authenticated-read`` |            |
+--------------------------------------+-------------------------------------------------+------------------------+------------+
| **x-amz-copy-if-modified-since**     |  Copies only if modified since the timestamp.   |   Timestamp            | No         |
+--------------------------------------+-------------------------------------------------+------------------------+------------+
| **x-amz-copy-if-unmodified-since**   |  Copies only if unmodified since the timestamp. |   Timestamp            | No         |
+--------------------------------------+-------------------------------------------------+------------------------+------------+
| **x-amz-copy-if-match**              |  Copies only if object ETag matches ETag.       |   Entity Tag           | No         |
+--------------------------------------+-------------------------------------------------+------------------------+------------+
| **x-amz-copy-if-none-match**         |  Copies only if object ETag doesn't match.      |   Entity Tag           | No         |
+--------------------------------------+-------------------------------------------------+------------------------+------------+

Response Entities
~~~~~~~~~~~~~~~~~

+------------------------+-------------+-----------------------------------------------+
| Name                   | Type        | Description                                   |
+========================+=============+===============================================+
| **CopyObjectResult**   | Container   |  A container for the response elements.       |
+------------------------+-------------+-----------------------------------------------+
| **LastModified**       | Date        |  The last modified date of the source object. |
+------------------------+-------------+-----------------------------------------------+
| **Etag**               | String      |  The ETag of the new object.                  |
+------------------------+-------------+-----------------------------------------------+

Remove Object
-------------

Removes an object. Requires WRITE permission set on the containing bucket.

Syntax
~~~~~~

::

    DELETE /{bucket}/{object} HTTP/1.1



Get Object
----------
Retrieves an object from a bucket within RADOS. 

Syntax
~~~~~~

::

    GET /{bucket}/{object} HTTP/1.1

Request Headers
~~~~~~~~~~~~~~~

+---------------------------+------------------------------------------------+--------------------------------+------------+
| Name                      | Description                                    | Valid Values                   | Required   |
+===========================+================================================+================================+============+
| **range**                 | The range of the object to retrieve.           | Range: bytes=beginbyte-endbyte | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+
| **if-modified-since**     | Gets only if modified since the timestamp.     | Timestamp                      | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+
| **if-unmodified-since**   | Gets only if not modified since the timestamp. | Timestamp                      | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+
| **if-match**              | Gets only if object ETag matches ETag.         | Entity Tag                     | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+
| **if-none-match**         | Gets only if object ETag matches ETag.         | Entity Tag                     | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+

Response Headers
~~~~~~~~~~~~~~~~

+-------------------+--------------------------------------------------------------------------------------------+
| Name              | Description                                                                                |
+===================+============================================================================================+
| **Content-Range** | Data range, will only be returned if the range header field was specified in the request   |
+-------------------+--------------------------------------------------------------------------------------------+

Get Object Info
---------------

Returns information about object. This request will return the same
header information as with the Get Object request, but will include
the metadata only, not the object data payload.

Syntax
~~~~~~

::

    HEAD /{bucket}/{object} HTTP/1.1

Request Headers
~~~~~~~~~~~~~~~

+---------------------------+------------------------------------------------+--------------------------------+------------+
| Name                      | Description                                    | Valid Values                   | Required   |
+===========================+================================================+================================+============+
| **range**                 | The range of the object to retrieve.           | Range: bytes=beginbyte-endbyte | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+
| **if-modified-since**     | Gets only if modified since the timestamp.     | Timestamp                      | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+
| **if-unmodified-since**   | Gets only if not modified since the timestamp. | Timestamp                      | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+
| **if-match**              | Gets only if object ETag matches ETag.         | Entity Tag                     | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+
| **if-none-match**         | Gets only if object ETag matches ETag.         | Entity Tag                     | No         |
+---------------------------+------------------------------------------------+--------------------------------+------------+

Get Object ACL
--------------

Syntax
~~~~~~

::

    GET /{bucket}/{object}?acl HTTP/1.1

Response Entities
~~~~~~~~~~~~~~~~~

+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| Name                      | Type        | Description                                                                                  |
+===========================+=============+==============================================================================================+
| ``AccessControlPolicy``   | Container   | A container for the response.                                                                |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``AccessControlList``     | Container   | A container for the ACL information.                                                         |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``Owner``                 | Container   | A container for the object owner's ``ID`` and ``DisplayName``.                               |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``ID``                    | String      | The object owner's ID.                                                                       |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``DisplayName``           | String      | The object owner's display name.                                                             |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``Grant``                 | Container   | A container for ``Grantee`` and ``Permission``.                                              |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``Grantee``               | Container   | A container for the ``DisplayName`` and ``ID`` of the user receiving a grant of permission.  |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``Permission``            | String      | The permission given to the ``Grantee`` object.                                              |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+



Set Object ACL
--------------

Syntax
~~~~~~

::

    PUT /{bucket}/{object}?acl

Request Entities
~~~~~~~~~~~~~~~~

+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| Name                      | Type        | Description                                                                                  |
+===========================+=============+==============================================================================================+
| ``AccessControlPolicy``   | Container   | A container for the response.                                                                |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``AccessControlList``     | Container   | A container for the ACL information.                                                         |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``Owner``                 | Container   | A container for the object owner's ``ID`` and ``DisplayName``.                               |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``ID``                    | String      | The object owner's ID.                                                                       |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``DisplayName``           | String      | The object owner's display name.                                                             |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``Grant``                 | Container   | A container for ``Grantee`` and ``Permission``.                                              |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``Grantee``               | Container   | A container for the ``DisplayName`` and ``ID`` of the user receiving a grant of permission.  |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+
| ``Permission``            | String      | The permission given to the ``Grantee`` object.                                              |
+---------------------------+-------------+----------------------------------------------------------------------------------------------+



Initiate Multi-part Upload
--------------------------

Initiate a multi-part upload process.

Syntax
~~~~~~

::

    POST /{bucket}/{object}?uploads

Request Headers
~~~~~~~~~~~~~~~

+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
| Name                 | Description                                | Valid Values                                                                  | Required   |
+======================+============================================+===============================================================================+============+
| **content-md5**      | A base64 encoded MD-5 hash of the message. | A string. No defaults or constraints.                                         | No         |
+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
| **content-type**     | A standard MIME type.                      | Any MIME type. Default: ``binary/octet-stream``                               | No         |
+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
| **x-amz-meta-<...>** | User metadata.  Stored with the object.    | A string up to 8kb. No defaults.                                              | No         |
+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+
| **x-amz-acl**        | A canned ACL.                              | ``private``, ``public-read``, ``public-read-write``, ``authenticated-read``   | No         |
+----------------------+--------------------------------------------+-------------------------------------------------------------------------------+------------+


Response Entities
~~~~~~~~~~~~~~~~~

+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| Name                                    | Type        | Description                                                                                              |
+=========================================+=============+==========================================================================================================+
| ``InitiatedMultipartUploadsResult``     | Container   | A container for the results.                                                                             |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``Bucket``                              | String      | The bucket that will receive the object contents.                                                        |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``Key``                                 | String      | The key specified by the ``key`` request parameter (if any).                                             |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``UploadId``                            | String      | The ID specified by the ``upload-id`` request parameter identifying the multipart upload (if any).       |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+


Multipart Upload Part
---------------------

Syntax
~~~~~~

::

    PUT /{bucket}/{object}?partNumber=&uploadId= HTTP/1.1

HTTP Response
~~~~~~~~~~~~~

The following HTTP response may be returned:

+---------------+----------------+--------------------------------------------------------------------------+
| HTTP Status   | Status Code    | Description                                                              |
+===============+================+==========================================================================+
| **404**       | NoSuchUpload   | Specified upload-id does not match any initiated upload on this object   |
+---------------+----------------+--------------------------------------------------------------------------+

List Multipart Upload Parts
---------------------------

Syntax
~~~~~~

::

    GET /{bucket}/{object}?uploadId=123 HTTP/1.1

Response Entities
~~~~~~~~~~~~~~~~~

+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| Name                                    | Type        | Description                                                                                              |
+=========================================+=============+==========================================================================================================+
| ``ListPartsResult``                     | Container   | A container for the results.                                                                             |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``Bucket``                              | String      | The bucket that will receive the object contents.                                                        |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``Key``                                 | String      | The key specified by the ``key`` request parameter (if any).                                             |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``UploadId``                            | String      | The ID specified by the ``upload-id`` request parameter identifying the multipart upload (if any).       |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``Initiator``                           | Container   | Contains the ``ID`` and ``DisplayName`` of the user who initiated the upload.                            |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``ID``                                  | String      | The initiator's ID.                                                                                      |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``DisplayName``                         | String      | The initiator's display name.                                                                            |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``Owner``                               | Container   | A container for the ``ID`` and ``DisplayName`` of the user who owns the uploaded object.                 |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``StorageClass``                        | String      | The method used to store the resulting object. ``STANDARD`` or ``REDUCED_REDUNDANCY``                    |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``PartNumberMarker``                    | String      | The part marker to use in a subsequent request if ``IsTruncated`` is ``true``. Precedes the list.        |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``NextPartNumberMarker``                | String      | The next part marker to use in a subsequent request if ``IsTruncated`` is ``true``. The end of the list. |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``MaxParts``                            | Integer     | The max parts allowed in the response as specified by the ``max-parts`` request parameter.               |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``IsTruncated``                         | Boolean     | If ``true``, only a subset of the object's upload contents were returned.                                |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``Part``                                | Container   | A container for ``LastModified``, ``PartNumber``, ``ETag`` and ``Size`` elements.                        |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``LastModified``                        | Date        | Date and time at which the part was uploaded.                                                            |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``PartNumber``                          | Integer     | The identification number of the part.                                                                   |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``ETag``                                | String      | The part's entity tag.                                                                                   |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+
| ``Size``                                | Integer     | The size of the uploaded part.                                                                           |
+-----------------------------------------+-------------+----------------------------------------------------------------------------------------------------------+



Complete Multipart Upload
-------------------------
Assembles uploaded parts and creates a new object, thereby completing a multipart upload.

Syntax
~~~~~~

::

    POST /{bucket}/{object}?uploadId= HTTP/1.1

Request Entities
~~~~~~~~~~~~~~~~

+----------------------------------+-------------+-----------------------------------------------------+----------+
| Name                             | Type        | Description                                         | Required |
+==================================+=============+=====================================================+==========+
| ``CompleteMultipartUpload``      | Container   | A container consisting of one or more parts.        | Yes      |
+----------------------------------+-------------+-----------------------------------------------------+----------+
| ``Part``                         | Container   | A container for the ``PartNumber`` and ``ETag``.    | Yes      |
+----------------------------------+-------------+-----------------------------------------------------+----------+
| ``PartNumber``                   | Integer     | The identifier of the part.                         | Yes      |
+----------------------------------+-------------+-----------------------------------------------------+----------+
| ``ETag``                         | String      | The part's entity tag.                              | Yes      |
+----------------------------------+-------------+-----------------------------------------------------+----------+


Response Entities
~~~~~~~~~~~~~~~~~

+-------------------------------------+-------------+-------------------------------------------------------+
| Name                                | Type        | Description                                           |
+=====================================+=============+=======================================================+
| **CompleteMultipartUploadResult**   | Container   | A container for the response.                         |
+-------------------------------------+-------------+-------------------------------------------------------+
| **Location**                        | URI         | The resource identifier (path) of the new object.     |
+-------------------------------------+-------------+-------------------------------------------------------+
| **Bucket**                          | String      | The name of the bucket that contains the new object.  |
+-------------------------------------+-------------+-------------------------------------------------------+
| **Key**                             | String      | The object's key.                                     |
+-------------------------------------+-------------+-------------------------------------------------------+
| **ETag**                            | String      | The entity tag of the new object.                     |
+-------------------------------------+-------------+-------------------------------------------------------+

Abort Multipart Upload
----------------------

Syntax
~~~~~~

::

    DELETE /{bucket}/{object}?uploadId= HTTP/1.1