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

Querying Encoding Services

Function

This API is used to query encoding services.

URI

GET /v1/{project_id}/cloud-phone/encode-servers

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. The value ranges from 1 to 100 (default). Generally, this parameter is set to 10, 20, or 50.

type

No

Integer

Encoding service type.

  • 0: server

  • 1: container

status

No

Integer

Status list.

  • 1: running

  • 2: abnormal

  • 3: restarting

  • 4: frozen

  • 5: powered off

  • 100, 1014, 0: being created

server_id

No

String

Specifies the unique identifier of the cloud phone server.

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.

encode_servers

Array of EncodeServer objects

Specifies the information about the encoding service.

Table 5 EncodeServer

Parameter

Type

Description

encode_server_name

String

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

encode_server_id

String

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

encode_server_ip

String

Specifies the IP address of the encoding service.

server_id

String

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

keypair_name

String

Specifies the key pair for logging in to the encoding service.

type

Integer

Encoding service type.

  • 0: server

  • 1: container

status

Integer

Encoding service status.

  • 1: running

  • 2: abnormal

  • 3: restarting

  • 0, 4, 5: being created

access_infos

Array of EncodeServerAccessInfo objects

Specifies the access information about the encoding service.

encode_server_ipv6

String

Specifies the IPv6 address of the encoding service.

Table 6 EncodeServerAccessInfo

Parameter

Type

Description

listen_port

Integer

Specifies the listening port of the encoding service.

access_ip

String

(Expired) Specifies the public IP address of the encoding service.

intranet_ip

String

(Expired) Specifies the private IP address of the encoding service.

public_ip

String

(New) Specifies the public IP address for accessing the encoding service.

server_ip

String

(New) Specifies the private IP address for accessing the encoding service.

access_port

Integer

Specifies the port of the encoding service accessed by the public network.

type

String

Specifies the port type of the encoding service. The value can be one of the following:

  • adb: ADB ports of the cloud phone

  • vnc: VNC ports of the cloud phone

  • cph_app_server: access ports of the cloud gaming client

  • cph_h5_server: H5 web page access ports of cloud gaming

  • Others: user-defined ports

server_ipv6

String

(New) Specifies the private IPv6 address for accessing the encoding service.

Example Requests

Querying the encoding container by server ID

GET https://{CPH Endpoint}/v1/{project_id}/cloud-phone/encode-servers?server_id=9a8870d670584f929978b15c80009e99

Example Responses

Status code: 200

OK

{
  "encode_servers" : [ {
    "encode_server_name" : "ENCODE_SERVER_2",
    "encode_server_id" : "00b00d1b35094f13b360cdfe15a9bfee",
    "encode_server_ip" : "10.237.0.233",
    "encode_server_ipv6" : "fd00::aed:e9",
    "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",
      "server_ipv6" : "2001:db8:a583:b62:e5ea:4a6b:de7b:f97d",
      "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",
      "server_ipv6" : "2001:db8:a583:b62:e5ea:4a6b:de7b:f97d",
      "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",
      "server_ipv6" : "2001:db8:a583:b62:e5ea:4a6b:de7b:f97d",
      "public_ip" : "",
      "type" : "port3"
    }, {
      "listen_port" : 6901,
      "intranet_ip" : "172.31.240.115",
      "server_ipv6" : "2001:db8:a583:b62:e5ea:4a6b:de7b:f97d",
      "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"
}

Status Codes

Status Code

Description

200

OK

Error Codes

See Error Codes.