Help Center/ Workspace/ API Reference/ Workspace APIs/ Image/ Queries product images.
Updated on 2024-01-10 GMT+08:00

Queries product images.

Function

Queries the product images supported by Huawei Cloud Workspace.

Debugging

You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.

URI

GET /v2/{project_id}/images

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

os_type

No

String

OS of a product image, for example, Windows.

image_type

No

String

Image type. -gold: a public image -private: a private image

platform

No

String

Image OS, for example, Windows.

architecture

No

String

Image architecture: x86.

package_type

No

String

Package series.

limit

No

Integer

Number of records on each page. The value ranges from 0 to 100 and defaults to 100.

offset

No

Integer

Offset. The default value is 0.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API that is used to obtain a user token. The value of X-Subject-Token in the response header is the user token.

Content-Type

Yes

String

MIME type of the request body, for example, application/json.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

images

Array of ImageInfo objects

Product images supported by Huawei Cloud Workspace.

total_count

Integer

Number of objects.

Table 5 ImageInfo

Parameter

Type

Description

id

String

Image ID.

image_type

String

Image type. The value can be gold (public image) or private (private image).

os_type

String

OS type: Linux, Windows, or Other.

os_version

String

OS version.

disk_format

String

Image format: vhd, raw, qcow2, or zvhd2.

name

String

Image name.

min_ram

Integer

Minimum memory size (MB) required for running the image. The parameter value depends on the ECS flavor. The value is generally set to 0.

min_disk

Integer

Minimum disk space (GB) required for running the image. The value ranges from 40 to 1024.

product_code

String

Product code of the image.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 401

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 403

Table 8 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 404

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 405

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 500

Table 11 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Status code: 503

Table 12 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error description.

Example Requests

  • GET /v2/29dfe82ada564ac2b927e1ff036d9a9b/images?image_type=gold&os_type=Linux
  • /v2/0e69423d4400f4a82f67c0059a1e4cc8/images?architecture=x86&image_type=private

Example Responses

Status code: 200

Response to the request for querying images in the OpenStack environment.

{
  "total_count" : 1,
  "images" : [ {
    "id" : "d6b368bc-a24d-4fb5-a8fb-727356a53f33",
    "image_type" : "gold",
    "os_type" : "Linux",
    "os_version" : "EulerOS 2.2 64bit",
    "disk_format" : "qcow2",
    "name" : "Euler_Online_Tenant_vAG",
    "min_ram" : 0,
    "min_disk" : 50
  }, {
    "id" : "bef99a44-2b6a-4ef9-b1a2-204a4910e374",
    "image_type" : "gold",
    "os_type" : "Linux",
    "os_version" : "EulerOS 2.5 64bit",
    "disk_format" : "qcow2",
    "name" : "FA-LZ-x86vAG-801temp",
    "min_ram" : 0,
    "min_disk" : 60
  } ]
}

Status Codes

Status Code

Description

200

Response to the request for querying images in the OpenStack environment.

400

The request cannot be understood by the server due to malformed syntax.

401

Authentication failed.

403

You do not have required permissions.

404

No resource found.

405

The request method is not allowed.

500

An internal service error occurred. For details about the error code, see the error code description.

503

The service is unavailable.

Error Codes

See Error Codes.