Create, update, or delete account metadata; or bulk-delete containers or objects

post

/v1/{account}

Creates, updates, or deletes account metadata. With the optional bulk-delete query parameter specified, supports bulk deletion of containers and / or objects.

Request

Path Parameters
account
Type: string
Required: true
The unique name for the account. An account is also known as the project or tenant.
Query Parameters
bulk-delete
Type: string
Optional bulk delete operation flag. This parameter takes no value.

If bulk-delete is specified, the operation's functionality changes to bulk deletion.

Bulk deletion via POST is provided to support the OpenStack Swift API behavior. For further details on bulk deletion, including related parameters and response format, see Delete multiple containers or objects.

Header Parameters
X-Account-Meta-Temp-URL-Key
Type: string
The secret key value for temporary URLs.
X-Account-Meta-Temp-URL-Key-2
Type: string
A second secret key value for temporary URLs. The second key enables you to rotate keys by having two active keys at the same time.
X-Account-Meta-{name}
Type: string
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 an X-Account-Meta-{name} header for each metadata item (for each {name}) that you want to add, update, or delete.

X-Auth-Token
Type: string
Required: true
Authentication token.
X-Remove-Account-Meta-{name}
Type: string
Removes the metadata X-Account-Meta-{name}, where {name} is the name of metadata item. The value of the header is ignored.

Response

Supported Media Types
  • application/json
204 Response
Success.
Headers
Content-Length
Type: integer
Minimum Value: 0
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
Type: string
If the operation fails, this value is the MIME type of the error text in the response body.
Date
Type: string (date-time)
The transaction date and time.

The date and time stamp format is ISO 8601:

CCYY-MM-DDThh:mm:ss±hh:mm
For example, 2015-08-27T09:49:58-05:00.

The ±hh:mm value, if included, is the time zone as an offset from UTC. In the previous example, the offset value is -05:00.

A null value indicates that the token never expires.

X-Timestamp
Type: integer (timestamp)
Minimum Value: 0
The date and time in UNIX Epoch time stamp format when the account, container, or object was initially created as a current version.

For example, 1440619048 is equivalent to Mon, Wed, 26 Aug 2015 19:57:28 GMT.

X-Trans-Id
Type: string (uuid)
A unique transaction identifier for this request. Your service provider might need this value if you report a problem.
401 Response
Request does not include an authentication token, or authentication token specified in the request is not valid. It may have expired. Authentication tokens expire after 30 minutes.
Headers
Content-Length
Type: integer
Minimum Value: 0
The length of the error text in the response body.
Content-Type
Type: string
The MIME type of the error text in the response body.

Examples

Creating Custom Metadata

The following example shows how to create custom or arbitrary metadata (X-Account-Meta-Owner in this example) for your account by submitting a POST request.

cURL Command

curl -v -X POST \
     -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
     -H "X-Account-Meta-Owner: IT" \
     https://foo.storage.oraclecloud.com/v1/myservice-bar

Sample Response

HTTP/1.1 204 No Content
Date: Fri, 06 Mar 2015 11:44:29 GMT
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx23a1084b8c674fdeae8d4-0054f982ac

Bulk-Deleting Containers and Objects

The following example shows how to delete multiple containers and objects by sending a POST request with the bulk-delete query parameter.

  1. Create a local file that lists the objects to be deleted and the containers they are in.

    Here's a sample of such a file:

    $ cat objects_to_delete
    
    container1/object1
    container1/object2
    container1
    container2/object3
    container3
    
    In this example, the goal is to delete the following:
    • object1 and object2 in container1

    • container1, if it is empty

    • object3 in container2

    • container3, if it is empty

  2. Send a POST request to the account URL.

    • Specify the file that contains the list of containers and objects to be deleted

    • Include the bulk-delete query parameter.

    cURL Command

    curl -v -X POST \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -T objects_to_delete \
         "https://foo.storage.oraclecloud.com/v1/myservice-bar?bulk-delete"

    Sample Response

    Number Deleted: 5
    Number Not Found: 0
    Response Body:  
    Response Status: 200 OK
    Errors: