5 Creating an Object Storage Classic Container

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

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. By default, all containers are of the standard storage class (as opposed to the archive storage class). You can also create containers when provisioning an Oracle Database Cloud Service deployment or Data Integration Platform Cloud instance.

Note:

Before you create your first container, make sure that the replication policy has been set for your account. See About Replication Policy for Your Account in Using Oracle Cloud Infrastructure Object Storage Classic.

Interface Resources

Web Console

(Not available on Oracle Cloud Machine)

Creating a Container Using the Web Console

RESTful API

Creating a Container Using the REST API

Java Library

See createContainer in Java API Reference for Oracle Cloud Infrastructure Object Storage Classic.

File Transfer Manager API

See createContainer in Java API Reference forOracle Cloud Infrastructure Object Storage Classic File Transfer Manager.

To create an archive container, you must set the X-Storage-Class header to Archive. For more information, see Creating Archive Containers in Using Oracle Cloud Infrastructure Object Storage Classic. (Not available on Oracle Cloud Machine)

Creating a Container Using the Web Console

(Not available on Oracle Cloud Machine)

If this is your first time using Oracle Cloud, make sure that you customize your My Services dashboard to show Storage Classic. To show Storage Classic on your Dashboard:

  1. On your My Services Dashboard, click Customize Dashboard.

  2. In the Customize Dashboard dialog, locate Storage Classic under Infrastructure, and then click Show.

    Storage Classic then appears in your Dashboard. You can close the Customize Dashboard dialog to return to your Dashboard.

  3. From the Storage Classic Action menu, select Open Service Console.

  4. If this is your first time accessing Storage Classic, you’ll be asked to set a Geolocation Policy. Select the appropriate policy from the menu, and then click Set Policy.

  5. Click Create Container.

    The Create Container dialog box is displayed.

  6. Enter a name for the container.

    Note:

    Ensure that the container name complies with the input restrictions mentioned in Character Restrictions in Using Oracle Cloud Infrastructure Object Storage Classic.
  7. Select Standard in the Storage Class field.

  8. Click Create.

    The container is created and displayed in the console.

Creating a Container Using the REST API

cURL Command Syntax

curl -v -X PUT \
     -H "X-Auth-Token: token" \
     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

cURL Command Example

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

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

> PUT /v1/myservice-bar/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: foo.storage.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

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