Create or update object metadata

post

/v1/{account}/{container}/{object}

Creates or updates object metadata.

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.
  • The unique name for the object.
Query Parameters
  • Minimum Value: 0
    The date and time in UNIX Epoch time stamp format when the signature for temporary URLs expires.

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

    This parameter is required when using temporary URLS, but otherwise ignored.

  • Used with temporary URLs to sign the request with an HMAC-SHA1 cryptographic signature that defines the allowed HTTP method, expiration date, full path to the object, and the secret key for the temporary URL.

    This parameter is required when using temporary URLS, but otherwise ignored.

Header Parameters
  • If set, specifies the override behavior for the browser. For example, this header might specify that the browser use a download program to save this file rather than show the file, which is the default.
  • If set, the value of the Content-Encoding metadata.
  • Changes the MIME type for the object.
  • Authentication token. Not specified if temp_url_sig and temp_url_expires are present. Otherwise, if you omit this header, your request fails unless the account owner has granted you access through an access control list (ACL).
  • The container metadata, where {name} is the name of metadata item. You must specify an X-Container-Meta-{name} header for each metadata item (for each {name}) that you want to add or update.
  • Minimum Value: 0
    Minimum Value: > true
    The number of seconds after which the system removes the object. Internally, the Object Storage system stores this value in the X-Delete-At metadata item.
  • Minimum Value: 0
    The date and time in UNIX Epoch time stamp format when the system removes the object.

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

  • The object metadata, where {name} is the name of the metadata item.

    You must specify an X-Object-Meta-{name} header for each metadata {name} item that you want to add or update.

Back to Top

Response

Supported Media Types

202 Response

Accepted
Headers
  • Minimum Value: 0
    This value is the length of the response text in the response body.
  • The MIME type of the object.
  • 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 ID 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

403 Response

Forbidden. Possible causes:
  • A data center has not been selected for your service in Oracle Cloud My Services.
  • The request was sent to an incorrect data center. For example, the data center for your service is Chicago (us2), but the request was sent to the URL corresponding to the Ashburn (us6) data center.
  • You don't have the required permission to perform the operation on the specified container. For example, there may be a change in the roles assigned to your user or the access privileges defined for the container specified in the request.
  • Violating a container or object level WORM policy by trying to PUT, POST, or DELETE an object that has not expired or trying to update an existing container level WORM policy.
Headers

404 Response

The object does not exist or has just been created and hasn't been replicated across all three nodes.
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

Note:

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

The following example shows how to create and update any custom or arbitrary metadata (X-Object-Meta-Language: english in this example) that you need for an object in a container in your account in Oracle Cloud Infrastructure Object Storage Classic 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-Object-Meta-Language: english" \
         https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/myObject

    The following is a sample response of this command:

    HTTP/1.1 202 Accepted
    Date: Mon, 09 Mar 2015 11:46:34 GMT
    Content-Length: 76
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx23a1084b8c674fdeae8d4-0054f982ac
    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-Object-Meta-Language: english" \
         https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer/myObject

    The following is a sample response of this command:

    HTTP/1.1 202 Accepted
    Date: Mon, 09 Mar 2015 11:46:34 GMT
    Content-Length: 76
    Content-Type: text/html; charset=UTF-8
    X-Trans-Id: tx23a1084b8c674fdeae8d4-0054f982ac
    Content-Language: en
Back to Top