Updated on 2023-03-16 GMT+08:00

Querying Cloud Phone Servers

Function Description

  • API name

    ListCloudPhoneServers

  • Function

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

URI

GET /v1/{project_id}/cloud-phone/servers?offset={offset}&limit={limit}&server_name={server_name}&network_version={network_version}

Table 1 lists URI parameters.
Table 1 URI parameters

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.

offset

No

Integer

Specifies the offset.

If the offset is an integer greater than 0 but fewer 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 resources to be returned on each page.

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

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

server_name

No

String

Specifies the name of the cloud phone server. Fuzzy query is supported.

server_id

No

String

Specifies the unique identifier of the cloud phone server.

network_version

No

String

Specifies which type of network the cloud phone server uses.

The type can be:

  • v1: system network
  • v2: custom network

Request

  • Request parameters

    None

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

Response

  • Response parameters

    Parameter

    Type

    Description

    request_id

    String

    Specifies the unique request ID.

    servers

    Array of objects

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

    Table 2 Data structure description of server

    Parameter

    Type

    Description

    server_name

    String

    Specifies the name of the cloud phone server.

    The name can contain a maximum of 65 characters, including only letters, digits, underscores (_), and hyphens (-).

    availability_zone

    String

    Specifies the AZ where the cloud phone server is deployed.

    server_id

    String

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

    server_model_name

    String

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

    For details, see Server Flavors.

    phone_model_name

    String

    Specifies the cloud phone flavor, which can contain a maximum of 64 bytes.

    For details, see Cloud Phone Flavor List.

    keypair_name

    String

    Specifies the name of the key pair used to connect to a cloud phone. The name can contain a maximum of 64 bytes.

    status

    Integer

    Specifies the status of the cloud phone server.

    • 0, 1, 3, or 4: Creating
    • 2: Abnormal
    • 5: Normal
    • 8: Frozen
    • 10: Stopped
    • 11: Being stopped
    • 12: Stopping failed
    • 13: Starting

    vpc_id

    String

    Specifies the ID of the Virtual Private Cloud (VPC) where the cloud phone server is deployed.

    When network_version is set to

    • v1, the value of vpc_id is the ID of the tenant VPC to which the cloud phone server belongs.
    • v2, the value of vpc_id is the ID of the VPC specified by the tenant during the cloud phone server creation.

    resource_project_id

    String

    Specifies the project ID of the cloud phone server.

    cidr

    String

    Specifies the CIDR block of the VPC where the cloud phone server is deployed.

    When network_version is set to

    • v1, the value of cidr is the CIDR block of the tenant VPC to which the cloud phone server belongs.
    • v2, the value of cidr is the CIDR block of the VPC specified by the tenant during the cloud phone server creation.
    NOTE:

    The value of this field is the same as that of vpc_cidr. This field will be discarded later.

    vpc_cidr

    String

    Specifies the CIDR block of the VPC where the cloud phone server is deployed.

    When network_version is set to

    • v1, the value of vpc_cidr is the CIDR block of the tenant VPC to which the cloud phone server belongs.
    • v2, the value of vpc_cidr is the CIDR block of the VPC specified by the tenant during the cloud phone server creation.

    subnet_id

    String

    Specifies the ID of the subnet where the cloud phone server is deployed.

    Only when network_version is set to

    • v2, the value of subnet_id is the ID of the subnet specified by the tenant during the cloud phone server creation.
    • v1, the value of subnet_id is the ID of the tenant subnet to which the cloud phone server belongs.

    subnet_cidr

    String

    Specifies the subnet CIDR block where the cloud phone server is deployed.

    When network_version is set to

    • v2, the value of subnet_cidr is the CIDR block of the subnet specified by the tenant during the cloud phone server creation.
    • v1, the value of subnet_cidr is the CIDR block of the tenant subnet to which the cloud phone server belongs.

    metadata

    Object

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

    addresses

    Array of objects

    Specifies IP addresses of the cloud phone server. For details, see Table 4.

    network_version

    String

    Specifies which type of network the cloud phone server uses.

    • v1: system network
    • v2: custom network

    Cloud phone servers can be filtered by network type.

    enterprise_project_id

    String

    Specifies the ID of the enterprise project to which the cloud phone server belongs.

    create_time

    String

    Specifies when the cloud phone server was created.

    It is a UTC time in YYYY-MM-DDTHH:MM:SSZ format.

    update_time

    String

    Specifies when the cloud phone server was updated.

    It is a UTC time in YYYY-MM-DDTHH:MM:SSZ format.

    Table 3 Data structure description of metadata

    Parameter

    Type

    Description

    order_id

    String

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

    product_id

    String

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

    Table 4 Data structure description of address

    Parameter

    Type

    Description

    intranet_ip

    String

    Specifies the internal IP address of the cloud phone server. This field has expired.

    access_ip

    String

    Specifies the public IP address of the cloud phone server. This field has expired.

    server_ip

    String

    Specifies the internal IP address of the cloud phone server. This field is newly added.

    public_ip

    String

    Specifies the public IP address of the cloud phone server. This field is newly added.

  • Example response
    {
        "servers": [
            {
                "server_name": "cph-edgr-1",
                "server_id": "4aff349ab539452a85ac5d7442b39377",
                "server_model_name": "physical.rx1.xlarge",
                "phone_model_name": "rx1.cp.c105.d6.e5v5",
                "keypair_name": "keypair01",
                "status": 2,
                "vpc_id": "9a11e291-967f-4dd6-99bd-9be54f10583c",
                "cidr": "192.168.0.0/16",
                "vpc_cidr": "192.168.0.0/16",
                "subnet_id": "c7f9983d-03ca-4a2e-a0e1-d6bd97174669",
                "subnet_cidr": "192.168.0.0/24",
                "addresses": [
                    {
                        "intranet_ip": "192.168.0.62",
                        "server_ip": "192.168.0.62",
                        "access_ip": "10.246.175.190",
                        "public_ip": "10.246.175.190"
                    },
                    {
                        "intranet_ip": "192.168.0.169",
                        "server_ip": "192.168.0.169",
                        "access_ip": "10.246.171.245",
                        "public_ip": "10.246.171.245"
                    }
                ],
                "resource_project_id": "06a5b529fa80d28b2f53c014024bed44",
                "metadata": {
                    "product_id": "00301-221014-0--0",
                    "order_id": "CS21111116336E8RX"
                },
                "availability_zone": "br-iaas-odin1a",
                "network_version": "v2",
                "enterprise_project_id": "0",
                "create_time": "2021-11-11T08:33:40Z",
                "update_time": "2021-11-11T09:28:30Z"
            },
            {
                "server_name": "cph-igfp-2",
                "server_id": "6d74b672216d40f39377a99e7f95aa95",
                "server_model_name": "physical.kg1m.4xlarge.cg",
                "phone_model_name": "kg1m.cg.c60.d20SSD.e1v1",
                "keypair_name": "KeyPair-2",
                "status": 2,
                "vpc_id": "12021c68-730f-41fa-9884-11c616f4c9ad",
                "cidr": "172.31.0.0/16",
                "vpc_cidr": "172.31.0.0/16",
                "subnet_id": "92cf2447-163c-4fe8-897b-fd262ab6b134",
                "subnet_cidr": "172.31.0.0/16",
                "addresses": [
                    {
                        "intranet_ip": "172.31.185.82",
                        "access_ip": "88.88.48.151",
                        "server_ip": "172.31.185.82",
                        "public_ip": "88.88.48.151"
                    }
                ],
                "resource_project_id": "06a5b529fa80d28b2f53c014024bed44",
                "metadata": {
                    "product_id": "OFFI635412973496623104",
                    "order_id": "CS21083015171L1CA"
                },
                "availability_zone": "br-iaas-odin1a",
                "network_version": "v1",
                "enterprise_project_id": "0",
                "create_time": "2021-08-30T07:17:40Z",
                "update_time": "2021-11-05T09:07:57Z"
            }
        ],
        "request_id": "4336f6c61d2048c6b58b4368d9d95ecd"
    }

Returned Values

See Returned Values.

Error Codes

See Error Codes.