Create, update, or delete container metadata
/v1/{account}/{container}
Request
-
account: string
The unique name for the account. An account is also known as the project or tenant.
-
container: string
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
.
-
X-Auth-Token: string
Authentication token.
-
X-Container-Meta-Access-Control-Allow-Origin(optional): string
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(optional): string
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(optional): integer
Minimum Value:
0
Maximum age in seconds for the origin to hold the preflight results. -
X-Container-Meta-Quota-Bytes(optional): integer
Minimum Value:
0
Sets maximum size of the container, in bytes. Typically these values are set by an administrator. Returns a 413 response (request entity too large) when an object PUT operation exceeds this quota value. -
X-Container-Meta-Quota-Count(optional): integer
Minimum Value:
0
Sets maximum object count of the container. Typically these values are set by an administrator. Returns a 413 response (request entity too large) when an object PUT operation exceeds this quota value. -
X-Container-Meta-Temp-URL-Key(optional): string
The secret key value for temporary URLs.
-
X-Container-Meta-Temp-URL-Key-2(optional): 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-Container-Meta-{name}(optional): string
The container metadata, where
{name}
is the name of metadata item. You must specify anX-Container-Meta-{name}
header for each metadata item (for each{name}
) that you want to add or update. -
X-Container-Read(optional): string
Sets a container access control list (ACL) that grants read access. Container ACLs are available on any Object Storage cluster, and are enabled by container rather than by cluster. To set the container read ACL:
$ curl -X {PUT|POST} -i -H 'X-Auth-Token: TOKEN' -H \
In the command, specify the ACL in the'X-Container-Read: ACL' STORAGE_URL/CONTAINER
X-Container-Read
header, as follows:.r:*
—All referrers..r:example.com,swift.example.com
—Comma-separated list of referrers..rlistings
—Container listing access.
-
X-Container-Write(optional): string
Sets an ACL that grants write access.
-
X-Remove-Container-Meta-{name}(optional): string
Removes the metadata
X-Container-Meta-{name}
, where{name}
is the name of metadata item. The value of the header is ignored. -
X-Remove-Container-{name}(optional): string
Removes the metadata item named
{name}
. For example,X-Remove-Container-Read
removes theX-Container-Read
metadata item. -
X-Worm-Expiration-Days(optional): integer
Minimum Value:
1
Minimum number of days an object, once uploaded, must reside in a container before it can be overwritten with a PUT or POST or deleted.
Response
- application/json
204 Response
-
Content-Length: integer
Minimum Value:
0
Maximum Value:0
This value is zero (0). -
Date: 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: 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 toMon, Wed, 26 Aug 2015 19:57:28 GMT
. -
X-Trans-Id: string(uuid)
A unique transaction identifier for this request. Your service provider might need this value if you report a problem.
400 Response
-
Content-Length: integer
Minimum Value:
1
This value is the length of the error text in the response body. -
Content-Type: string
This value is the MIME type of the error text in the response body.
-
Date: 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-Trans-Id: string(uuid)
A unique transaction identifier for this request. Your service provider might need this value if you report a problem.
401 Response
-
Content-Length: integer
Minimum Value:
0
The length of the error text in the response body. -
Content-Type: string
The MIME type of the error text in the response body.
404 Response
-
Content-Length: integer
Minimum Value:
0
The length of the error text in the response body. -
Content-Type: string
The MIME type of the error text in the response body.
413 Response
-
Content-Length: integer
Minimum Value:
0
This value is the length of the error text in the response body. -
Content-Type: string
This value is the MIME type of the error text in the response body.
Examples
cURL Command
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.
curl -v -X POST \ -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \ -H "X-Container-Write:myDomain.myservice.Storage_ReadWriteGroup,myDomain.myCustomRole" \ 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:19:21 GMT Content-Length: 0 Content-Type: text/html; charset=UTF-8 X-Trans-Id: txbf2c736d57494bf88e76a-0054f98d39 Content-Language: en
-
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.