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

Querying Cloud Phone Flavors

Function

This API is used to query cloud phone flavors.

URI

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

Table 1 Path Parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

Table 2 Query Parameters

Parameter

Mandatory

Type

Description

status

No

Integer

Specifies the status of a flavor.

  • 0: offline

  • 1: available If this parameter is not specified, flavors in all states will be queried.

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.

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

request_id

String

Specifies the unique request ID.

phone_models

Array of PhoneModel objects

Specifies flavors of cloud phones.

Table 5 PhoneModel

Parameter

Type

Description

server_model_name

String

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

phone_model_name

String

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

status

Integer

Flavor status. Options:

  • 1: normal

  • 0: offline A flavor that has been taken offline cannot be used to purchase a cloud phone server.

cpu

Integer

Number of vCPUs

memory

Integer

Specifies the memory size in MB.

disk

Integer

Specifies the storage size in GiB.

resolution

String

Specifies the cloud phone resolution, which can contain a maximum of 16 bytes.

extend_spec

String

Specifies the cloud phone extended configuration, which can contain a maximum of 512 bytes.

spec_code

String

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

phone_capacity

Integer

Specifies the number of cloud phones of the current flavor.

image_label

String

Specifies the image type. Only the following types are supported:

  • qemu_phone

  • cloud_phone

  • cloud_phone_1620

  • cloud_game

  • cloud_game_1620

product_type

Integer

Product type.

  • 0: cloud phone

  • 1: cloud mobile game

phone_model_version

Integer

Specification version:

  • 0: specification 1.0

  • 1: Specification 2.0

dpi

Integer

Number of points per inch.

fps

String

Rendering frame rate.

volume_mode

Integer

Specifies whether the physical disk of the cloud phone is independent.

  • 0: not independent

  • 1: independent

Example Requests

Querying cloud phone flavors

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

Example Responses

Status code: 200

OK

{
  "phone_models" : [ {
    "server_model_name" : "physical.rx1.xlarge",
    "phone_model_name" : "rx1.cp.c60.d32.e1v1.qemu",
    "status" : 1,
    "cpu" : 2,
    "memory" : 3072,
    "disk" : 32,
    "resolution" : "540x960",
    "render_fps" : 60,
    "stream_fps" : 60,
    "extend_spec" : "{\"eip_count\": 1, \"vip_count\":1, \"emulator_type\":0, \"bms_image_id\":\"72460777-7fcb-4cae-8bb5-62d93be86bd7\",\"core_bind_strategy\":\"lxc_qemu_common_hosted_c60\", \"sd_disk\": 1}",
    "spec_code" : "rx1.cp.c60.d32.e1v1.qemu",
    "phone_capacity" : 60,
    "image_label" : "qemu_phone",
    "product_type" : 0
  }, {
    "server_model_name" : "physical.rx1.xlarge",
    "phone_model_name" : "rx1.cp.c60.d10.e1v1",
    "status" : 1,
    "cpu" : 2,
    "memory" : 3584,
    "disk" : 10,
    "resolution" : "720x1280",
    "render_fps" : 60,
    "stream_fps" : 60,
    "extend_spec" : "{\"eip_count\": 1, \"vip_count\":1, \"emulator_type\":1,\"thinpool_size_g\":70, \"sharepool_size_g\":650,\"max_share_disk_size_g\":50,\"encode_server_spec\": {\"cpu\": 2,\"memory\": 14448,\"disk\": 10,\"image_id\":\"coderserver_v2.5\", \"port_num\":0},\"core_bind_strategy\":\"common_hosted_c60\"}",
    "spec_code" : "rx1.cp.c60.d10.e1v1",
    "phone_capacity" : 60,
    "image_label" : "cloud_phone",
    "product_type" : 0
  } ],
  "request_id" : "e0dd77cb688743468599487ca2a1c738"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.