删除云主机指定IP(DeleteVmStaticIp)

删除云主机三层网络上指定的IP。

API请求

URLs
DELETE zstack/v1/vm-instances/{vmInstanceUuid}/static-ips?l3NetworkUuid={l3NetworkUuid}&deleteMode={deleteMode}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "l3NetworkUuid": "0a52c0bd8b4049699ff5b772f3f3eb59",
    "deleteMode": "Permissive"
  },
  "systemTags": [],
  "userTags": []
}
Note: 上述示例中systemTagsuserTags字段可以省略。列出是为了表示body中可以包含这两个字段。
Curl示例
curl -H "Content-Type: application/json" \
-H "Authorization: OAuth 64d0600e594944eca1f49970ab4ca25c" \
-X DELETE http://localhost:8080/zstack/v1/vm-instances/faf465c53e7f47898b8f41c5e90e46d3/static-ips?l3NetworkUuid=4ef401fb452e3b48af5914bcd336d670&deleteMode=Permissive
参数列表
名字 类型 位置 描述 可选值 起始版本
vmInstanceUuid String url 云主机UUID 0.6
l3NetworkUuid String body 三层网络UUID 0.6
deleteMode(可选) String body 0.6
systemTags (可选) List body 系统标签 0.6
userTags (可选) List body 用户标签 0.6

API返回

返回示例
{
  "inventory": {
    "uuid": "aa498202ad064d949e953e6b1c34653a",
    "name": "Test-VM",
    "description": "web server VM",
    "zoneUuid": "ac43427ffc5948c8a24aa364a4471ada",
    "clusterUuid": "ba25be3393a1445b8fdfdba28f87155d",
    "imageUuid": "b0884882126445ddb8e3d5de3490bdcf",
    "hostUuid": "f4f2e93245bd40c3a5db51d9ac95c593",
    "lastHostUuid": "88f9a2a245ef4a289588851f927763e2",
    "instanceOfferingUuid": "1b206ad5484645528ba14a1c27c633d0",
    "rootVolumeUuid": "200bf3e928de459d9182fea4cf7eb3fd",
    "platform": "Linux",
    "defaultL3NetworkUuid": "44b85e2a6d7f443b9f0bed0842449a35",
    "type": "UserVm",
    "hypervisorType": "KVM",
    "memorySize": 8.589934592E9,
    "cpuNum": 1.0,
    "allocatorStrategy": "LastHostPreferredAllocatorStrategy",
    "createDate": "May 11, 2017 1:22:29 PM",
    "lastOpDate": "May 11, 2017 1:22:29 PM",
    "state": "Running",
    "vmNics": [
      {
        "uuid": "8767d51cb10341eebc866d756a23b160",
        "vmInstanceUuid": "aa498202ad064d949e953e6b1c34653a",
        "usedIpUuid": "cafa365e629846dd895cd4f273edd9bf",
        "l3NetworkUuid": "44b85e2a6d7f443b9f0bed0842449a35",
        "ip": "192.168.1.10",
        "mac": "00:0c:29:bd:99:fc",
        "netmask": "255.255.255.0",
        "gateway": "192.168.1.1",
        "deviceId": 0.0,
        "createDate": "May 11, 2017 1:22:29 PM",
        "lastOpDate": "May 11, 2017 1:22:29 PM"
      }
    ],
    "allVolumes": [
      {
        "uuid": "200bf3e928de459d9182fea4cf7eb3fd",
        "name": "Root-Volume-For-VM-aa498202ad064d949e953e6b1c34653a",
        "primaryStorageUuid": "251c44e3521e49d4982aa9c7b3b6116b",
        "vmInstanceUuid": "aa498202ad064d949e953e6b1c34653a",
        "diskOfferingUuid": "afd12ea56bd84e8b9a26fe27b11d20ca",
        "rootImageUuid": "b0884882126445ddb8e3d5de3490bdcf",
        "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-200bf3e928de459d9182fea4cf7eb3fd/200bf3e928de459d9182fea4cf7eb3fd.qcow2",
        "type": "Root",
        "format": "qcow2",
        "size": 1.073741824E11,
        "actualSize": 2.147483648E10,
        "deviceId": 0.0,
        "state": "Enabled",
        "status": "Ready",
        "createDate": "May 11, 2017 1:22:29 PM",
        "lastOpDate": "May 11, 2017 1:22:29 PM"
      }
    ]
  }
}
名字 类型 描述 起始版本
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
DeleteVmStaticIpAction action = new DeleteVmStaticIpAction();
action.vmInstanceUuid = "f81673bc3cf04884b19d5ded83cd9ff8";
action.l3NetworkUuid = "636a65b66bfc490985d44285a090ab11";
action.deleteMode = "Permissive";
action.sessionId = "93d5734188ee48058032d6a2cebebf80";
DeleteVmStaticIpAction.Result res = action.call();
Python SDK
DeleteVmStaticIpAction action = DeleteVmStaticIpAction()
action.vmInstanceUuid = "6fa2e4774cb34e72986f3a4860c5fad4"
action.l3NetworkUuid = "fa3953b839434d4a81a106e578a3a366"
action.deleteMode = "Permissive"
action.sessionId = "5cc00379d1224a1c9be943419e54f467"
DeleteVmStaticIpAction.Result res = action.call()