Querying the Cloud Phones

Function Description

  • API Name

    ListCloudPhones

  • Function

    Query the cloud phones by page. The cloud phones are sorted in descending order of the creation time. You can specify the values of offset and limit. If no cloud phone exists, an empty list is returned.

URI

GET /v1/{project_id}/cloud-phone/phones?phone_name={phone_name}&server_id={server_id}&status={status}&offset={offset}&limit={limit}&type={type}

For details, see Table 1.
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

For details about how to obtain the project ID, see Obtaining a Project ID.

phone_name

No

String

Specifies the cloud phone name. Fuzzy query is supported.

server_id

No

String

Specifies the cloud phone server ID.

status

No

Integer

Specifies the cloud phone status. The options are as follows:

  • 0 and 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: Stopping failed

offset

No

Integer

Offset

If the value is an integer greater than 0 but less than the number of resources, all resources after this offset will be queried. The default value is 0.

limit

No

Integer

Specifies the number of cloud phones returned on each page.

Value range: 1–100 (default value: 100)

Generally, set this parameter to 10, 20, or 50.

type

No

Integer

Specifies the cloud phone type.

  • 0: common cloud phone
  • 1: trial cloud phone

Request

  • Request parameters

    None

  • Example request
    1
    GET https://{CPH Endpoint}/v1/{project_id}/cloud-phone/phones?offset=0&limit=10
    

Response

  • Parameter description

    Parameter

    Type

    Description

    request_id

    String

    Specifies the request ID, which is unique.

    phones

    Array of objects

    Specifies the cloud phone information. For details, see Table 2.

    Table 2 phone field description

    Parameter

    Type

    Description

    phone_name

    String

    Specifies the cloud phone name. The value can contain a maximum of 65 bytes.

    server_id

    String

    Specifies the cloud phone server ID. The value 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.

    For details, see Cloud Phone Flavor List.

    image_id

    String

    Specifies the cloud phone image ID. The value can contain a maximum of 32 bytes.

    vnc_enable

    String

    Specifies whether to enable VNC login on a cloud phone.

    • true: enable
    • false: disable

    metadata

    Object

    Specifies the order and product information. For details, see Table 3.

    status

    Integer

    Specifies the cloud phone status.

    • 0 and 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: Stopping failed

    type

    Integer

    Specifies the cloud phone type.

    • 0: common cloud phone
    • 1: trial cloud phone

    create_time

    String

    Specifies the time when the cloud phone is created.

    The time format is UTC.

    update_time

    String

    Specifies the time when the cloud phone is updated.

    The time format is UTC.

    Table 3 metadata field description

    Parameter

    Type

    Description

    order_id

    String

    Specifies the order ID, which contains a maximum of 64 bytes.

    product_id

    String

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

    probation_begin_time

    String

    Specifies the cloud phone trial start time in UTC format, YYYY-MM-DDTHH:MM:SSZ.

    probation_end_time

    String

    Specifies the cloud phone trial end time in UTC format, YYYY-MM-DDTHH:MM:SSZ.

  • Example response
    { 
        "request_id": "6a63a18b8bab40ffb71ebd9cb80d0085", 
        "phones": [
            {
                "phone_name": "mobile-0001",
                "server_id": "88b8449b896f3a4f0ad57222dd91909",
                "phone_id": "1234567b8bab40ffb711234cb80d0234",
                "phone_model_name": "AOSP-1U4G15G-001",
                "image_id": "88b8449b896f3a4f0ad57222dd91909",
                "vnc_enable": "true",
                "status": 2,
                "type": 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"
            },
    ......
        ]
    }

Returned Values

See Returned Values.

Error Codes

See Error Codes.