Network ResourcesDistributed Switch Related Interfaces

QueryL2VirtualSwitchNetwork

GET/zstack/v1/l2-networks/virtual-switch
GET/zstack/v1/l2-networks/virtual-switch/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l2-networks/virtual-switch
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l2-networks/virtual-switch/95f17f8b6b6137e3815cedcfa39d812d

Queryable Fields

Run the CLI command tool, enter QueryL2VirtualSwitchNetwork, and press Tab to view all queryable fields and resource names that support cross-table queries.

API Response

Sample Response

{
  "inventories": [
    {
      "name": "Test-dvs",
      "description": "Test",
      "zoneUuid": "55210de8afc03d42bddc8e098c69410c",
      "physicalInterface": "eth0",
      "type": "virtualSwitch"
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.1.0
inventoriesListSee inventories.4.1.0
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error.4.1.0

inventories

NameTypeDescriptionStarting Version
isDistributedBooleanWhether it is distributed.4.1.0
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
vSwitchTypeStringThe virtual Switch type.4.1.0
virtualNetworkIdIntegerThe virtual network ID.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
portGroupsListSee portGroups.4.1.0

portGroups

NameTypeDescriptionStarting Version
vSwitchUuidStringThe virtual Switch UUID.4.1.0
vlanIdIntegerThe VLAN ID.4.1.0
vlanRangesStringThe VLAN range.4.1.0
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
vSwitchTypeStringThe virtual Switch type.4.1.0
virtualNetworkIdIntegerThe virtual network ID.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
vlanModeL2PortGroupVlanModeSee vlanMode.4.1.0

vlanMode

NameTypeDescriptionStarting Version
ACCESSL2PortGroupVlanMode 4.2.0
TRUNKL2PortGroupVlanMode 4.2.0
PVLANL2PortGroupVlanMode 4.2.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

QueryL2VirtualSwitchNetworkAction action = new QueryL2VirtualSwitchNetworkAction();
action.conditions = asList();
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
QueryL2VirtualSwitchNetworkAction.Result res = action.call();

Python SDK

QueryL2VirtualSwitchNetworkAction action = QueryL2VirtualSwitchNetworkAction()
action.conditions = []
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
QueryL2VirtualSwitchNetworkAction.Result res = action.call()