获取云主机RDP开关状态(GetVmRDP)
获取VM RDP开关状态,返回值为true或者false
API请求
URLs
GET zstack/v1/vm-instances/{uuid}/rdpHeaders
Authorization: OAuth the-session-uuidcurl -H "Content-Type: application/json" \
-H "Authorization: OAuth c38710f23af942819cc2c431bd94407b" \
-X GET http://localhost:8080/zstack/v1/vm-instances/78494eb669424e97b6f18920a920adbf/rdp
参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 资源的UUID,唯一标示该资源 | 2.1 | |
| systemTags (可选) | List | query | 2.1 | ||
| userTags (可选) | List | query | 2.1 |
API返回
返回示例
{
"enable": true
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| enable | boolean | vm RDP 开关是否开启 | 2.1 |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 2.1 |
#error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 2.1 |
| description | String | 错误的概要描述 | 2.1 |
| details | String | 错误的详细信息 | 2.1 |
| elaboration | String | 保留字段,默认为null | 2.1 |
| opaque | LinkedHashMap | 保留字段,默认为null | 2.1 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 2.1 |
SDK示例
Java
SDK
GetVmRDPAction action = new GetVmRDPAction();
action.uuid = "2503d2eb486e43469fef0e4864fb6c90";
action.sessionId = "380901023c664283a2a3edc0c52817f2";
GetVmRDPAction.Result res = action.call();Python
SDK
GetVmRDPAction action = GetVmRDPAction()
action.uuid = "4cec955330e44ac980b99f20c811f1cc"
action.sessionId = "2971ac1171da458b964bf689032ba778"
GetVmRDPAction.Result res = action.call()