Delete a Container

When you no longer need a container, you can delete it.

  1. Make sure that the container you want to delete is empty. If it isn't empty, then first delete the objects in it. See Delete an Object.
  2. To send REST API calls to Object Storage Classic, you need a valid authentication token. If you obtained a token less than 30 minutes ago, then you can use that token. Otherwise, get a new token as described in Get an Authentication Token.
  3. Send a DELETE request to the container. Specify the authentication token in the x-auth-token header.

    Syntax

    curl -X DELETE \
      {accountRestEndpointURL}/{containerName} \
      -H 'x-auth-token: {authToken}'

    Sample Command

    curl -X DELETE \
      https://myaccount.ocm.rack01.example.com/v1/Storage-myaccount/mycontainer \
      -H 'x-auth-token: AUTH_tk10d7cf10041726fa2e64652d975bbab0'
  4. In the response, look for 204 No Content.
    HTTP/1.1 204 No Content
    Server: nginx/1.10.2
    Date: Thu, 02 Aug 2018 23:11:08 GMT
    Connection: close
    X-Last-Modified-Timestamp: 1533251468.65728
    X-Trans-Id: txb7dca7e05d7443dba0adb-005b638f8cg