Updated on 2024-04-15 GMT+08:00

Obtaining the VNC Login Address

Function

This API is used to obtain the address for remotely logging in to an ECS using VNC.

URI

POST /v1/{project_id}/cloudservers/{server_id}/remote_console

Table 1 describes the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Description

project_id

Yes

Specifies the project ID.

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

server_id

Yes

Specifies the ECS ID.

Request

Request parameters

Table 2 describes the request parameters.

Table 2 Request parameters

Parameter

Mandatory

Type

Description

remote_console

Yes

Object

Obtains the address for remotely logging in to an ECS. For details, see Table 3.

Table 3 remote_console parameters

Parameter

Mandatory

Type

Description

type

Yes

String

Specifies a remote login mode. Set it to novnc.

protocol

Yes

String

Specifies a remote login protocol. Set it to vnc.

Response

Response parameters

Table 4 describes the response parameters.

Table 4 Response parameters

Parameter

Type

Description

remote_console

Object

Obtains the address for remotely logging in to an ECS. For details, see Table 5.

Table 5 remote_console field description

Parameter

Type

Description

type

String

Specifies a remote login mode.

protocol

String

Specifies a remote login protocol.

url

String

Specifies a remote login URL.

The URL for VNC login contains a one-time token. Keep the token secure and discard it after using it.

Example Request

Obtain the VNC login address of the ECS whose ID is 47bc79ae-df61-4ade-9197-283a74e5d70e.

POST https://{endpoint}/v1/13c67a214ced4afb88d911ae4bd5721a/cloudservers/47bc79ae-df61-4ade-9197-283a74e5d70e/remote_console

{
    "remote_console": {
        "protocol": "vnc",
        "type": "novnc"
    }
}

Example Response

{
   "remote_console": {
        "type": "novnc",
        "protocol": "vnc",
        "url": "https://nova-novncproxy.az1.dc1.domainname.com:8002/vnc_auto.html?token=0fda3eca-8232-4249-****-************&lang=EN&tLength=70"
    }
}

Error Codes

See Error Codes.