Request Console Access

POST/zstack/v1/consoles

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "vmInstanceUuid": "b95acae48c804003ac3820751b58a50d"
  },
  "systemTags": [],
  "userTags": []
}

In the preceding example, the systemTags and userTags fields are optional. They are listed here to show that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"vmInstanceUuid":"e0442db541833083bd7e411a4d94d969"}}' \
http://localhost:8080/zstack/v1/consoles

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
vmInstanceUuidStringbody (enclosed in the params structure)Virtual machine UUID 0.6
systemTags (Optional)ListbodySystem tags 0.6
userTags (Optional)ListbodyUser tags 0.6

API Response

Response Example

{
  "inventory": {
    "scheme": "http",
    "hostname": "127.0.0.1",
    "port": 4900.0,
    "token": "d96caf24fae54c76b7652f548a258261"
  }
}
NameTypeDescriptionStarting Version
errorErrorCodeError code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error0.6
inventoryConsoleInventoryFor details, see inventory0.6

error

NameTypeDescriptionStarting Version
codeStringError code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001.0.6
descriptionStringBrief description of the error0.6
detailsStringDetailed information about the error0.6
elaborationStringReserved field. Default is null.0.6
opaqueLinkedHashMapReserved field. Default is null.0.6
causeErrorCodeRoot error. The source error that caused the current error. This field is null if no root error exists.0.6

inventory

NameTypeDescriptionStarting Version
schemeStringAccess protocol type0.6
hostnameStringHost name0.6
portintPort0.6
tokenStringToken0.6

SDK Examples

Java SDK

RequestConsoleAccessAction action = new RequestConsoleAccessAction();
action.vmInstanceUuid = "c8925478e1f840caa1f3919affa19155";
action.sessionId = "f896abb919754292aa8d2f286596142c";
RequestConsoleAccessAction.Result res = action.call();

Python SDK

RequestConsoleAccessAction action = RequestConsoleAccessAction()
action.vmInstanceUuid = "f37c825f87444941bf16261f63c7dbb7"
action.sessionId = "331a21749df940e4b447e9103518890d"
RequestConsoleAccessAction.Result res = action.call()