• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Image Management
  6. Querying Images (Discarded)

Querying Images (Discarded)

Function

This API is used to query all images.

Constraints

  • This API will be discarded. You are advised to use the IMS API "Querying Images (Native OpenStack API)".

URI

GET /v2.1/{project_id}/images

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

Request

Request parameters

Parameters in the following table can be used as URI parameters to filter query results. Usage: /v2/{project_id}/images? name ={name}&status={status}

Table 2 describes the request parameters.

Table 2 Request parameters

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 3 shows the mapping of image statuses 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 3 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

Response parameters

Table 4 describes the response parameters.

Table 4 Response parameters

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 5 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 6 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 7 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 version 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.

Examples

  • Example request
    GET /v2/9c53a566cb3443ab910cf0daebca90c4/images
    GET /v2.1/9c53a566cb3443ab910cf0daebca90c4/images
  • Example response
    {
        "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.