Object Storage API overview

OpenStack Object Storage is an object-based storage system that stores content and metadata as objects. You create, modify, and get objects and metadata by using the Object Storage API, which is implemented as a set of Representational State Transfer (REST) web services.

For an introduction to OpenStack Object Storage, see Object Storage in the OpenStack Cloud Administrator Guide.

You use the HTTPS (SSL) protocol to interact with Object Storage, and you use standard HTTP calls to perform API operations. You can also use language-specific APIs, which use the RESTful API, that make it easier for you to integrate into your applications.

To assert your right to access and change data in an account, you identify yourself to Object Storage by using an authentication token. To get a token, you present your credentials to an authentication service. The authentication service returns a token and the URL for the account. Depending on which authentication service that you use, the URL for the account appears in:

  • OpenStack Identity Service. The URL is defined in the service catalog.

  • Tempauth. The URL is provided in the X-Storage-Url response header.

In both cases, the URL is the full URL and includes the account resource. For information about authentication, see the section called “Authentication”.

The Object Storage API supports the standard, non-serialized response format, which is the default, and both JSON and XML serialized response formats. See the section called “Serialized response formats”.

The Object Storage system organizes data in a hierarchy, as follows:

The account, container, and object hierarchy affects the way you interact with the Object Storage API.

Specifically, the resource path reflects this structure and has this format:

/v1/{account}/{container}/{object}

For example, for the flowers/rose.jpg object in the images container in the 12345678912345 account, the resource path is:

/v1/12345678912345/images/flowers/rose.jpg

Notice that the object name contains the / character. This slash does not indicate that Object Storage has a sub-hierarchy called flowers because containers do not store objects in actual sub-folders. However, the inclusion of / or a similar convention inside object names enables you to create pseudo-hierarchical folders and directories. See the section called “Pseudo-hierarchical folders and directories”.

For example, if the endpoint for Object Storage is objects.mycloud.com, the returned URL is https://objects.mycloud.com/v1/12345678912345.

To access a container, append the container name to the resource path.

To access an object, append the container and the object name to the path.

If you have a large number of containers or objects, you can use query parameters to page through large lists of containers or objects. Use the marker, limit, and end_marker query parameters to control how many items are returned in a list and where the list starts or ends. See the section called “Page through large lists of containers or objects”.

Object Storage HTTP requests have the following default constraints. Your service provider might use different default values.

Item Maximum value Notes
Number of HTTP headers 90
Length of HTTP headers 4096 bytes
Length per HTTP request line 8192 bytes
Length of HTTP request 5 GB
Length of container names 256 bytes Cannot contain the / character.
Length of object names 1024 bytes By default, there are no character restrictions.

You must UTF-8-encode and then URL-encode container and object names before you call the API binding. If you use an API binding that performs the URL-encoding for you, do not URL-encode the names before you call the API binding. Otherwise, you double-encode these names. Check the length restrictions against the URL-encoded string.

These sections describe the operations that you can perform with the Object Storage API:

  • the section called “Accounts”. Use to perform account-level tasks.

    Lists containers for a specified account. Creates, updates, and deletes account metadata. Shows account metadata.

  • the section called “Containers”. Use to perform container-level tasks.

    Lists objects in a specified container. Creates, shows details for, and deletes containers. Creates, updates, shows, and deletes container metadata.

  • the section called “Objects”. Use to perform object-level tasks.

    Creates, replaces, shows details for, and deletes objects. Copies objects with another object with a new or different name. Updates object metadata.

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

loading table of contents...