18.5.3. Working with Containers

This section describes the list of operations you can perform at the container level of the URL.

18.5.3.1.  Creating Containers

You can use PUT command to create containers. Containers are the storage folders for your data. The URL encoded name must be less than 256 bytes and cannot contain a forward slash '/' character.
  • To create a container, run the following command:
    PUT /<apiversion>/<account>/<container>/ HTTP/1.1
    Host: <storage URL>
    X-Auth-Token: <authentication-token-key>
    For example,
    PUT /v1/AUTH_test/pictures/ HTTP/1.1
    Host: example.storage.com
    X-Auth-Token: AUTH_tkd3ad38b087b49bbbac0494f7600a554
    HTTP/1.1 201 Created
    
    Date: Wed, 13 Jul 2011 17:32:21 GMT
    Server: Apache
    Content-Type: text/plain; charset=UTF-8
    To create container using cURL (for the above example), run the following command:
    curl -v -X PUT -H 'X-Auth-Token:
    AUTH_tkde3ad38b087b49bbbac0494f7600a554'
    https://example.storage.com:443/v1/AUTH_test/pictures -k
    The status code of 201 (Created) indicates that you have successfully created the container. If a container with a same name already exists, the 202 status code is displayed.