Updated on 2024-08-09 GMT+08:00

Querying Images

Function

This API is used to query the images.

URI

GET /v1/{project_id}/cloud-phone/images

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

image_type

No

String

Specifies the image type.

  • public: public images

  • private: private images

  • share: shared images

status

No

Integer

Specifies the image status.

  • 0: The image is being created.

  • 1: The image can be used.

  • 2: The image failed to be created.

offset

No

Integer

If the offset is 0 (default value) or an integer greater than 0, all resources after the offset will be queried.

limit

No

Integer

Specifies the number of resources returned on each page. The value ranges from 1 to 100 (default). Generally, this parameter is set to 10, 20, or 50.

image_id

No

String

Specifies the image ID.

image_name

No

String

Specifies the image name.

create_since

No

Long

Specifies the start time.

create_until

No

Long

Specifies the end time.

src_project_id

No

String

Specifies the project ID of the account that provides the image to share.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Specifies the user token. It can be obtained by calling an Identity and Access Management (IAM) API. The value of X-Subject-Token in the response header is the user token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

image_infos

Array of ListImagesView objects

Specifies details of the images.

total

Integer

Specifies the total number of records returned.

request_id

String

Specifies the unique request ID.

Table 5 ListImagesView

Parameter

Type

Description

domain_id

String

Specifies the ID of the tenant to which the image belongs.

image_name

String

Specifies the image name.

update_time

String

Specifies when the image was updated.

create_time

String

Specifies the time when the image was created.

image_size

Long

Specifies the image size, in bytes.

project_id

String

Specifies the project ID. (This parameter is returned only when image_type is set to private.)

image_id

String

Specifies the image ID.

image_version

String

Specifies the AOSP version of the image.

image_type

String

Specifies the image type. The value can be public (public images), private (private images), or share (shared images).

status

Integer

Specifies the image status.

  • 0: The image is being created.

  • 1: The image can be used.

  • 2: The image failed to be created.

src_project_id

String

Specifies the project ID of the account that provides the image to share. (This parameter is returned only when image_type is set to share.)

Example Requests

Querying images

GET https://{CPH Endpoint}/v1/{project_id}/cloud-phone/images

Example Responses

Status code: 200

OK

{
  "image_infos" : [ {
    "domain_id" : "4a2a9967e4514c388a4c945efcbab9d6",
    "image_name" : "cph-private-image",
    "update_time" : "2024-04-11T06:38:21Z",
    "create_time" : "2024-04-11T06:38:21Z",
    "image_size" : 1306150912,
    "project_id" : "3a63a229aa6e47bab2153b44a7f3f50d",
    "image_id" : "23030320230421e300221a2000004433",
    "image_version" : "AOSP 9.0",
    "image_type" : "private",
    "status" : 1
  } ],
  "total" : 1,
  "request_id" : "bff458ad55f24751b0b226119ab4f9fd"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.