虚拟机相关接口
删除虚拟机控制台密码
删除一个虚拟机的控制台密码。
Headers
Authorization: OAuth the-session-uuidCurl示例
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/vm-instances/ea4173dfb9673c6db6f13e86e442f502/console-password参数列表
| 名字 | 类型 | 位置 | 描述 | 可选值 | 起始版本 |
|---|---|---|---|---|---|
| uuid | String | url | 虚拟机UUID | 0.6 | |
| systemTags (可选) | List | body | 系统标签 | 0.6 | |
| userTags (可选) | List | body | 用户标签 | 0.6 |
API返回
返回示例
{
"inventory": {
"uuid": "df586d0d621836609ade6734dd4a45f1",
"name": "Test-VM",
"description": "web server VM",
"zoneUuid": "792326bf6d4f314f9720d0bdc0da2ba6",
"clusterUuid": "e304b625b055320e9680c8bc1ed096c4",
"imageUuid": "28726d4ec39a356abf0d15fa006a5db3",
"hostUuid": "7b50e9f1deb33299bef71631922518f5",
"lastHostUuid": "33c8281f03a1336ea5e0af14546467aa",
"instanceOfferingUuid": "bf454bc1e6363ed39bd490e0a17d7085",
"rootVolumeUuid": "0889b134625933edbcf6c3626dc1ecb6",
"platform": "Linux",
"defaultL3NetworkUuid": "779c909b030e3d45b4c886c8d70c3d80",
"type": "UserVm",
"hypervisorType": "KVM",
"memorySize": 8589934592,
"cpuNum": 1,
"allocatorStrategy": "LastHostPreferredAllocatorStrategy",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"state": "Running",
"vmNics": [
{
"uuid": "5f6e0eccd83133f381ac93001f571b2a",
"vmInstanceUuid": "df586d0d621836609ade6734dd4a45f1",
"usedIpUuid": "fbc2d1acae463424a075562614b96f0d",
"l3NetworkUuid": "779c909b030e3d45b4c886c8d70c3d80",
"ip": "192.168.1.10",
"mac": "00:0c:29:bd:99:fc",
"hypervisorType": "KVM",
"netmask": "255.255.255.0",
"gateway": "192.168.1.1",
"deviceId": 0,
"state": "enable",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"allVolumes": [
{
"uuid": "0889b134625933edbcf6c3626dc1ecb6",
"name": "Root-Volume-For-VM-df586d0d621836609ade6734dd4a45f1",
"primaryStorageUuid": "47ac865b823337f6b39e8cce0bcc3b6e",
"vmInstanceUuid": "df586d0d621836609ade6734dd4a45f1",
"diskOfferingUuid": "f3dda1b2937537038169109e8cfa19b2",
"rootImageUuid": "28726d4ec39a356abf0d15fa006a5db3",
"installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-0889b134625933edbcf6c3626dc1ecb6/0889b134625933edbcf6c3626dc1ecb6.qcow2",
"type": "Root",
"format": "qcow2",
"size": 107374182400,
"actualSize": 21474836480,
"deviceId": 0,
"state": "Enabled",
"status": "Ready",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}
}| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| success | boolean | 0.6 | |
| error | ErrorCode | 错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error | 0.6 |
error
| 名字 | 类型 | 描述 | 起始版本 |
|---|---|---|---|
| code | String | 错误码号,错误的全局唯一标识,例如SYS.1000, HOST.1001 | 0.6 |
| description | String | 错误的概要描述 | 0.6 |
| details | String | 错误的详细信息 | 0.6 |
| elaboration | String | 保留字段,默认为null | 0.6 |
| opaque | LinkedHashMap | 保留字段,默认为null | 0.6 |
| cause | ErrorCode | 根错误,引发当前错误的源错误,若无原错误,该字段为null | 0.6 |
SDK示例
Java SDK
DeleteVmConsolePasswordAction action = new DeleteVmConsolePasswordAction();
action.uuid = "ea4173dfb9673c6db6f13e86e442f502";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteVmConsolePasswordAction.Result res = action.call();Python SDK
DeleteVmConsolePasswordAction action = DeleteVmConsolePasswordAction()
action.uuid = "ea4173dfb9673c6db6f13e86e442f502"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteVmConsolePasswordAction.Result res = action.call()