获取虚拟机USB重定向开关状态

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

Headers

Authorization: OAuth the-session-uuid

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth bb5fd18e914f4bfd88032edd0ee7b975" \
-X GET http://localhost:8080/zstack/v1/vm-instances/4b9d28c1d35f4f14b8ba1bb982500c50/usbredirect

参数列表

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

API返回

返回示例

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

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

GetVmUsbRedirectAction action = new GetVmUsbRedirectAction();
action.uuid = "c58671c58dd147e29d4bc263feafa04d";
action.sessionId = "e173648fdca94fd3ae720473a305ce4c";
GetVmUsbRedirectAction.Result res = action.call();

Python SDK

GetVmUsbRedirectAction action = GetVmUsbRedirectAction()
action.uuid = "08efac4de45a4f6789d1009afa9e295e"
action.sessionId = "3f5a7473758d4c8ab3cc4664461500a4"
GetVmUsbRedirectAction.Result res = action.call()