Create, update, or delete account metadata

 
MethodURIDescription
POST/v1/{account}

Creates, updates, or deletes account metadata.

To create, update, or delete metadata, use the X-Account-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 a metadata header, send an empty value for that particular header, such as for the X-Account-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-Account-Meta-{name}: arbitrary value header. For example, X-Remove-Account-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 account metadata:

    curl -i $publicURL -X POST -H "X-Auth-Token: $token" -H "X-Account-Meta-Book: MobyDick" -H "X-Account-Meta-Subject: Literature"

    HTTP/1.1 204 No Content
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx8c2dd6aee35442a4a5646-0052d954fb
    Date: Fri, 17 Jan 2014 16:06:19 GMT

  • Update account metadata:

    curl -i $publicURL -X POST -H "X-Auth-Token: $token" -H "X-Account-Meta-Subject: AmericanLiterature"

    HTTP/1.1 204 No Content
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx1439b96137364ab581156-0052d95532
    Date: Fri, 17 Jan 2014 16:07:14 GMT

  • Delete account metadata:

    curl -i $publicURL -X POST -H "X-Auth-Token: $token" -H "X-Remove-Account-Meta-Subject: x"

    HTTP/1.1 204 No Content
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx411cf57701424da99948a-0052d9556f
    Date: Fri, 17 Jan 2014 16:08:15 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 account metadata request.

Normal response codes: 204

 Request

This table shows the header parameters for the create, update, or delete account metadata request:

NameTypeDescription

X-Auth-Token

​String

(Required)

Authentication token.

X-Account-Meta-Temp-URL-Key

​String

(Optional)

The secret key value for temporary URLs.

X-Account-Meta-Temp-URL-Key-2

​String

(Optional)

A second secret key value for temporary URLs. The second key enables you to rotate keys by having an old and new key active at the same time.

X-Account-Meta-name

​String

(Optional)

The account metadata. The {name} is the name of metadata item that you want to add, update, or delete. To delete this item, send an empty value in this header.

You must specify a X-Account-Meta-{name} header for each metadata item (for each {name}) that you want to add, update, or delete.

Content-Type

​String

(Optional)

Changes the MIME type for the object.

X-Detect-Content-Type

​Boolean

(Optional)

If set to true, Object Storage guesses the content type based on the file extension and ignores the value sent in the Content-Type header, if present.

This table shows the URI parameters for the create, update, or delete account metadata request:

NameTypeDescription

{account}

​String

The unique name for the account. An account is also known as the project or tenant.

 Response

This table shows the header parameters for the create, update, or delete account metadata response:

NameTypeDescription

Content-Length

​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.

Content-Type

​String

(Required)

If the operation fails, this value is the MIME type of the error text in the response body.

X-Trans-Id

​Uuid

(Required)

A unique transaction identifier for this request. Your service provider might need this value if you report a problem.

Date

​Datetime

(Required)

The transaction date and time.

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

loading table of contents...