Delete image

Overview

Deletes a specified image.

Classification

  • Delete

API Operation Object

  • images

Synchronous / Asynchronous

  • synchronous

Request

HTTP Request Method

  • DELETE

HTTP Request Path

{api_endpoint}/v2/images/{image_id}

HTTP Request Header

Format

X-Auth-Token: <token_id>
  • User-Agent, Host, Accept fields are automatically added

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

image_id

URL

UUID

An identifier for the image

required

-

Terminate

404

token_id

Header

authentication token string

keystone authentication token

required

-

Terminate

401

Response

HTTP Response Header

Format

HTTP/1.1 <response code> <message>       (ex. 204 No Content)
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

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

Response Code

Response Codes

response code

condition

204

normal end

401

unauthorized

403

protected_flag of specified image is true

-

if authority of non admin, image has no owner

-

if authority of non admin, requested by user whose project is not the owner of specified public image

-

if authority of non admin, requested by user whose project is the member but not the owner of specified private image

404

specify non-existent image_id

-

specify the image_id of deleted image

-

if authority of non admin, requested by user whose project is not the member and not the owner of specified private image (assuming that the image has owner)

500

Internal Error

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/images/{image_id}

Request Header

X-Auth-Token: ajk3adjiown02
  • User-Agent, Host, Accept fields are automatically added

Request Body

  • none

Sample API Response

Response Header

HTTP/1.1 204 No Content
  • <response_code>: see "HTTP Responses" section

  • <message>: message based on the response code

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

Response Body

  • none

Execution Example

HTTP Request

DELETE /v2/images/5e8ad6dc-83fc-4f45-8db3-06690a73a2c7 HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.11.141:9292
Accept: */*
X-Auth-Token: 3e144c0b21e642aa97a29a7844c936e4

HTTP Response

HTTP/1.1 204 No Content
Content-Type: text/html; charset=UTF-8
Content-Length: 0
X-Openstack-Request-Id: req-806d44ea-4360-457d-bb84-ac52bf59aaab
Date: Wed, 06 Aug 2014 00:58:26 GMT

Error Execution Example

HTTP Request

DELETE /v2/images/455af5de-e503-46de-9884-f0334f5b17eo HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:9292
Accept: */*
X-Auth-Token: fa72b568b7874a35a835b2639f51fbbc

HTTP Response

HTTP/1.1 404 Not Found
Content-Length: 189
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-c7d9f557-a439-4e66-920d-541cffed937a
Date: Thu, 15 Oct 2015 12:28:00 GMT

404 Not Found

Failed to find image 455af5de-e503-46de-9884-f0334f5b17eo to delete