Request Console Access
Headers
Authorization: OAuth the-session-uuidBody
{
"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/consolesParameter List
| Name | Type | Location | Description | Allowed Values | Starting Version |
|---|---|---|---|---|---|
| vmInstanceUuid | String | body (enclosed in the params structure) | Virtual machine UUID | 0.6 | |
| systemTags (Optional) | List | body | System tags | 0.6 | |
| userTags (Optional) | List | body | User tags | 0.6 |
API Response
Response Example
{
"inventory": {
"scheme": "http",
"hostname": "127.0.0.1",
"port": 4900.0,
"token": "d96caf24fae54c76b7652f548a258261"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | Error code. If not null, the operation has failed. This field is null when the operation succeeds. For details, see error | 0.6 |
| inventory | ConsoleInventory | For details, see inventory | 0.6 |
error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | Error code number. The globally unique identifier of the error, for example, SYS.1000 or HOST.1001. | 0.6 |
| description | String | Brief description of the error | 0.6 |
| details | String | Detailed information about the error | 0.6 |
| elaboration | String | Reserved field. Default is null. | 0.6 |
| opaque | LinkedHashMap | Reserved field. Default is null. | 0.6 |
| cause | ErrorCode | Root error. The source error that caused the current error. This field is null if no root error exists. | 0.6 |
inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| scheme | String | Access protocol type | 0.6 |
| hostname | String | Host name | 0.6 |
| port | int | Port | 0.6 |
| token | String | Token | 0.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()