Creating Containers

A container is a storage compartment that provides a way to organize the data stored in Oracle Storage Cloud Service.

Any user with the Service Administrator role can create containers. You should create at least one container for your account. Containers are similar to a directory structure but with a key distinction: unlike directories, containers cannot be nested.

For information about creating containers by using the Java library, see createContainer in Java API Reference for Oracle Cloud Storage Service.

For information about creating containers by using the REST API, see:

cURL Command Syntax

curl -v -X PUT \
     -H "X-Auth-Token: token" \
     accountURL/containerName

HTTP Response Codes

cURL Command Example

curl -v -X PUT \
     -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
     https://storage.us2.oraclecloud.com/v1/Storage-myIdentityDomain/FirstContainer

The following is an example of the output of this command:

* About to connect() to storage.us2.oraclecloud.com port 443 (#0)
*   Trying 160.34.0.51... connected
* Connected to storage.us2.oraclecloud.com (160.34.0.51) port 443 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
*   CAfile: /etc/pki/tls/certs/ca-bundle.crt
  CApath: none
* SSL connection using TLS_RSA_WITH_AES_128_CBC_SHA
* Server certificate:
*       subject: CN=*.us2.oraclecloud.com,O=Oracle Corporation,L=Redwood Shores,ST=California,C=US
*       start date: Oct 22 00:00:00 2014 GMT
*       expire date: Dec 21 23:59:59 2015 GMT
*       common name: *.us2.oraclecloud.com
*       issuer: CN=Symantec Class 3 Secure Server CA - G4,OU=Symantec Trust Network,O=Symantec Corporation,C=US
> PUT /v1/Storage-myIdentityDomain/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.us2.oraclecloud.com
> Accept: */*
> X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b
>
< HTTP/1.1 201 Created
< Date: Fri, 06 Mar 2015 10:34:20 GMT
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: tx23a1084b8c674fdeae8d4-0054f982ac
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Language: en
<
* Connection #0 to host storage.us2.oraclecloud.com left intact
* Closing connection #0

For information about getting details of a container, see Getting Container Metadata.