Querying Encoding Servers

Function Description

  • API Name

    ListEncodeServers

  • Function

    Query the encoding servers.

URI

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

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.

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 encoding servers 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 encoding server type.

  • 0: server
  • 1: container

status

No

Integer

Specifies the encoding server status.

  • 1: Running
  • 2: Abnormal
  • 3: Restarting
  • 4: Frozen
  • 5: Sopped
  • 100, 1014, or 0: Creating

server_id

No

String

Specifies the Cloud Phone server ID.

Request

  • Request parameters

    None

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

Response

  • Response parameters

    Parameter

    Type

    Description

    request_id

    String

    Specifies the request ID, which is unique.

    encode_servers

    Array of objects

    Specifies th encoding server information. For details, see Table 2.

    Table 2 encode_server field description

    Parameter

    Type

    Description

    encode_server_name

    String

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

    encode_server_id

    String

    Specifies the unique ID of the encoding server. The value can contain a maximum of 32 bytes.

    encode_server_ip

    String

    Specifies the IP address of the encoding server.

    server_id

    String

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

    keypair_name

    String

    Specifies the key for logging in to the encoding server.

    type

    Integer

    Specifies the encoding server type.

    • 0: server
    • 1: container

    status

    Integer

    Specifies the encoding server status.

    • 1: The encoding server is running.
    • 2: The encoding server is abnormal.
    • 3: The encoding server is restarting.
    • 0, 4, or 5: The encoding server is being created.

    access_infos

    Array of objects

    Specifies the access information of the encoding server. For details, see Table 3.

    Table 3 access_info field description

    Parameter

    Type

    Description

    listen_port

    Integer

    Specifies the listening port of the encoding server.

    access_ip (expired)

    String

    Specifies the public IP address accessed by the encoding server.

    internet_ip (expired)

    String

    Specifies the private IP address accessed by the encoding server.

    public_ip (new)

    String

    Specifies the public IP address accessed by the encoding server.

    server_ip (new)

    String

    Specifies the private IP address accessed by the encoding server.

    access_port

    Integer

    Specifies the port used by the encoding server to access the public network.

    type

    String

    Specifies the port type of the encoding server. Possible values are as follows:

    • adb: ADB port of the cloud phone
    • vnc: VNC port of the cloud phone
    • cph_app_server: access port of the cloud gaming client
    • cph_h5_server: H5 web page access port of cloud gaming
    • Others: user-defined port
  • Example response
    {
        "encode_servers": [{
                "encode_server_name": "ENCODE_SERVER_2",
                "encode_server_id": "00b00d1b35094f13b360cdfe15a9bfee",
                "encode_server_ip": "10.237.0.233",
                "server_id": "26fef5ef8f484e5fbd3d3974134b8091",
                "keypair_name": "keyPair2",
                "type": 0,
                "status": 1,
                "access_infos": [
                    {
                        "listen_port": 6902,
                        "intranet_ip": "172.31.240.115",
                        "access_port": 6902,
                        "access_ip": "10.154.119.231",
                        "server_ip": "172.31.240.115",
                        "public_ip": "10.154.119.231",
                        "type": "port1"
                    }, 
                    {
                        "listen_port": 6903,
                        "intranet_ip": "172.31.240.115",
                        "access_port": 6903,
                        "access_ip": "172.31.240.115",
                        "server_ip": "172.31.240.115",
                        "public_ip": "",
                        "type": "port2"
                    },
                    {
                        "listen_port": 6900,
                        "intranet_ip": "172.31.240.115",
                        "access_port": 6900,
                        "access_ip": "172.31.240.115",
                        "server_ip": "172.31.240.115",
                        "public_ip": "",
                        "type": "port3"
                    },
                        "listen_port": 6901,
                        "intranet_ip": "172.31.240.115",
                        "access_port": 6901,
                        "access_ip": "100.68.0.235"
                        "server_ip": "172.31.240.115",
                        "public_ip": "100.68.0.235",
                        "type": "port4"
                    }
                ]
            }
        ],
        "request_id": "4faba0b7f7cb4e829b18773718289b99"
    }

Returned Values

See Returned Values.

Error Codes

See Error Codes.