Deleting Containers

All objects within a container must first be deleted before the container can be deleted.

Any user with the Service Administrator role can perform this task.

You can delete containers by using the following interfaces:
Interface Resources

Web Console

See Deleting a Container Using the Web Console.

RESTful API

See Delete Container in REST API for Standard Storage in Oracle Storage Cloud Service.

Java Library

See deleteContainer in Java API Reference for Oracle Cloud Storage Service.

Oracle Storage Cloud File Transfer Manager CLI

See Deleting Containers in Command-Line Reference for Oracle Storage Cloud Service.

File Transfer Manager API

See deleteContainer in Java API Reference for Oracle Storage Cloud Service File Transfer Manager.

For information about deleting multiple objects in a container in a single operation, see Bulk-Deleting Objects.

Deleting a Container Using the Web Console

  1. Sign in to the Oracle Storage Cloud Service console.

    The list of containers is displayed.

  2. Identify the container that you want to delete.
  3. Click delete on the left side of the container name.

    The delete button is displayed only for empty containers.

    The following message appears:

    Are you sure want to delete this container?

  4. Click OK.

    The container is deleted.

Deleting a Container Using the REST API

All objects within a container must first be deleted before the container can be deleted. To find out whether a container contains any objects, send a HEAD request to the container URL.

cURL Command Syntax

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

Note:

When you send a REST API request to Oracle Storage Cloud service, 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 DELETE \
     -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
     https://foo.storage.oraclecloud.com/v1/Storage-myIdentity3/FirstContainer

Note:

The URL of the account in this example is https://foo.storage.oraclecloud.com/v1/Storage-myIdentity3. Replace this URL with the URL for your account. For the steps to find out your account URL, see URL for the Account.
The following is an example of the output of this command:
> DELETE /v1/Storage-myIdentity3/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 204 No Content
< Date: Fri, 06 Mar 2015 10:43:38 GMT
< Content-Length: 0
< Content-Type: text/html; charset=UTF-8
< X-Trans-Id: txc100a7408d564f82916fb-0054f984da
< Cache-Control: no-cache
< Pragma: no-cache
< Content-Language: en
<