Setting Container Metadata
Setting Container ACLs
The ability to read and write objects in a container is governed by the Access Control Lists (ACLs) assigned to the container. Any user with the Service Administrator role can perform this task.
A container has two ACLs, X-Container-Read
and X-Container-Write
.
The X-Container-Read
ACL consists of a comma-separated list of roles or referrer designations. The X-Container-Write
ACL consists of a comma-separated list of roles.
- The roles can be built-in roles or custom roles. Custom roles are defined in the Users page in the Infrastructure Classic Console.
- For a role that was provisioned as part of another service instance, the format is
domainName.serviceName.roleName
- For a custom role, the format is
domainName.roleName
- For a role that was provisioned as part of another service instance, the format is
- A referrer designation indicates the host (or hosts) for which read access to the container should be allowed or denied. When the server receives a request for the container, it compares the referrer designations specified in the
X-Container-Read
ACL with the value of theReferer
header in the request, and determines whether access should be allowed or denied. The syntax of the referrer designation is:.r:value
value
indicates the host for which access to the container should be allowed. It can be a specific host name (example:.r:www.example.com
), a domain (example:.r:.example.com
), or an asterisk (.r:*
) to indicate all hosts. Note that if.r:*
is specified, objects in the container will be publicly readable without authentication.- A minus sign (
-
) beforevalue
(example:
) indicates that the host specified in the.r:-
temp.example.comvalue
field must be denied access to the container. - By default, read access to a container does not include permission to list the objects in the container. To allow listing of objects as well, include the
.rlistings
directive in the ACL (example:.r:*,.rlistings
).
For creating custom roles for a traditional Cloud account. See Adding a Custom Role in Managing and Monitoring Oracle Cloud.
For creating custom roles for accounts with Identity Cloud Service, see Create a Custom Role for Cloud Accounts with Identity Cloud Service.
Interface | Resources |
---|---|
Web Console (Not available on Oracle Cloud at Customer) |
|
RESTful API |
See Create, update, or delete container metadata in REST API for Standard Storage in Oracle Cloud Infrastructure Object Storage Classic. |
Java Library |
See |
File Transfer Manager API |
See setWriteAcl() in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic File Transfer Manager. |
Setting Container ACLs Using the Web Console
(Not available on Oracle Cloud at Customer)- Sign in to the Oracle Cloud Infrastructure Object Storage Classic console.
The list of containers is displayed.
- Select the container for which you would like to set the read/write access.
- Expand Container Information.
The details of the container are displayed.
- Click Edit.
Look for Permissions under Container Properties.
- Click Add Role.
- Enter the desired value in the empty field.
By default, the following ACLs are set:
-
Storage_ReadWriteGroup
to provide both read and write access to a user. -
Storage_ReadOnlyGroup
to provide read only access to a user
-
- Click Save.
Setting Container ACLs Using the REST API
cURL Command Syntax
curl -v -X POST \ -H "X-Auth-Token: token" \ –H "X-Container-Read: item[,item...]" \ –H "X-Container-Write: item[,item...]" accountURL/containerName
Note:
When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container
should be encoded as my%20container
, where %20
is the HTML encoding for the space character. Similarly, my Über Container
should be encoded as my%20%C3%9Cber%20Container
, where %20
represents the space character and %C3%9C
is the Ü
character.
HTTP Response Codes
- Success:
204 No Content
- Failure: See Error Code Reference for Oracle Cloud Infrastructure Object Storage Classic
cURL Command Examples
- IDCS GUID:
idcs-b75f75ed2528447fb59a798c1f08a38d
(for a sample IDCS account) - Account name:
acme
(for a sample IDCS or traditional account) - REST Endpoint URL for the sample account:
https://acme.storage.oraclecloud.com/v1/Storage-acme
- REST Endpoint (Permanent) URL for the sample account:
https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365
Note:
The REST Endpoint (Permanent) URL is displayed for the accounts created after November 2017.
FirstContainer
:
- Provide write access for any user with the predefined role,
Storage_ReadWriteGroup
and the custom role,myCustomRole
:- Using the REST Endpoint URL obtained from the REST Endpoint field:
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 an example of the output of this command:> POST /v1/Storage-acme/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: acme.storage.oraclecloud.com > Accept: */* > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > X-Container-Write:Storage-acme.Storage.Storage_ReadWriteGroup,Storage-acme.myCustomRole > < 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 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en
- Using the REST Endpoint URL obtained from the REST Endpoint field:
- Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:
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 an example of the output of this command:> POST /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: acme.storage.oraclecloud.com > Accept: */* > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > X-Container-Write:Storage-7b16fede61e1417ab83eb52e06f0e365.Storage.Storage_ReadWriteGroup,Storage-7b16fede61e1417ab83eb52e06f0e365.myCustomRole > < 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 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en
- Provide read access for all hosts and also allow listing of the objects in the container:
- Using the REST Endpoint URL obtained from the REST Endpoint field:
curl -v -X POST \ -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \ -H "X-Container-Read: .r:*,.rlistings" \ https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer
The following is an example of the output of this command:
> POST /v1/Storage-acme/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: acme.storage.oraclecloud.com > Accept: */* > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > X-Container-Read: .r:*,.rlistings > < HTTP/1.1 204 No Content < Date: Fri, 06 Mar 2015 11:23:16 GMT < Content-Length: 0 < Content-Type: text/html; charset=UTF-8 < X-Trans-Id: tx9127a70f18144c17afce5-0054f98e24 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en 0
- Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:
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-Read: .r:*,.rlistings" \ https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer
The following is an example of the output of this command:
> POST /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: acme.storage.oraclecloud.com > Accept: */* > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > X-Container-Read: .r:*,.rlistings > < HTTP/1.1 204 No Content < Date: Fri, 06 Mar 2015 11:23:16 GMT < Content-Length: 0 < Content-Type: text/html; charset=UTF-8 < X-Trans-Id: tx9127a70f18144c17afce5-0054f98e24 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en 0
- Using the REST Endpoint URL obtained from the REST Endpoint field:
Setting Container Quotas
For each container, you can set quotas for the maximum number of bytes the container can contain (X-Container-Meta-Quota-Bytes
) and the maximum number of objects the container can contain (X-Container-Meta-Quota-Count
).
Any user with the Service Administrator role can perform this task.
Interface | Resources |
---|---|
RESTful API |
See Create, update, or delete container metadata in REST API for Standard Storage in Oracle Cloud Infrastructure Object Storage Classic. |
File Transfer Manager CLI |
See setQuotaBytes()in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic. |
cURL Command Syntax
curl -v -X POST \ -H "X-Auth-Token: token" \ -H "X-Container-Meta-Quota-Bytes: maxBytes" \ -H "X-Container-Meta-Quota-Count: maxObjects" accountURL/containerName
token
is the authentication token obtained earlier from Oracle Cloud Infrastructure Object Storage Classic. See Authenticating Access When Using the REST API.maxBytes
is the maximum number of bytes of data that can be stored in the container.maxObjects
is the maximum number of objects that can be created in the container.- For the syntax of
accountURL
, see About REST URLs for Oracle Cloud Infrastructure Object Storage Classic Resources. containerName
is the name of the container for which the quota should be set.
Note:
When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container
should be encoded as my%20container
, where %20
is the HTML encoding for the space character. Similarly, my Über Container
should be encoded as my%20%C3%9Cber%20Container
, where %20
represents the space character and %C3%9C
is the Ü
character.
HTTP Response Codes
- Success:
204 No Content
- Failure: See Error Code Reference for Oracle Cloud Infrastructure Object Storage Classic
For information about getting container quota, see Getting Container Metadata.
cURL Command Examples
- 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.
- Using the REST Endpoint URL obtained from the REST Endpoint field:
curl -v -X POST \ -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \ -H "X-Container-Meta-Quota-Bytes: 10737418240" \ -H "X-Container-Meta-Quota-Count: 100" \ https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer
This command sets a quota of 10737418240 bytes (10 GB) and 100 objects for the container named
FirstContainer
. The following is an example of the output of this command:> POST /v1/Storage-acme/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: acme.storage.oraclecloud.com > Accept: */* > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > X-Container-Meta-Quota-Bytes: 10737418240 > X-Container-Meta-Quota-Count: 100 > < HTTP/1.1 204 No Content < Date: Fri, 06 Mar 2015 11:32:19 GMT < Content-Length: 0 < Content-Type: text/html; charset=UTF-8 < X-Trans-Id: txe8869b3edea348e5b49eb-0054f99043 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en
- Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:
curl -v -X POST \ -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \ -H "X-Container-Meta-Quota-Bytes: 10737418240" \ -H "X-Container-Meta-Quota-Count: 100" \ https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer
This command sets a quota of 10737418240 bytes (10 GB) and 100 objects for the container named
FirstContainer
. The following is an example of the output of this command:> POST /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com > Accept: */* > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > X-Container-Meta-Quota-Bytes: 10737418240 > X-Container-Meta-Quota-Count: 100 > < HTTP/1.1 204 No Content < Date: Fri, 06 Mar 2015 11:32:19 GMT < Content-Length: 0 < Content-Type: text/html; charset=UTF-8 < X-Trans-Id: txe8869b3edea348e5b49eb-0054f99043 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en
Setting Custom Metadata for Containers
Custom metadata are arbitrary key-value pairs associated with a container. You may create any custom or arbitrary metadata you need.
Any user with the Service Administrator role can perform this task.
Interface | Resources |
---|---|
Web Console (Not available on Oracle Cloud at Customer) |
|
RESTful API |
See Create, update, or delete container metadata in REST API for Standard Storage in Oracle Cloud Infrastructure Object Storage Classic. |
Java Library |
See |
File Transfer Manager CLI |
See setCustomMetadata() in Command-Line Reference for Oracle Cloud Infrastructure Object Storage Classic. |
Setting Custom Metadata Using the Web Console
(Not available on Oracle Cloud at Customer)- Sign in to the Oracle Cloud Infrastructure Object Storage Classic console.
- Select the container for which you would like to set the custom metadata.
- Expand Container Information.
The details of the container are displayed.
- Click Edit.
Look for the Custom Metadata field.
- Click Add Metadata.
- Enter the metadata name and value in the fields under Add Metadata.
Note:
Ensure that the custom metadata name and value comply with the input restrictions mentioned in Character Restrictions. - Click Save.
The metadata name and value are displayed in the Container Information pane.
Setting Custom Metadata Using the REST API
cURL Command Syntax
curl -v -X POST \ -H "X-Auth-Token: token" \ -H "X-Container-Meta-Name: value" \ accountURL/containerName
token
is the authentication token obtained earlier from Oracle Cloud Infrastructure Object Storage Classic. See Authenticating Access When Using the REST API.Name
andvalue
are the metadata name and value to be created.Note:
Ensure that the custom metadata name and value comply with the input restrictions mentioned in Character Restrictions.- For the syntax of
accountURL
, see About REST URLs for Oracle Cloud Infrastructure Object Storage Classic Resources. containerName
is the name of the container for which custom metadata should be created.
Note:
When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container
should be encoded as my%20container
, where %20
is the HTML encoding for the space character. Similarly, my Über Container
should be encoded as my%20%C3%9Cber%20Container
, where %20
represents the space character and %C3%9C
is the Ü
character.
HTTP Response Codes
- Success:
204 No Content
- Failure: See Error Code Reference for Oracle Cloud Infrastructure Object Storage Classic
cURL Command Examples
- 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.
- Using the REST Endpoint URL obtained from the REST Endpoint field:
curl -v -X POST \ -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \ -H "X-Container-Meta-Category: Books" \ https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer
The following is an example of the output of this command:
> POST /v1/Storage-acme/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: acme.storage.oraclecloud.com > Accept: */* > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > X-Container-Meta-Category: Books > < HTTP/1.1 204 No Content < Date: Fri, 06 Mar 2015 11:35:35 GMT < Content-Length: 0 < Content-Type: text/html; charset=UTF-8 < X-Trans-Id: tx3e77b77de39f4097a5a49-0054f99107 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en
- Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field:
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-Meta-Category: Books" \ https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer
The following is an example of the output of this command:
> POST /v1/Storage-7b16fede61e1417ab83eb52e06f0e365/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com > Accept: */* > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > X-Container-Meta-Category: Books > < HTTP/1.1 204 No Content < Date: Fri, 06 Mar 2015 11:35:35 GMT < Content-Length: 0 < Content-Type: text/html; charset=UTF-8 < X-Trans-Id: tx3e77b77de39f4097a5a49-0054f99107 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en
For information about getting custom container metadata, see Getting Container Metadata.
For information about deleting custom container metadata, see Deleting Container Metadata.
Enabling CORS for a Container
Cross-Origin Resource Sharing (CORS) allows browser-based programs (like JavaScript) to access resources in another domain. This enables web applications to access Oracle Cloud Infrastructure Object Storage Classic, overcoming the Same-Origin policy that’s used by browsers to prevent access to resources in other domains.
Making Objects in a Container Immutable
You can make the objects in your container immutable by setting the Write-Once-Read-Many (WORM) policy for your container to prevent the users from modifying and deleting the objects in the container for a specified duration. The container-level WORM policy applies to all the objects that’re uploaded to the container, unless an object has it’s own object-level WORM policy set during upload.
Once you’ve set a container’s WORM policy, you cannot change it. When the WORM policy expires, you can delete the objects in the container but can’t modify the objects or object metadata. To set the WORM policy for a specific object, see Making an Object Immutable.
You must have the Service Administrator
role to set a container’s WORM policy header X-Worm-Expiration-Days
.
For information about using the REST API to set the container metadata, see Create, Update, or Delete Container Metadata in REST API for Standard Storage in Oracle Cloud Infrastructure Object Storage Classic.
cURL Command Syntax
To set the WORM policy for an empty container:
curl -v -X POST \ -H "X-Auth-Token: token" \ -H "X-Worm-Expiration-Days: period" \ accountURL/containerName
To set the WORM policy while creating a container:
curl -v -X PUT \ -H "X-Auth-Token: token" \ -H "X-Worm-Expiration-Days: period" \ accountURL/containerName
token
is the authentication token obtained earlier from Oracle Cloud Infrastructure Object Storage Classic. See Authenticating Access When Using the REST API.period
is the duration, in days, for which the WORM policy is set for the container.- For the syntax of
accountURL
, see About REST URLs for Oracle Cloud Infrastructure Object Storage Classic Resources. containerName
is the name of the container for which the WORM policy must be set.
Note:
When you send a REST API request to Oracle Cloud Infrastructure Object Storage Classic, all non-ASCII characters in container names, object names and metadata values must be URL-encoded. For example, my container
should be encoded as my%20container
, where %20
is the HTML encoding for the space character. Similarly, my Über Container
should be encoded as my%20%C3%9Cber%20Container
, where %20
represents the space character and %C3%9C
is the Ü
character.
HTTP Response Codes
- Success:
-
When updating a container with the WORM policy:
204 No Content
-
When creating a container with the WORM policy:
201 Created
-
- Failure: See Error Code Reference for Object Storage Classic
For information about getting container metadata, see Getting Container Metadata.
cURL Command Examples
- 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 REST Endpoint URL for the sample Cloud account is used in all the cURL command examples in this section. To use the REST Endpoint (Permanent) URL, replace https://acme.storage.oraclecloud.com/v1/Storage-acme
with https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365
.
-
This command sets the WORM policy of
4
days for the containerFirstContainer
:curl -v -X POST \ -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \ -H "X-Worm-Expiration-Days: 4" \ https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer
The following is an example of the output of this command:
> POST /v1/Storage-acme/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: acme.storage.oraclecloud.com > Accept: */* > X-Worm-Expiration-Days: 4 > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > < HTTP/1.1 204 No Content < Date: Tue, 06 Dec 2016 11:32:19 GMT < Content-Type: text/html; charset=UTF-8 < X-Trans-Id: txe8869b3edea348e5b49eb-0054f99043 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en
-
This command creates the container
SecondContainer
and sets the WORM policy of2
days:curl -v -X PUT \ -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \ -H "X-Worm-Expiration-Days: 2" \ https://acme.storage.oraclecloud.com/v1/Storage-acme/SecondContainer
The following is an example of the output of this command:
> PUT /v1/Storage-acme/SecondContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: acme.storage.oraclecloud.com > Accept: */* > X-Worm-Expiration-Days: 2 > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > < HTTP/1.1 201 Created < Date: Tue, 06 Dec 2016 11:36:24 GMT < Content-Type: text/html; charset=UTF-8 < X-Trans-Id: txe8869b3edea348e5b49eb-0054f99078 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en
-
This command gets the header values of the object
ObjectA
in the containerFirstContainer
that already has a WORM policy of4
days set:curl -v -s -X HEAD \ -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \ https://acme.storage.oraclecloud.com/v1/Storage-acme/FirstContainer/ObjectA
In the following example of the output of this command, the object header
X-Worm-Expiration-At
is indicating the Epoch expiration time of the WORM policy that is set on the container:> HEAD /v1/Storage-acme/FirstContainer/ObjectA HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/3.14.0.0 zlib/1.2.3 libidn/1.18 libssh2/1.4.2 > Host: acme.storage.oraclecloud.com > Accept: */* > > X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b > < HTTP/1.1 200 OK < Date: Tue, 06 Dec 2016 11:37:09 GMT < X-Worm-Expiration-At: 1481366700 < Content-Type: text/html; charset=UTF-8 < X-Timestamp: 1481024229 < X-Trans-Id: txe8869b3edea348e5b49eb-005417894 < Cache-Control: no-cache < Pragma: no-cache < Content-Language: en
Here, the Epoch expiration time
1481366700
corresponds to the dateSat, 10 Dec 2016 11:45:00 GMT
which is 4 days from the dateTue, 06 Dec 2016 11:45:00 GMT
when the object was uploaded. See http://epochconverter.com.