Get image details

Overview

Gets details for a specified image.

Classification

  • Show

API Operation Object

  • images

Synchronous / Asynchronous

  • -

Request

HTTP Request Method

  • GET

HTTP Request Path

{api_endpoint}/v2/{tenant_id}/images/{image_id}

HTTP Request Header

Format

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

HTTP Request Body

  • none

Request Parameter

Request Parameters

name

style

format

description

required/optional

tenant_id

URI

UUID

The tenant ID in a multi-tenancy cloud.

required

image_id

URI

UUID

The UUID for the image.

required

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, 203

normal end

400

badRequest

401

unauthorized

403

forbidden

405

badMethod

413

overLimit

503

serviceUnavailable

HTTP Response Body

Format

{
    "image": {
        "created": "<created>",
        "id": "<id>",
        "links": [
            {
                "href": "<href>",
                "rel": "<rel>"
            },
            {
                "href": "<href>",
                "rel": "<rel>"
            },
            {
                "href": "<href>",
                "rel": "<rel>",
                "type": "<type>"
            }
        ],
        "metadata": {
            "architecture": "<architecture>",
            "auto_disk_config": "<auto_disk_config>",
            "kernel_id": "<kernel_id>",
            "ramdisk_id": "<ramdisk_id>"
        },
        "minDisk": <minDisk>,
        "minRam": <minRam>,
        "name": "<name>",
        "progress": <progress>,
        "status": "<status>",
        "updated": "<updated>"
    }
}

Response Parameter

Response Parameters

item

format

description

X-Compute-Request-ID (Optional)

String

Returns a unique identifier to provide tracking for the request. The request ID that is associated with the request appears in the log lines for that request. By default, the middleware configuration ensures that the request ID appears in the log files.

created

time/date

created time of image

id

UUID

image id

architecture

String

The architecture of the metadata

auto_disk_config

boolean

Processing method of the root disk partition.
If True, to use all available virtual disk

If False, and use the size of the image

kernel_id

String

kernel id

ramdisk_id

String

ramdisk id

minDisk

int

Integer value for the minimum disk space in GB so you can filter results.

minRam

int

Integer value for the minimum RAM so you can filter results.

name

String

name of the image

progress

int

boot progress for imege

status

String

Value of the status of the image so that you can filter on "ACTIVE" for example.

updated

time/date

update time

Sample API Request and Response

Sample API Request

Request URI

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

Request Header

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

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": {
        "created": "2011-01-01T01:02:03Z",
        "id": "70a599e0-31e7-49b7-b260-868f441e862b",
        "links": [
            {
                "href": "http://openstack.example.com/v2/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
                "rel": "self"
            },
            {
                "href": "http://openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
                "rel": "bookmark"
            },
            {
                "href": "http://glance.openstack.example.com/openstack/images/70a599e0-31e7-49b7-b260-868f441e862b",
                "rel": "alternate",
                "type": "application/vnd.openstack.image"
            }
        ],
        "metadata": {
            "architecture": "x86_64",
            "auto_disk_config": "True",
            "kernel_id": "nokernel",
            "ramdisk_id": "nokernel"
        },
        "minDisk": 0,
        "minRam": 0,
        "name": "fakeimage7",
        "progress": 100,
        "status": "ACTIVE",
        "updated": "2011-01-01T01:02:03Z"
    }
}

Execution Example

HTTP Request

GET /v2/b17a6492bfa54441910e15f07c983384/images/7ba75599-e03e-4eed-8d04-eb302e0a71cf HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 5f944a7a64d3408597b618915dad29ea
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 754
X-Compute-Request-Id: req-3712f1be-48c3-4502-b1d8-9b083f978731
Date: Tue, 06 Oct 2015 09:29:56 GMT

{"image": {"status": "ACTIVE", "updated": "2015-10-06T06:33:27Z", "links": [{"href": "http://192.168.56.250:8774/v2/b17a6492bfa54441910e15f07c983384/images/7ba75599-e03e-4eed-8d04-eb302e0a71cf", "rel": "self"}, {"href": "http://192.168.56.250:8774/b17a6492bfa54441910e15f07c983384/images/7ba75599-e03e-4eed-8d04-eb302e0a71cf", "rel": "bookmark"}, {"href": "http://192.168.56.250:9292/b17a6492bfa54441910e15f07c983384/images/7ba75599-e03e-4eed-8d04-eb302e0a71cf", "type": "application/vnd.openstack.image", "rel": "alternate"}], "id": "7ba75599-e03e-4eed-8d04-eb302e0a71cf", "OS-EXT-IMG-SIZE:size": 258080768, "name": "ubuntu_server_14_04-cloudimg-amd64.img", "created": "2015-10-06T06:33:11Z", "minDisk": 0, "progress": 100, "minRam": 0, "metadata": {}}}

Error Execution Example

HTTP Request

GET /v2/b17a6492bfa54441910e15f0c983384/images/7ba75599-e03e-4eed-8d04-eb302e0a71cf HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.56.250:8774
X-Auth-Token: 2344e1b5b8a74c3498e28b67b7767177
Content-type: application/json
Accept: application/json

HTTP Response

HTTP/1.1 400 Bad Request
Content-Length: 187
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-c6dd4894-fc72-422e-a029-f5674187dbdd
Date: Tue, 06 Oct 2015 09:38:37 GMT

{"badRequest": {"message": "Malformed request URL: URL's project_id 'b17a6492bfa54441910e15f0c983384' doesn't match Context's project_id 'b17a6492bfa54441910e15f07c983384'", "code": 400}}