VM Related Interfaces

Get Virtual Machine Console Address

GET/zstack/v1/vm-instances/{uuid}/console-addresses

Headers

Authorization: OAuth the-session-uuid

Curl Example

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

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlVirtual Machine UUID 0.6
systemTags (Optional)ListquerySystem Tag 0.6
userTags (Optional)ListqueryUser Tag 0.6

API Response

Response Example

{
  "hostIp": "192.168.10.100",
  "port": 5900,
  "protocol": "vnc",
  "vdiPortInfo": {
    "vncPort": 5900
  }
}
NameTypeDescriptionStarting Version
hostIpStringVirtual Machine running host IP0.6
portintVirtual Machine console port0.6
protocolStringVirtual Machine console protocol, vnc or spice or vncAndSpice0.6
successbooleanOperation success or not0.6
errorErrorCodeError code. If not null, the operation failed. This field is null when the operation is successful. For details, see error0.6
vdiPortInfovdiPortInfoFor details, see vdiPortInfo3.7.0

error

NameTypeDescriptionStarting Version
codeStringError code number, a globally unique identifier for the error, for example SYS.1000, HOST.10010.6
descriptionStringBrief description of the error0.6
detailsStringDetailed error information0.6
elaborationStringReserved field, defaults to null0.6
opaqueLinkedHashMapReserved field, defaults to null0.6
causeErrorCodeRoot cause. The source error that caused the current error. If there is no original error, this field is null0.6

vdiPortInfo

NameTypeDescriptionStarting Version
vncPortIntegerVNC port number3.7.0
spicePortIntegerSPICE port number3.7.0
spiceTlsPortIntegerSPICE TLS encryption enabled, there will be both spiceTlsPort and spicePort port numbers. To connect to the Virtual Machine through SPICE client, you need to use the spiceTlsPort port number3.7.0

SDK Examples

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()