Show container metadata

head

/v1/{account}/{container}

Shows container metadata, including the number of objects and the total bytes of all objects stored in the container.

Request

Path Parameters
account
Type: string
Required: true
The unique name for the account. An account is also known as the project or tenant.
container
Type: string
Required: true
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.
Header Parameters
X-Auth-Token
Type: string
Required: true
Authentication token.
X-Newest
Type: boolean
If set to true, Object Storage queries all replicas to return the most recent one. If you omit this header, Object Storage responds faster after it finds one valid replica. Because setting this header to true is more expensive for the back end, use it only when it is absolutely needed.

Response

Supported Media Types
  • application/json
204 Response
Success
Headers
Accept-Ranges
Type: string
The type of ranges that the object accepts.
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-Container-Bytes-Used
Type: integer
Minimum Value: 0
The count of bytes used in total.
X-Container-Meta-Access-Control-Allow-Origin
Type: string
(Optional) List of origins to be allowed to make cross-origin Requests. Entries in the list are space-separated.
X-Container-Meta-Access-Control-Expose-Headers
Type: string
(Optional) List of headers exposed to the user agent (e.g. browser) in the actual request response. Entries in the list are space-separated.
X-Container-Meta-Access-Control-Max-Age
Type: integer
Minimum Value: 0
(Optional) Maximum age in seconds for the origin to hold the preflight results.
X-Container-Meta-Quota-Bytes
Type: integer
Minimum Value: 0
Maximum size of the container, in bytes. Typically these values are set by an administrator.
X-Container-Meta-Quota-Count
Type: integer
Minimum Value: 0
Maximum object count of the container. Typically these values are set by an administrator.
X-Container-Meta-Temp-URL-Key
Type: string
(Optional) The secret key value for temporary URLs. If not set, this header is not returned in the response.
X-Container-Meta-Temp-URL-Key-2
Type: string
(Optional) A second secret key value for temporary URLs. If not set, this header is not returned in the response.
X-Container-Meta-{name}
Type: string
The custom container metadata item, where {name} is the name of the metadata item. One X-Container-Meta-{name} response header appears for each metadata item (for each {name}).
X-Container-Object-Count
Type: integer
Minimum Value: 0
The number of objects.
X-Container-Read
Type: string
(Optional) The ACL that grants read access. If not set, this header is not returned by this operation.
X-Container-Write
Type: string
(Optional) The ACL that grants write access. If not set, this header is not returned by this operation.
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.
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.
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.
404 Response
The container does not exist or has just been created and hasn't been replicated across all three nodes.
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

cURL Command

The following example shows how to retrieve information about a container in your account in Oracle Cloud Infrastructure Object Storage Classic by submitting a HEAD request on the REST resource using cURL. For more information about cURL, see Use cURL.

curl -v -X HEAD \
     -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
     https://foo.storage.oraclecloud.com/v1/myservice-bar/FirstContainer

Sample Response

The following is a sample response of this command:

HTTP/1.1 204 No Content
Date: Fri, 06 Mar 2015 11:40:11 GMT
X-Container-Object-Count: 0
X-Container-Write: myDomain.myservice.Storage_ReadWriteGroup,myDomain.myCustomRole
X-Container-Meta-Category: Books
Accept-Ranges: bytes
X-Container-Meta-Quota-Count: 100
X-Timestamp: 1425639066.56315
X-Container-Read: .r:*,.rlistings
X-Container-Bytes-Used: 0
Content-Type: text/plain; charset=utf-8
X-Container-Meta-Quota-Bytes: 10737418240
X-Trans-Id: txb0b9882eceba45b287266-0054f9921b
Content-Language: en