Delete volume

Overview

Ask OpenStack to delete a specified volume.

Classification

  • Delete

API Operation Object

  • volumes

Synchronous / Asynchronous

  • asynchronous

Request

HTTP Request Method

  • DELETE

HTTP Request Path

{api_endpoint}/v2/{tenant_id}/volumes/{volume_id}

HTTP Request Header

Format

Accept-Encoding: gzip, deflate, compress(optional)
Accept: application/json
X-Auth-Token: {token_id>

HTTP Request Body

Format

  • none

Request Parameter

Request Parameters
name style format description required/optional default value action for invalid parameter response code for invalid parameter
tenant_id URL UUID(3) ID of the tenant required - Terminate 400
volume_id URL UUID(2) the volume ID to be deleted required - Terminate 404
token_id Header String(token_id) Keynote admin token required - Terminate 401

Response

HTTP Response Header

Format

HTTP/1.1 <response code> <message>       (ex. 202 Accepted)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "X-Openstack-Request-Id", "Content-Length", "Date"

Response Code

Response Codes
response code condition
202 normal end
400 The status of volume that is specified in URL is not one that is available, error, and error_extending
- Snapshot is in the volume that is specified in URL
- Volume that is specified in the URL is being migrated
- The status of volume that is specified in URL is not available, and more force_option is not true
- invalid input for tenant ID
401 unauthorized(including keystone down)
403 User who requested is not allowed to do get operation
- User who requested is not allowed to do delete operation
404 volume that is specified in URL do not exist

HTTP Response Body

Format

  • none

Response Parameter

Response Parameters
item format description
none - -

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/{tenant_id}/volumes/{volume_id}

Request Header

Accept-Encoding: gzip, deflate, compress(optional)
Accept: application/json
X-Auth-Token: ajk3adjiown02

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 202 Accepted
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

    • skip auto insert field such as "X-Compute-Request-Id" and "X-Openstack-Request-Id", "Content-Length", "Date"

Response Body

  • none

Execution Example

HTTP Request

DELETE /v2/ecf9a3818cfa4bfb9fcee4c73587f15b/volumes/030a0d32-ef75-4bca-80d6-7968de597eaa HTTP/1.1
Host: 192.168.11.67:8776
X-Auth-Project-Id: demo
Accept-Encoding: gzip, deflate, compress
Accept: application/json
X-Auth-Token: d1d340e459654c0a879794ff82353c99
User-Agent: python-cinderclient

HTTP Response

HTTP/1.1 202 Accepted
Content-Type: text/html; charset=UTF-8
Content-Length: 0
X-Openstack-Request-Id: req-22a073c0-ac84-45b8-b1a1-9487dc9b06c3
Date: Wed, 21 May 2014 11:14:44 GMT

Error Execution Example

HTTP Request

DELETE /v2/cb8aa2a2c7244af5aab1fa7881ba7f4/volumes/84b8be0b-840d-479a-8b87-4da58e48df00 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8776
X-Auth-Token: ff2e687208974dff83e05693ac8ac723
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 65
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-7d840662-5611-4f57-a779-29bb4ec2f60c
X-Openstack-Request-Id: req-7d840662-5611-4f57-a779-29bb4ec2f60c
Date: Thu, 15 Oct 2015 06:53:16 GMT

{"badRequest": {"message": "Malformed request url", "code": 400}}