Download binary image data

Overview

Downloads binary image data.

Classification

  • Download

API Operation Object

  • file

Synchronous / Asynchronous

  • synchronous

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/images/{image_id}/file

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. 200 OK)
  • <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
200 normal end
204 normal end (no image data exists in the specified image)
401 unauthorized
403 Not authorized to perform the requested action
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

<image_data>

Response Parameter

Response Parameters
item format description
checksum MD5 md5 hash of image contents
image_data application/octet-stream raw binary data that represents the actual virtual disk

Sample API Request and Response

Sample API Request

Request URI

https://example.com/v2/images/{image_id}/file

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 200 OK
  • <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

<image_data>

Execution Example

HTTP Request

GET /v2/images/100f4d2d-dcb5-472e-b93f-b4e13d888604/file HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.11.141:9292
Accept: */*
X-Auth-Token: dfa4e41cdae24f8cb75f75f7cd1f8815

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/octet-stream
Content-Md5: 4eada48c2843d2a262c814ddc92ecf2c
Content-Length: 25165824
X-Openstack-Request-Id: req-5a2c300b-25c8-44e1-856b-51ee23acbc87
Date: Mon, 25 Aug 2014 00:32:38 GMT

(raw binary data)

Error Execution Example

HTTP Request

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

HTTP Response

HTTP/1.1 404 Not Found
Content-Length: 181
Content-Type: text/html; charset=UTF-8
X-Openstack-Request-Id: req-25b4ffe3-b3a0-41ae-a1b6-82afcf58a002
Date: Thu, 15 Oct 2015 13:54:20 GMT

404 Not Found

No image found with ID 455af5de-e503-46de-9884-f0334f5b17eo