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.
|See Deleting a Container Using the Web Console.|
See Delete Container in REST API for Standard Storage in Oracle Storage Cloud Service.
Oracle Storage Cloud File Transfer Manager CLI
See Deleting Containers in Command-Line Reference for Oracle Storage Cloud Service.
File Transfer Manager API
For information about deleting multiple objects in a container in a single operation, see Bulk-Deleting Objects.
Deleting a Container Using the Web Console
- Sign in to the Oracle Storage Cloud Service console.
The list of containers is displayed.
- Identify the container that you want to delete.
- 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?
- 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
tokenis the authentication token obtained earlier from Oracle Storage Cloud Service. See Authenticating Access When Using the REST API.
- For the syntax of
accountURL, see About REST URLs for Oracle Storage Cloud Service Resources.
containerNameis the name of the container to be deleted.
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
%20 is the HTML encoding for the space character. Similarly,
my Über Container should be encoded as
%20 represents the space character and
%C3%9C is the
HTTP Response Codes
204 No Content
- Failure: See Error Code Reference for Oracle Storage Cloud Service
cURL Command Example
curl -v -X DELETE \ -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \ https://foo.storage.oraclecloud.com/v1/myservice-bar/FirstContainer
> DELETE /v1/myservice-bar/FirstContainer HTTP/1.1 > User-Agent: curl/7.19.7 (x86_64-redhat-linux-gnu) libcurl/7.19.7 NSS/18.104.22.168 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 <