Create container PUT /v1/{account}/{container}

Creates a container

It is not necessary to check if a container with the same name already exists before executing this API - if the container does not exist yet, it will be created, otherwise it will be updated.

If a container is created successfully, the 201 status code will be returned. If an existing container is updated successfully, the 202 status code will be returned.

Request headers

X-Auth-Token

Authentication token

Data Type Cardinality
String 1..1

X-Container-Read

Sets the read permissions ACL. Refer to Read Permissions for details.

Data Type Cardinality
String 0..1

X-Container-Write

Sets the write permissions ACL. Refer to Write Permissions for details.

Data Type Cardinality
String 0..1

X-Versions-Location

Enables versioning of objects in a container. The name of another container that has been URL-encoded in UTF-8 format must be specified. To disable versioning, leave the value empty.

Data Type Cardinality
String 0..1

X-Container-Meta-name

Container metadata. {name} is the name of the metadata item.

Data Type Cardinality
String 0..*

X-Container-Meta-Web-Index

Sets the object name of the Index file. For example, when index.html is set, the index page will become /{container}/index.html.

Data Type Cardinality
String 0..1

X-Container-Meta-Web-Error

Sets the object name of error page files. For example, if error.html is set, 401 errors will become /{container}/401error.html, and 404 errors will become /{container}/404error.html objects.

Data Type Cardinality
String 0..1

X-Container-Meta-Web-Listing

When "TRUE" is set, directory list display becomes enabled. For security purposes, this item should not normally be enabled.

Data Type Cardinality
Boolean 0..1

X-Container-Meta-Web-Listing-CSS

Sets an object name of the style sheet for displaying directory lists. For example, if lists.css is set, the /{container}/lists.css object will be used as the style sheet.

Data Type Cardinality
String 0..1

Request Parameter

{account}

Name uniquely assigned by project

Data Type Cardinality
String 1..1

{container}

Container name

Data Type Cardinality
String 1..1

Response Headers

Content-Length

Number of bytes of the response body

Data Type Cardinality
String 1..1

Content-Type

MIME type of the response body

Data Type Cardinality
String 1..1

X-Trans-Id

ID assigned to this request. This is used when inquiring about issues.

Data Type Cardinality
Uuid 1..1

Date

Datetime when the transaction was executed

Data Type Cardinality
Datetime 1..1

Response Elements

None.

When metadata is not set

Example of Request


curl -i $publicURL/steven -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token"
     

Example of Response


HTTP/1.1 201 Created
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx7f6b7fa09bc2443a94df0-0052d58b56
Date: Tue, 14 Jan 2014 19:09:10 GMT
     

When metadata is set

Example of Request


curl -i $publicURL/steven -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token" -H "X-Container-Meta-Book: TomSawyer"  
     

Example of Response


HTTP/1.1 201 Created
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx06021f10fc8642b2901e7-0052d58f37
Date: Tue, 14 Jan 2014 19:25:43 GMT