分布式交换机相关接口

从主机上卸载分布式交换机

DELETE/zstack/v1/l2-networks/{l2NetworkUuid}/hosts/{hostUuid}

Headers

Authorization: OAuth the-session-uuid

Curl示例

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/l2-networks/65509f36186c339d8fa85fe0b632c61f/hosts/99d5e85e897a317780ed520e3dafdf0c

参数列表

名字类型位置描述可选值起始版本
l2NetworkUuidStringurl端口组分布式交换机UUID 4.1.0
hostUuidStringurl主机UUID 4.1.0
systemTags (可选)Listbody系统标签 4.1.0
userTags (可选)Listbody用户标签 4.1.0

API返回

返回示例

{
  "inventory": {
    "vlan": 10,
    "name": "Test-Net",
    "description": "Test",
    "zoneUuid": "5b03d97878c536a6bedfb1ac1931ef2c",
    "physicalInterface": "eth0",
    "type": "L2VlanNetwork"
  }
}
名字类型描述起始版本
successboolean 4.1.0
inventoryL2NetworkInventory详情参考inventory4.1.0
errorErrorCode错误码,若不为null,则表示操作失败, 操作成功时该字段为null。 详情参考error4.1.0

inventory

名字类型描述起始版本
uuidString资源的UUID,唯一标示该资源4.1.0
nameString资源名称4.1.0
descriptionString资源的详细描述4.1.0
zoneUuidString数据中心UUID4.1.0
physicalInterfaceString物理网卡4.1.0
typeString分布式交换机类型4.1.0
createDateTimestamp创建时间4.1.0
lastOpDateTimestamp最后一次修改时间4.1.0
attachedClusterUuidsList挂载集群的UUID列表4.1.0

error

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

SDK示例

Java SDK

DetachL2NetworkFromHostAction action = new DetachL2NetworkFromHostAction();
action.l2NetworkUuid = "65509f36186c339d8fa85fe0b632c61f";
action.hostUuid = "99d5e85e897a317780ed520e3dafdf0c";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachL2NetworkFromHostAction.Result res = action.call();

Python SDK

DetachL2NetworkFromHostAction action = DetachL2NetworkFromHostAction()
action.l2NetworkUuid = "65509f36186c339d8fa85fe0b632c61f"
action.hostUuid = "99d5e85e897a317780ed520e3dafdf0c"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DetachL2NetworkFromHostAction.Result res = action.call()