虚拟机相关接口

获取虚拟机RDP开关状态

GET/zstack/v1/vm-instances/{uuid}/rdp

获取VM RDP开关状态,返回值为true或者false

Headers

Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth c38710f23af942819cc2c431bd94407b" \
-X GET http://localhost:8080/zstack/v1/vm-instances/78494eb669424e97b6f18920a920adbf/rdp

参数列表

名字类型位置描述可选值起始版本
uuidStringurl资源的UUID,唯一标示该资源 2.1
systemTags (可选)Listquery  2.1
userTags (可选)Listquery  2.1

API返回

返回示例

{
  "enable": true
}
名字类型描述起始版本
enablebooleanvm RDP 开关是否开启2.1
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error2.1

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10012.1
descriptionString错误的概要描述2.1
detailsString错误的详细信息2.1
elaborationString保留字段,默认为null2.1
opaqueLinkedHashMap保留字段,默认为null2.1
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null2.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()