REST API - list

vcenter network: list

Returns information about at most 1000 visible (subject to permission checks) networks in vCenter matching the vcenter.network.filter_spec.

Request:

HTTP request

GET https://{server}/rest/vcenter/network

?filter.datacenters.1=obj-103
&filter.datacenters.2=obj-103
&filter.types.1=STANDARD_PORTGROUP
&filter.types.2=STANDARD_PORTGROUP
&filter.names.1=string
&filter.names.2=string
&filter.folders.1=obj-103
&filter.folders.2=obj-103
&filter.networks.1=obj-103
&filter.networks.2=obj-103

Request Query Parameters:

Name Type Description
bold = required
filter filter_spec Optional. Specification of matching networks for which information should be returned.
filter.networks string[] Identifiers of networks that can match the filter.

Optional. If unset or empty, networks with any identifier match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Network. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Network.

filter.names string[] Names that networks must have to match the filter (see vcenter.network.summary.name).

Optional. If unset or empty, networks with any name match the filter.

filter.types string[] Types that networks must have to match the filter (see vcenter.network.summary.type).

Optional. If unset, networks with any type match the filter.

filter.folders string[] Folders that must contain the network for the network to match the filter.

Optional. If unset or empty, networks in any folder match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Folder. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Folder.

filter.datacenters string[] Datacenters that must contain the network for the network to match the filter.

Optional. If unset or empty, networks in any datacenter match the filter.When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: Datacenter. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: Datacenter.

Response:

HTTP Status Code: 200

Representation:

{
    "value"[
        {
            "name""string",
            "type""STANDARD_PORTGROUP",
            "network""obj-103"
        },
        {
            "name""string",
            "type""STANDARD_PORTGROUP",
            "network""obj-103"
        }
    ]
}

Response Type:

Name Type Description
bold = required
value summary[] Commonly used information about the networks matching the vcenter.network.filter_spec.
value[].network string Identifier of the network.

When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: Network. When operations return a value of this structure as a result, the field will be an identifier for the resource type: Network.

value[].name string Name of the network.

value[].type string Type (STANDARD_PORTGROUP, DISTRIBUTED_PORTGROUP, OPAQUE_NETWORK) of the vCenter Server network.

Defines the type of a vCenter Server network. The type of a network can be used to determine what features it supports and which APIs can be used to find more information about the network or change its configuration. Value is one of:
STANDARD_PORTGROUP: vSphere standard portgroup (created and managed on ESX)
DISTRIBUTED_PORTGROUP: Distributed virtual portgroup (created and managed through vCenter)
OPAQUE_NETWORK: A network whose configuration is managed outside of vSphere. The identifer and name of the network is made available through vSphere so that host and virtual machine virtual ethernet devices can connect to them.

Errors:

HTTP Status Code Type Description
400 invalid_argument if the vcenter.network.filter_spec.types field contains a value that is not supported by the server.
500 unable_to_allocate_resource if more than 1000 networks match the vcenter.network.filter_spec.
503 service_unavailable if the system is unable to communicate with a service to complete the request.
401 unauthenticated if the user can not be authenticated.
403 unauthorized if the user doesn't have the required privileges.