GetHostWebSshUrl
API Request
URLs
POST zstack/v1/hosts/websshHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"uuid": "1e6eb11de9d5347e9a5bc72269f45247",
"https": false
},
"systemTags": [],
"userTags": []
}
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"uuid":"1e6eb11de9d5347e9a5bc72269f45247","https":false}}' //localhost:8080/zstack/v1/hosts/websshRequest Parameters
| Name | Type | Location | Description | Valid Values | Starting Version |
|---|---|---|---|---|---|
| uuid | String | body (contained in the params structure) | The resource UUID. | 4.7.0 | |
| systemTags | List | body | Optional. The system tags. | 4.7.0 | |
| userTags | List | body | Optional. The user tags. | 4.7.0 | |
| https (可选) | Boolean | body (contained in the params structure) | 4.7.11 |
API Response
Sample
Response
{
"url": "ws://{{ip}}:8888/ws?id\u003d140147795208568"
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| url | String | The host URL. | 4.7.0 |
| success | 4.7.0 | ||
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.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. | 4.7.0 |
| description | String | The brief description of the error. | 4.7.0 |
| details | String | The details about the error. | 4.7.0 |
| elaboration | String | The reserved field. Default value: null. | 4.7.0 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 4.7.0 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.7.0 |
SDK Sample
Java
SDK
GetHostWebSshUrlAction action = new GetHostWebSshUrlAction();
action.uuid = "1e6eb11de9d5347e9a5bc72269f45247";
action.https = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
GetHostWebSshUrlAction.Result res = action.call();Python
SDK
GetHostWebSshUrlAction action = GetHostWebSshUrlAction()
action.uuid = "1e6eb11de9d5347e9a5bc72269f45247"
action.https = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
GetHostWebSshUrlAction.Result res = action.call()