Method | URI | Description |
---|---|---|
POST | /v1/{account}/{container} | Creates, updates, or deletes custom metadata for a container. |
To create, update, or delete a custom metadata item,
use the X-Container-Meta-{name}
header,
where {name}
is the name of the metadata
item.
Subsequent requests for the same key and value pair overwrite the previous value.
To delete container metadata, send an empty value
for that header, such as for the
X-Container-Meta-Book
header. If the
tool you use to communicate with Object Storage, such
as an older version of cURL, does not support empty
headers, send the
X-Remove-Container-Meta-{name}
:
arbitrary value
header.
For example, X-Remove-Container-Meta-Book:
x
. The operation ignores the arbitrary
value.
If the container already has other custom metadata items, a request to create, update, or delete metadata does not affect those items.
This operation does not accept a request body.
Example requests and responses:
Create container metadata:
curl -i $publicURL/marktwain -X POST -H "X-Auth-Token: $token" -H "X-Container-Meta-Author: MarkTwain" -H "X-Container-Meta-Century: Nineteenth"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx05dbd434c651429193139-0052d82635 Date: Thu, 16 Jan 2014 18:34:29 GMT
Update container metadata:
curl -i $publicURL/marktwain -X POST -H "X-Auth-Token: $token" -H "X-Container-Meta-Author: SamuelClemens"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: txe60c7314bf614bb39dfe4-0052d82653 Date: Thu, 16 Jan 2014 18:34:59 GMT
Delete container metadata:
curl -i $publicURL/marktwain -X POST -H "X-Auth-Token: $token" -H "X-Remove-Container-Meta-Century: x"
HTTP/1.1 204 No Content Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: tx7997e18da2a34a9e84ceb-0052d826d0 Date: Thu, 16 Jan 2014 18:37:04 GMT
For a complete description of HTTP 1.1 header definitions, see Header Field Definitions.
If the request succeeds, the operation returns the 204 status code.
To confirm your changes, issue a show container metadata request.
Normal response codes: 204
This table shows the header parameters for the create, update, or delete container metadata request:
Name | Type | Description |
---|---|---|
| String (Required) | Authentication token. |
| String (Optional) | Sets an ACL that grants read access. |
| String (Optional) | Removes the metadata item named
|
| 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) | Set to any value to disable versioning. |
| 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, update, or delete container metadata 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, update, or delete container metadata 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. |