对象操作¶
Put Object¶
Adds an object to a bucket. You must have write permissions on the bucket to perform this operation.
语法¶
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: |
No |
x-amz-meta-<…> |
User metadata. Stored with the object. |
A string up to 8kb. No defaults. |
No |
x-amz-acl |
A canned ACL. |
|
No |
Copy Object¶
To copy an object, use PUT
and specify a destination bucket and the object name.
语法¶
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. |
|
No |
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.
语法¶
DELETE /{bucket}/{object} HTTP/1.1
Get Object¶
Retrieves an object from a bucket within RADOS.
语法¶
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.
语法¶
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¶
语法¶
GET /{bucket}/{object}?acl HTTP/1.1
Response Entities¶
Name |
Type |
Description |
---|---|---|
|
Container |
A container for the response. |
|
Container |
A container for the ACL information. |
|
Container |
A container for the object owner’s |
|
String |
The object owner’s ID. |
|
String |
The object owner’s display name. |
|
Container |
A container for |
|
Container |
A container for the |
|
String |
The permission given to the |
Set Object ACL¶
语法¶
PUT /{bucket}/{object}?acl
Request Entities¶
Name |
Type |
Description |
---|---|---|
|
Container |
A container for the response. |
|
Container |
A container for the ACL information. |
|
Container |
A container for the object owner’s |
|
String |
The object owner’s ID. |
|
String |
The object owner’s display name. |
|
Container |
A container for |
|
Container |
A container for the |
|
String |
The permission given to the |
Initiate Multi-part Upload¶
Initiate a multi-part upload process.
语法¶
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: |
No |
x-amz-meta-<…> |
User metadata. Stored with the object. |
A string up to 8kb. No defaults. |
No |
x-amz-acl |
A canned ACL. |
|
No |
Response Entities¶
Name |
Type |
Description |
---|---|---|
|
Container |
A container for the results. |
|
String |
The bucket that will receive the object contents. |
|
String |
The key specified by the |
|
String |
The ID specified by the |
Multipart Upload Part¶
语法¶
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¶
语法¶
GET /{bucket}/{object}?uploadId=123 HTTP/1.1
Response Entities¶
Name |
Type |
Description |
---|---|---|
|
Container |
A container for the results. |
|
String |
The bucket that will receive the object contents. |
|
String |
The key specified by the |
|
String |
The ID specified by the |
|
Container |
Contains the |
|
String |
The initiator’s ID. |
|
String |
The initiator’s display name. |
|
Container |
A container for the |
|
String |
The method used to store the resulting object. |
|
String |
The part marker to use in a subsequent request if |
|
String |
The next part marker to use in a subsequent request if |
|
Integer |
The max parts allowed in the response as specified by the |
|
Boolean |
If |
|
Container |
A container for |
|
Date |
Date and time at which the part was uploaded. |
|
Integer |
The identification number of the part. |
|
String |
The part’s entity tag. |
|
Integer |
The size of the uploaded part. |
Complete Multipart Upload¶
Assembles uploaded parts and creates a new object, thereby completing a multipart upload.
语法¶
POST /{bucket}/{object}?uploadId= HTTP/1.1
Request Entities¶
Name |
Type |
Description |
Required |
---|---|---|---|
|
Container |
A container consisting of one or more parts. |
Yes |
|
Container |
A container for the |
Yes |
|
Integer |
The identifier of the part. |
Yes |
|
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. |