Get object content and metadata

 
MethodURIDescription
GET/v1/{account}/{container}/{object}​{?signature,​expires,​multipart-manifest}

Downloads the object content and gets the object metadata.

This operation returns the object metadata in the response headers and the object content in the response body.

If this is a large object, the response body contains the concatenated content of the segment objects. To get the manifest instead of concatenated segment objects for a static large object, use the multipart-manifest query parameter.

Example requests and responses:

  • Show object details for the goodbye object in the marktwain container: curl -i $publicURL/marktwain/goodbye -X GET -H "X-Auth-Token: $token"

    HTTP/1.1 200 OK
    Content-Length: 14
    Accept-Ranges: bytes
    Last-Modified: Wed, 15 Jan 2014 16:41:49 GMT
    Etag: 451e372e48e0f6b1114fa0724aa79fa1
    X-Timestamp: 1389804109.39027
    X-Object-Meta-Orig-Filename: goodbyeworld.txt
    Content-Type: application/octet-stream
    X-Trans-Id: tx8145a190241f4cf6b05f5-0052d82a34
    Date: Thu, 16 Jan 2014 18:51:32 GMT
    
    Goodbye World!

  • Show object details for the goodbye object, which does not exist, in the janeausten container:

    curl -i $publicURL/janeausten/goodbye -X GET -H "X-Auth-Token: $token"

    HTTP/1.1 404 Not Found
    Content-Length: 70
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx073f7cbb850c4c99934b9-0052d82b04
    Date: Thu, 16 Jan 2014 18:55:00 GMT
    
    <html><h1>Not Found</h1><p>The resource could not be found.</p></html>

For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.

Normal response codes: 200

Error response codes: NotFound (404)

 Request

This table shows the header parameters for the get object content and metadata request:

NameTypeDescription

X-Auth-Token

​String

(Optional)

Authentication token. If you omit this header, your request fails unless the account owner has granted you access through an access control list (ACL).

X-Newest

​Boolean

(Optional)

If set to True, Object Storage queries all replicas to return the most recent one. If you omit this header, Object Storage responds faster after it finds one valid replica. Because setting this header to True is more expensive for the back end, use it only when it is absolutely needed.

Range

​Dict

(Optional)

The ranges of content to get.

You can use the Range header to get portions of data by using one or more range specifications. To specify many ranges, separate the range specifications with a comma.

The types of range specifications are:

  • Byte range specification. Use FIRST_BYTE_OFFSET to specify the start of the data range, and LAST_BYTE_OFFSET to specify the end. You can omit the LAST_BYTE_OFFSET and if you do, the value defaults to the offset of the last byte of data.

  • Suffix byte range specification. Use LENGTH bytes to specify the length of the data range.

The following forms of the header specify the following ranges of data:

  • Range: bytes=-5. The last five bytes.

  • Range: bytes=10-15. The five bytes of data after a 10-byte offset.

  • Range: bytes=10-15,-5. A multi-part response that contains the last five bytes and the five bytes of data after a 10-byte offset. The Content-Type of the response is then multipart/byteranges.

  • Range: bytes=4-6. Bytes 4 to 6 inclusive.

  • Range: bytes=2-2. Byte 2, the third byte of the data.

  • Range: bytes=6-. Byte 6 and after.

  • Range: bytes=1-3,2-5. A multi-part response that contains bytes 1 to 3 inclusive, and bytes 2 to 5 inclusive. The Content-Type of the response is then multipart/byteranges.

If-Match

​Dict

(Optional)

See http://www.ietf.org/rfc/rfc2616.txt.

If-None-Match

​Dict

(Optional)

See http://www.ietf.org/rfc/rfc2616.txt.

If-Modified-Since

​Dict

(Optional)

See http://www.ietf.org/rfc/rfc2616.txt.

If-Unmodified-Since

​Dict

(Optional)

See http://www.ietf.org/rfc/rfc2616.txt.

This table shows the URI parameters for the get object content and metadata request:

NameTypeDescription

{account}

​String

The unique name for the account. An account is also known as the project or tenant.

{container}

​String

The unique name for the container.

{object}

​String

The unique name for the object.

This table shows the query parameters for the get object content and metadata request:

NameTypeDescription

signature

​String

(Optional)

Used with temporary URLs to sign the request. For more information about temporary URLs, see OpenStack Object Storage API v1 Reference .

expires

​String

(Optional)

Used with temporary URLs to specify the expiry time of the signature. For more information about temporary URLs, see OpenStack Object Storage API v1 Reference .

multipart-manifest

​String

(Optional)

If you include the multipart-manifest=get query parameter and the object is a large object, the object contents are not returned. Instead, the manifest is returned in the X-Object-Manifest response header for dynamic large objects or in the response body for static large objects.

 Response

This table shows the header parameters for the get object content and metadata response:

NameTypeDescription

Content-Length

​String

(Required)

The length of the object content in the response body, in bytes.

Accept-Ranges

​String

(Required)

The type of ranges that the object accepts.

Last-Modified

​String

(Required)

The date and time that the object was created or the last time that the metadata was changed.

ETag

​String

(Required)

For objects smaller than 5 GB, this value is the MD5 checksum of the object content. The value is not quoted.

For manifest objects, this value is the MD5 checksum of the concatenated string of MD5 checksums and ETags for each of the segments in the manifest, and not the MD5 checksum of the content that was downloaded. Also the value is enclosed in double-quote characters.

You are strongly recommended to compute the MD5 checksum of the response body as it is received and compare this value with the one in the ETag header. If they differ, the content was corrupted, so retry the operation.

Content-Type

​String

(Required)

The MIME type of the object.

Content-Encoding

​String

(Optional)

If set, the value of the Content-Encoding metadata.

If not set, this header is not returned by this operation.

Content-Disposition

​String

(Optional)

If set, specifies the override behavior for the browser. For example, this header might specify that the browser use a download program to save this file rather than show the file, which is the default.

If not set, this header is not returned by this operation.

X-Delete-At

​String

(Optional)

If set, the time when the object will be deleted by the system in the format of a UNIX Epoch timestamp.

If not set, this header is not returned by this operation.

X-Object-Meta-name

​String

(Required)

The custom object metadata item, where {name} is the name of the metadata item.

One X-Object-Meta-{name} response header appears for each metadata item (for each {name}).

X-Object-Manifest

​String

(Optional)

If set, to this is a dynamic large object manifest object. The value is the container and object name prefix of the segment objects in the form container/prefix.

X-Static-Large-Object

​Bool

(Required)

Set to True if this object is a static large object manifest object.

X-Trans-Id

​Uuid

(Required)

A unique transaction identifier for this request. Your service provider might need this value if you report a problem.

Date

​Datetime

(Required)

The transaction date and time.

Questions? Discuss on ask.openstack.org
Found an error? Report a bug against this page

loading table of contents...