GetVmConsoleAddress

API Request

URLs
GET zstack/v1/vm-instances/{uuid}/console-addresses
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth 5c66c9a616334283b055d150680fff98" \
-X GET http://localhost:8080/zstack/v1/vm-instances/bf2211ae8eaf408b817d3a05c19e2226/console-addresses
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The VM instance UUID. 0.6
systemTags List query Optional. The system tags. 0.6
userTags List query Optional. The user tags. 0.6

API Response

Sample Response

{
  "hostIp": "192.168.10.100",
  "port": 5900.0,
  "protocol": "vnc",
  "vdiPortInfo": {
    "vncPort": 5900.0
  }
}
Name Type Description Starting Version
hostIp String The IP address of the host where the VM instance is running. 0.6
port int The console port of the VM instance. 0.6
protocol String The console protocol of the VM instance. Options:
  • vnc
  • spice
  • vncAndSpice
0.6
success boolean Whether the operation succeeds. 0.6
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
vdiPortInfo vdiPortInfo See vdiPortInfo. 3.7.0
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#vdiPortInfo
Name Type Description Starting Version
vncPort Integer The VNC port No. 3.7.0
spicePort Integer The SPICE port No. 3.7.0
spiceTlsPort Integer If TLS encryption is enabled for SPICE, two ports will be available: spiceTlsPort and spicePort. To connect the VM instance by using a SPICE client, use spiceTlsPort. 3.7.0

SDK Sample

Java SDK
GetVmConsoleAddressAction action = new GetVmConsoleAddressAction();
action.uuid = "d6bb8b652c1445969b5c4227385956d3";
action.sessionId = "1c0ec00749234a96978591d641e0c64d";
GetVmConsoleAddressAction.Result res = action.call();
Python SDK
GetVmConsoleAddressAction action = GetVmConsoleAddressAction()
action.uuid = "f6b7fe2da3ae4c929ad1c8ed14f37c8e"
action.sessionId = "5f127b3df90245ed93ef9da531442fdc"
GetVmConsoleAddressAction.Result res = action.call()