Create, update, or delete container metadata

post

/v1/{account}/{container}

Creates, updates, or deletes custom metadata for a container.

Request

Path Parameters
  • The unique name for the account. An account is also known as the project or tenant.
  • The unique name for the container. The container name must be from 1 to 256 characters long and can start with any character and contain any pattern. Character set must be UTF-8. The container name cannot contain a slash (/) character because this character delimits the container and object name. For example, /account/container/object.
Query Parameters
  • Marker parameter to set the Container Replication Policy for an empty container.

    To set the container-level replication policy for the container myFirstContainer:

    $ curl -v -X PUT -H  'X-Auth-Token: 0101010101' \-H "Content-Type: application/json" \-d "@payload_file" https://foo.storage.oraclecloud.com/v1/myservice-bar/myFirstContainer?repPolicy
    Example payload:
    { "sourceRegion": { "name": "string", "url": "string" }, "targetRegions": [ { "name": "string","url": "string" }],"externalSourceRegions": [{ "name": "string","url": "string"}],"externalTargetRegions": [{"name": "string","url": "string"}]}

    Default Value: plain
Header Parameters
Back to Top

Response

Supported Media Types

204 Response

Success
Headers
  • Minimum Value: 0
    Maximum Value: 0
    This value is zero (0).
  • 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.

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

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

400 Response

Failure. The value for the X-Worm-Expiration-Days header is invalid. It must be a valid integer greater than 0. You will also get this error if the container already has the X-Worm-Expiration-Days metadata specified or if the container already has objects.
Headers
  • Minimum Value: 1
    This value is the length of the error text in the response body.
  • This value is the MIME type of the error text in the response body.
  • 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.

  • 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

404 Response

The container does not exist or has just been created and hasn't been replicated across all three nodes.
Headers

413 Response

Maximum container size or maximum per-container object count exceeded
Headers
Back to Top

Examples

cURL Command

Sample Cloud account with the following details:

  • Account name: acme

  • REST Endpoint URL: https://acme.storage.oraclecloud.com/v1/Storage-acme

  • REST Endpoint (Permanent) URL: https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365

  • Identity Domain: myDomain obtained from My Services dashboard

Note:

The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.

The following example shows how to provide write access for any user with the predefined role, Storage_ReadWriteGroup and the custom role, myCustomRole for the container named FirstContainer, by submitting a POST request on the REST resource using cURL.

For more information about cURL, see Use cURL.

  • Using the REST Endpoint URL obtained from the REST Endpoint field in the My Services dashboard:

    curl -v -X POST \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -H "X-Container-Write:myDomain.Storage.Storage_ReadWriteGroup,myDomain.myCustomRole" \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer

    The following is a sample response of this command:

    HTTP/1.1 204 No Content
    Date: Fri, 06 Mar 2015 11:19:21 GMT
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: txbf2c736d57494bf88e76a-0054f98d39
    Content-Language: en
  • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field in the My Services dashboard:

    Note:

    This cURL command example applies to the accounts created after November 2017.
    curl -v -X POST \
         -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
         -H "X-Container-Write:myDomain.Storage.Storage_ReadWriteGroup,myDomain.myCustomRole" \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer

    The following is a sample response of this command:

    HTTP/1.1 204 No Content
    Date: Fri, 06 Mar 2015 11:19:21 GMT
    Content-Length: 0
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: txbf2c736d57494bf88e76a-0054f98d39
    Content-Language: en

Sample Response

  • For examples on how to provide read access or set container quotas, see Setting Container Metadata in Using Oracle Cloud Infrastructure Object Storage Classic.

  • For examples on how to set CORS headers, see Enabling CORS for a Container in Using Oracle Cloud Infrastructure Object Storage Classic.

Back to Top