虚拟机相关接口

删除虚拟机SSH Key

DELETE/zstack/v1/vm-instances/{uuid}/ssh-keys

Headers

Authorization: OAuth the-session-uuid

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth: 2698b6ec6f4241e696c75416e8e31b48" \
-X DELETE http://localhost:8080/zstack/v1/vm-instances/2cc5bac17cf538a99aca3cd2a36a43c9/ssh-keys

参数列表

名字类型位置描述可选值起始版本
uuid (可选)Stringurl虚拟机UUID 0.6
systemTags (可选)Listbody系统标签 0.6
userTags (可选)Listbody用户标签 0.6

API返回

返回示例

{
  "inventory": {
    "uuid": "1b1b886507933498b811eb4cb02e5204",
    "name": "Test-VM",
    "description": "web server VM",
    "zoneUuid": "c2000b60bd0d3b09b2eaa540dbd52593",
    "clusterUuid": "9f0ad1b3faaa35bd9f6544b0cae6169b",
    "imageUuid": "18f55fcf23a335c7a75b8b0c1ab6bf6f",
    "hostUuid": "d06f5a98c17132f9afe093c26fdb4a64",
    "lastHostUuid": "891c6111cb0537e19a64b5c118908a93",
    "instanceOfferingUuid": "98dc7ca41563334a8b28f4cd78ee99b7",
    "rootVolumeUuid": "77e0c10945c23f34998ef3354eda44ce",
    "platform": "Linux",
    "defaultL3NetworkUuid": "3aa6de8432ac3c28832d333fd3708478",
    "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": "Stopped",
    "vmNics": [
      {
        "uuid": "95ec9e0a04563461804a509aae79c81c",
        "vmInstanceUuid": "1b1b886507933498b811eb4cb02e5204",
        "usedIpUuid": "400da1e1d2f93a60b090df24086dbd95",
        "l3NetworkUuid": "3aa6de8432ac3c28832d333fd3708478",
        "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": "77e0c10945c23f34998ef3354eda44ce",
        "name": "Root-Volume-For-VM-1b1b886507933498b811eb4cb02e5204",
        "primaryStorageUuid": "65ecece476553263825347f6593151f6",
        "vmInstanceUuid": "1b1b886507933498b811eb4cb02e5204",
        "diskOfferingUuid": "e7a7e4e9c304396c950da7f5cf970741",
        "rootImageUuid": "18f55fcf23a335c7a75b8b0c1ab6bf6f",
        "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-77e0c10945c23f34998ef3354eda44ce/77e0c10945c23f34998ef3354eda44ce.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"
      }
    ]
  }
}
名字类型描述起始版本
successboolean 0.6
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error0.6

error

名字类型描述起始版本
codeString错误码号,错误的全局唯一标识,例如SYS.1000, HOST.10010.6
descriptionString错误的概要描述0.6
detailsString错误的详细信息0.6
elaborationString保留字段,默认为null0.6
opaqueLinkedHashMap保留字段,默认为null0.6
causeErrorCode根错误,引发当前错误的源错误,若无原错误,该字段为null0.6

SDK示例

Java SDK

DeleteVmSshKeyAction action = new DeleteVmSshKeyAction();
action.uuid = "2cc5bac17cf538a99aca3cd2a36a43c9";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteVmSshKeyAction.Result res = action.call();

Python SDK

DeleteVmSshKeyAction action = DeleteVmSshKeyAction()
action.uuid = "2cc5bac17cf538a99aca3cd2a36a43c9"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteVmSshKeyAction.Result res = action.call()