Delete multiple containers or objects

delete

/v1/{account}

Deletes one or more containers and / or objects.

The body of the request is a plain-text, newline-separated list of URL encoded objects to delete. Each line must be of the form container or container/object. The body is subject to the following conditions and restrictions:

  • When a line is of the form container, the corresponding container must be empty.
  • No more than 10,000 lines (deletions) may be specified per request.
  • After the first 10 deletions have been processed, all subsequent deletions in the request will be processed at a rate not exceeding one deletion every 100msec.

Request

Path Parameters
  • The unique name for the account. An account is also known as the project or tenant.
Query Parameters
Header Parameters
Back to Top

Response

Supported Media Types

200 Response

A 200 response is always returned. Check the response body for details.
Body ()
Root Schema : schema
Type: object
Show Source
Nested Schema : Errors
Type: array
List of all errors that occurred.
Show Source
Back to Top

Examples

cURL Command

Sample Cloud account with the following details:

  • 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 following example shows how to delete multiple containers (and objects in multiple containers) by submitting a DELETE request with the bulk-delete query parameter.

  1. Create a local file that lists the objects to be deleted and the containers they are in.

    Here's a sample of such a file:

    $ cat objects_to_delete
    
    container1/object1
    container1/object2
    container1
    container2/object3
    container3
    
    In this example, the goal is to delete the following:
    • object1 and object2 in container1

    • container1, if it is empty

    • object3 in container2

    • container3, if it is empty

  2. Send a DELETE request to the account URL.
    • Specify the file that contains the list of containers and objects to be deleted.

    • Include the bulk-delete query parameter.

    • Set Content-Type to text/plain.

    • Using the REST Endpoint URL obtained from the REST Endpoint field in the My Services dashboard:

      curl -v -X DELETE \
           -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
           -H "Content-Type: text/plain" \
           -T objects_to_delete \
           "https://acme.storage.oraclecloud.com/v1/Storage-acme?bulk-delete"

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

      HTTP/1.1 200 OK
      Date: Tue,  28 Jun 2015 11:44:29 GMT
      Content-Type: text/plain
      Transfer-Encoding: chunked
      Number Deleted: 5
      Number Not Found: 0
      Response Body: 
      Response Status: 200 OK
      Errors:
    • Using the Service Permanent REST Endpoint URL obtained from the REST Endpoint (Permanent) field in the My Services dashboard:

      Note:

      This cURL command example applies to the accounts created after November 2017.
      curl -v -X DELETE \
           -H "X-Auth-Token: AUTH_tkb4fdf39c92e9f62cca9b7c196f8b6e6b" \
           -H "Content-Type: text/plain" \
           -T objects_to_delete \
           "https://storage-7b16fede61e1417ab83eb52e06f0e365.storage.oraclecloud.com/v1/Storage-7b16fede61e1417ab83eb52e06f0e365?bulk-delete"

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

      HTTP/1.1 200 OK
      Date: Tue,  28 Jun 2015 11:44:29 GMT
      Content-Type: text/plain
      Transfer-Encoding: chunked
      Number Deleted: 5
      Number Not Found: 0
      Response Body: 
      Response Status: 200 OK
      Errors:
Back to Top