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

Querying Cloud Phones

Function

This API is used to query cloud phones by page. The cloud phones are sorted by creation time in descending order. You can specify offset and limit. If no cloud phone is found, an empty list will be returned.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

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. Value range: 1 to 200 (default value). Generally, this parameter is set to 10, 20, or 50.

phone_name

No

String

Specifies the cloud phone name. Fuzzy query is supported.

server_id

No

String

Specifies the unique identifier of the cloud phone server.

status

No

Integer

Specifies the cloud phone status.

  • 1: creating

  • 2: running

  • 3: resetting

  • 4: restarting

  • 6: frozen

  • 7: stopping

  • 8: stopped

  • -5: reset failed

  • -6: restart failed

  • -7: abnormal

  • -8: creation failed

  • -9: stop failed

type

No

Integer

Cloud phone type.

  • 0: common cloud phone

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

phones

Array of Phone objects

Specifies the information about cloud phones.

request_id

String

Specifies the unique request ID.

count

Integer

Specifies the total number of cloud phones.

Table 5 Phone

Parameter

Type

Description

phone_name

String

Specifies the cloud phone name, which can contain a maximum of 65 bytes.

server_id

String

Specifies the cloud phone server ID, which can contain a maximum of 32 bytes.

phone_id

String

Specifies the unique identifier of the cloud phone. The value can contain a maximum of 32 bytes.

phone_model_name

String

Specifies the cloud phone flavor. The value can contain a maximum of 64 bytes.

image_id

String

Specifies the cloud phone image ID, which can contain a maximum of 32 bytes.

image_version

String

Specifies the image version.

vnc_enable

String

Specifies whether to enable the VNC service on the cloud phone. - true: enable

  • false: disable

status

Integer

Specifies the cloud phone status.

  • 0: being created

  • 1: Creating

  • 2: running

  • 3: resetting

  • 4: restarting

  • 6: frozen

  • 7: being shut down

  • 8: powered off

  • -5: The resetting fails.

  • -6: The restart fails.

  • -7: The mobile phone is abnormal.

  • -8: Creation failed.

  • -9: The VM fails to be shut down.

type

Integer

Cloud phone type.

  • 0: common cloud phone

  • 1: trial cloud phone

imei

String

Specifies the International Mobile Equipment Identity (IMEI) of the cloud phone.

traffic_type

String

Specifies the cloud phone route type.

  • direct: default route

  • routing: Traffic is routed to the encoding container.

volume_mode

Integer

Specifies whether the cloud phone disk is independent.

  • 0: not independent

  • 1: independent

availability_zone

String

Specifies the AZ where the cloud phone server is deployed.

metadata

metadata object

Specifies the order and product information.

has_encrypt

Boolean

Specifies whether file-level encryption is enabled on the cloud phone.

create_time

String

Creation Time, The time format is UTC.

update_time

String

Update Time, The time format is UTC.

Table 6 metadata

Parameter

Type

Description

order_id

String

Specifies the order ID. The value can contain a maximum of 64 bytes.

product_id

String

Specifies the product ID, which can contain a maximum of 64 bytes.

Example Requests

Querying cloud phones

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

Example Responses

Status code: 200

OK

{
  "request_id" : "6a63a18b8bab40ffb71ebd9cb80d0085",
  "count" : 1,
  "phones" : [ {
    "phone_name" : "mobile-0001",
    "server_id" : "88b8449b896f3a4f0ad57222dd91909",
    "phone_id" : "1234567b8bab40ffb711234cb80d0234",
    "phone_model_name" : "AOSP-1U4G15G-001",
    "image_version" : "AOSP 7.0",
    "image_id" : "88b8449b896f3a4f0ad57222dd91909",
    "vnc_enable" : "true",
    "status" : 2,
    "type" : 0,
    "imei" : "869287243397729",
    "availability_zone" : "cn-southwest-242b",
    "traffic_type" : "direct",
    "volume_mode" : 0,
    "metadata" : {
      "order_id" : "CS1710111105S8IPB",
      "product_id" : "00301-25217-0--0"
    },
    "create_time" : "2017-10-10T00:00:00Z",
    "update_time" : "2018-10-10T00:00:00Z"
  } ]
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.