Method | URI | Description |
---|---|---|
PUT | /v1/{account}/{container} | Creates a container. |
You do not need to check if a container already exists before issuing a PUT operation because the operation is idempotent: It creates a container or updates an existing container, as appropriate.
Example requests and responses:
Create a container with no metadata:
curl -i $publicURL/steven -X PUT -H "Content-Length: 0" -H "X-Auth-Token: $token"
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
Create a container with metadata:
curl -i $publicURL/marktwain -X PUT -H "X-Auth-Token: $token" -H "X-Container-Meta-Book: TomSawyer"
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
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
Normal response codes: 201, 204
This table shows the header parameters for the create container request:
Name | Type | Description |
---|---|---|
| String (Required) | Authentication token. |
| String (Optional) | Sets an ACL that grants read access. |
| String (Optional) | Sets an ACL that grants write access. |
| String (Optional) | Sets the destination for container synchronization. |
| String (Optional) | Sets the secret key for container synchronization. |
| String (Optional) | Enables versioning on this container. The value is the name of another container. You must UTF-8-encode and then URL-encode the name before you include it in the header. To disable versioning, set the header to an empty string. |
| String (Optional) | The container metadata, where You must specify a |
| String (Optional) | Changes the MIME type for the object. |
| Boolean (Optional) | If set to |
This table shows the URI parameters for the create container request:
Name | Type | Description |
---|---|---|
| String | The unique name for the account. An account is also known as the project or tenant. |
| String | The unique name for the container. |
This table shows the header parameters for the create container response:
Name | Type | Description |
---|---|---|
| String (Required) | If the operation succeeds, this value is zero (0). If the operation fails, this value is the length of the error text in the response body. |
| String (Required) | If the operation fails, this value is the MIME type of the error text in the response body. |
| Uuid (Required) | A unique transaction identifier for this request. Your service provider might need this value if you report a problem. |
| Datetime (Required) | The transaction date and time. |