Network ResourcesDistributed Switch Related Interfaces

DetachL2NetworkFromHost

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

Headers

Authorization: OAuth the-session-uuid

Curl Sample

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

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
l2NetworkUuidStringurlThe port group Distributed Switch UUID. 4.1.0
hostUuidStringurlThe host UUID. 4.1.0
systemTags (Optional)ListbodyOptional. The system tags. 4.1.0
userTags (Optional)ListbodyOptional. The user tags. 4.1.0

API Response

Sample Response

{
  "inventory": {
    "vlan": 10,
    "name": "Test-Net",
    "description": "Test",
    "zoneUuid": "5b03d97878c536a6bedfb1ac1931ef2c",
    "physicalInterface": "eth0",
    "type": "L2VlanNetwork"
  }
}
NameTypeDescriptionStarting Version
successboolean 4.1.0
inventoryL2NetworkInventorySee inventory.4.1.0
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error.4.1.0

inventory

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.4.1.0
nameStringThe resource name.4.1.0
descriptionStringThe detailed description of the resource.4.1.0
zoneUuidStringThe Data Center UUID.4.1.0
physicalInterfaceStringThe physical NIC.4.1.0
typeStringThe Distributed Switch type.4.1.0
createDateTimestampThe creation date.4.1.0
lastOpDateTimestampThe last operation date.4.1.0
attachedClusterUuidsListThe list of attached Cluster UUIDs.4.1.0

error

NameTypeDescriptionStarting Version
codeStringThe error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.4.1.0
descriptionStringThe brief description of the error.4.1.0
detailsStringThe details about the error.4.1.0
elaborationStringThe reserved field. Default value: null.4.1.0
opaqueLinkedHashMapThe reserved field. Default value: null.4.1.0
causeErrorCodeThe root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.4.1.0

SDK Sample

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()