• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Images
  6. Querying All Images

Querying All Images

Function Description

This interface is used to query all images.

URI

  • URI format

    GET /v2/{tenant_id}/images

    GET /v2.1/{tenant_id}/images

  • Parameter description

    Parameter

    Mandatory

    Description

    tenant_id

    Yes

    Specifies the tenant or project ID.

Restrictions

This interface will become invalid from micro version 2.36. Since this version, the system will return error 404 when you invoke this interface. Using the corresponding image service interface is recommended.

Extension Description

N/A

Request

Fields in the following table can be used as URI parameters to filter the query results. An example of setting the parameters as URI parameters is as follows: /v2/{tenant_id}/images? name ={name}&status={status}

Parameter

Type

Mandatory

Description

name

String

No

Specifies the image name.

status

String

No

Specifies the image status.

You cannot query images when the value is set to deleted. The value varies depending on the status in Glance. Table 1 shows the mapping relationship of image status in Nova and Glance.

changes-since

String

No

Specifies the images modified after the changes-since time point. The parameter is in ISO 8601 time format, for example, 2013-06-09T06:42:18Z.

minRam

Int

No

Specifies the minimum memory size in MB required by the image.

minDisk

Int

No

Specifies the minimum disk size in GB required by the image.

Table 1 Mapping relationship of image status in Nova and Glance

Image Status in Glance

Image Status in Nova

queued

saving

saving

saving

active

active

deleted

deleted

Response

Parameter

Type

Mandatory

Description

images

List(Dict)

Yes

Specifies the image information.

images_links

List(Dict)

No

Specifies the information about the next page when you query images in pages.

Table 2 images information

Parameter

Type

Mandatory

Description

id

String

Yes

Specifies the image ID in UUID format.

links

List(Dict)

Yes

Specifies the shortcut link of the image.

name

String

Yes

Specifies the image name.

Table 3 images_links parameters

Parameter

Type

Mandatory

Description

href

String

Yes

Specifies the URL of the next page when you query images in pages.

rel

String

Yes

Specifies the query direction when you query images in pages.

Table 4 links parameter description

Parameter

Type

Mandatory

Description

href

String

Yes

Specifies the link of the corresponding resource.

rel

String

Yes

The value can be:

  • self: A self link contains a versioned link to the resource. Use these links when the link is followed immediately.
  • bookmark: A bookmark link provides a permanent link to a resource, which is suitable for long term storage.
  • alternate: An alternate link can contain an alternate representation of the resource. For example, an OpenStack Compute image may have an alternate representation in the OpenStack image service.

type

String

No

The type attribute provides a hint as to the type of representation to expect when following the link.

Request Example

GET /v2/9c53a566cb3443ab910cf0daebca90c4/images

GET /v2.1/9c53a566cb3443ab910cf0daebca90c4/images

Response Example

{
    "images": [
        {
            "id": "ee10f19c-503c-44af-af2f-73d5e42f7a17",
            "links": [
                {
                    "href": "http://172.25.150.84:8774/v2/d9ebe43510414ef590a4aa158605329e/images/ee10f19c-503c-44af-af2f-73d5e42f7a17",
                    "rel": "self"
                },
                {
                    "href": "http://172.25.150.84:8774/d9ebe43510414ef590a4aa158605329e/images/ee10f19c-503c-44af-af2f-73d5e42f7a17",
                    "rel": "bookmark"
                },
                {
                    "href": "http://172.25.150.84:9292/d9ebe43510414ef590a4aa158605329e/images/ee10f19c-503c-44af-af2f-73d5e42f7a17",
                    "rel": "alternate",
                    "type": "application/vnd.openstack.image"
                }
            ],
            "name": "image1"
        }
    ]
}

Returned Values

See General Request Returned Values.