Network ResourcesDistributed Port Group Related Interfaces

QueryPortGroup

GET/zstack/v1/l3-networks/port-group
GET/zstack/v1/l3-networks/port-group/{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/l3-networks/port-group
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/l3-networks/port-group/c94adc28385a31d99a2c07dfa8120532

Queryable Fields

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

API Response

Sample Response

{
  "inventories": [
    {
      "vSwitchUuid": "5343e94b3aa93086b81c1b33c335b9ad",
      "vlanMode": "ACCESS",
      "vlanId": 100,
      "uuid": "01a9693135323cf1acb3049e8ddf50b2",
      "name": "port-group-1",
      "description": "Test",
      "type": "portGroup",
      "zoneUuid": "36712d24b27b327aae544095c768366b",
      "l2NetworkUuid": "49012f786210301697167b3771a65e8c",
      "state": "Enabled",
      "system": false,
      "category": "Private",
      "enableIPAM": false
    }
  ]
}
NameTypeDescriptionStarting Version
successboolean 4.2.0
errorErrorCodeThe error code. If not null, the operation fails, or vice versa. For more information, see error.0.6
inventoriesListSee inventories.0.6

error

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

inventories

NameTypeDescriptionStarting Version
vSwitchUuidStringThe virtual Switch UUID.4.2.0
vlanIdIntegerThe VLAN number.4.2.0
vlanRangesStringThe VLAN range.4.2.0
uuidStringThe resource UUID.4.2.0
nameStringThe resource name.4.2.0
descriptionStringThe detailed description of the resource.4.2.0
typeStringThe port group type.4.2.0
zoneUuidStringThe Data Center UUID.4.2.0
l2NetworkUuidStringThe port group Distributed Switch UUID.4.2.0
stateStringThe status.4.2.0
dnsDomainStringThe DNS domain.4.2.0
systemBooleanWhether it is used for system VMs.4.2.0
categoryStringThe network type. This parameter must be used with the system tag. When system is true, you can set it to Public, Private, or System.4.2.0
ipVersionIntegerThe IP version.4.2.0
enableIPAMBooleanWhether IP address management is enabled.4.2.0
createDateTimestampThe creation date.4.2.0
lastOpDateTimestampThe last operation date.4.2.0
dnsList 4.2.0
vlanModePortGroupVlanModeSee vlanMode.4.2.0
ipRangesListSee ipRanges.0.6
networkServicesListSee networkServices.0.6
hostRouteListSee hostRoute.2.3

vlanMode

NameTypeDescriptionStarting Version
ACCESSPortGroupVlanMode 4.2.0
TRUNKPortGroupVlanMode 4.2.0
PVLANPortGroupVlanMode 4.2.0

ipRanges

NameTypeDescriptionStarting Version
uuidStringThe resource UUID.0.6
l3NetworkUuidStringThe Distributed Port Group UUID.0.6
nameStringThe resource name.0.6
descriptionStringThe detailed description of the resource.0.6
startIpStringThe start IP address.0.6
endIpStringThe end IP address.0.6
netmaskStringThe netmask.0.6
prefixLenStringThe prefix length.3.1.0
gatewayStringThe gateway.0.6
networkCidrStringThe network CIDR.0.6
ipVersionIntegerThe IP version.3.1.0
addressModeStringThe IPv6 address allocation mode.3.1.0
createDateTimestampThe creation date.0.6
lastOpDateTimestampThe last operation date.0.6
ipRangeTypeIpRangeTypeSee ipRangeType.3.9

ipRangeType

NameTypeDescriptionStarting Version
NormalIpRangeTypeNormal address range.3.9
AddressPoolIpRangeTypeAddress pool range.3.9

networkServices

NameTypeDescriptionStarting Version
l3NetworkUuidStringThe Distributed Port Group UUID.0.6
networkServiceProviderUuidStringThe network service provider module UUID.0.6
networkServiceTypeString 0.6

hostRoute

NameTypeDescriptionStarting Version
idLong 2.3
l3NetworkUuidStringThe Distributed Port Group UUID.2.3
prefixString 2.3
nexthopString 2.3
createDateTimestampThe creation date.2.3
lastOpDateTimestampThe last operation date.2.3

SDK Sample

Java SDK

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

Python SDK

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