REST API - list

vcenter network distributed switches: list

Returns information about at most 1000 visible (subject to permission checks) vSphere distributed switches in vCenter matching the vcenter.network.distributed_switches.filter_spec. Warning: This operation is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Request:

HTTP request

GET https://{server}/rest/vcenter/network/distributed-switches

?filter.min_version=string
&filter.connected_to_all_hosts=true
&filter.min_mtu=1
&filter.clusters.1=obj-103
&filter.clusters.2=obj-103

Request Query Parameters:

Name Type Description
bold = required
filter filter_spec Optional. Specification of matching vSphere distributed switches for which information should be returned.
filter.min_version string Minimum version that the vSphere distributed switches must have to match the filter. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Optional. If unset or empty, vSphere distributed switches with any version match the filter.

filter.min_mtu long Minimum size of the Maximum Transmission Unit (MTU) that this vSphere distributed switch must permit for its network traffic, to match the filter. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Optional. If unset, vSphere distributed switches with any MTU size match the filter.

filter.clusters string[] Clusters that must contain host(s) connected to a vSphere distributed switch for it to match the filter. For each cluster provided, the value of vcenter.network.distributed_switches.filter_spec.connected_to_all_hosts is used to control whether any or all hosts in it must be connected to the vSphere distributed switch for the vSphere distributed switch to match the filter. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

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

filter.connected_to_all_hosts boolean Flag to alter the filtering behavior among clustered hosts. If false, a vSphere distributed switch will match a cluster if any hosts in the cluster are connected to it. If true, a vSphere distributed switch will only match a cluster if all hosts in the cluster are connected to it (see vcenter.network.distributed_switches.filter_spec.clusters). Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Optional. If unset, a vSphere distributed switch will match a cluster if any hosts in the cluster are connected to it.

Response:

HTTP Status Code: 200

Representation:

{
    "value"[
        {
            "name""string",
            "distributed_switch""obj-103",
            "uuid""string",
            "version""string"
        },
        {
            "name""string",
            "distributed_switch""obj-103",
            "uuid""string",
            "version""string"
        }
    ]
}

Response Type:

Name Type Description
bold = required
value summary[] Commonly used information about the vSphere distributed switches matching the vcenter.network.distributed_switches.filter_spec.
value[].distributed_switch string Identifier of the vSphere Distributed Switch (VDS). Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

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

value[].name string Name of the vSphere Distributed Switch. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

value[].uuid string UUID of the vSphere Distributed Switch. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

value[].version string The implementation version of the vSphere Distributed Switch. Warning: This attribute is part of a new feature in development. It may be changed at any time and may not have all supported functionality implemented.

Errors:

HTTP Status Code Type Description
400 invalid_argument if the vcenter.network.distributed_switches.filter_spec.clusters field contains a value that is not a cluster in the inventory, the vcenter.network.distributed_switches.filter_spec.min_mtu field is negative, or the vcenter.network.distributed_switches.filter_spec.min_version field is incorrectly formed.
500 unable_to_allocate_resource if more than 1000 vSphere distributed switches match the vcenter.network.distributed_switches.filter_spec.
401 unauthenticated if the user can not be authenticated.
403 unauthorized if the user doesn't have the required privileges.