Management Plane API > Networking > Logical Switching

Associated URIs:

API Description API Path

List All Logical Ports


Returns information about all configured logical switch ports. Logical
switch ports connect to VM virtual network interface cards (NICs). Each
logical port is associated with one logical switch.
GET /api/v1/logical-ports

Create a Logical Port


Creates a new logical switch port. The required parameters are the
associated logical_switch_id and admin_state (UP or DOWN). Optional
parameters are the attachment and switching_profile_ids. If you don't
specify switching_profile_ids, default switching profiles are assigned to
the port. If you don't specify an attachment, the switch port remains
empty. To configure an attachment, you must specify an id, and
optionally you can specify an attachment_type (VIF or LOGICALROUTER).
The attachment_type is VIF by default.
POST /api/v1/logical-ports

Delete a Logical Port


Deletes the specified logical switch port. By default, if logical port has
attachments, or it is added to any NSGroup, the deletion will be failed.
Option detach could be used for deleting logical port forcibly.
DELETE /api/v1/logical-ports/<lport-id>

Get Information About a Logical Port


Returns information about a specified logical port.
GET /api/v1/logical-ports/<lport-id>

Update a Logical Port


Modifies an existing logical switch port. Parameters that can be modified
include attachment_type (LOGICALROUTER, VIF), admin_state (UP or DOWN),
attachment id and switching_profile_ids. You cannot modify the logical_switch_id.
In other words, you cannot move an existing port from one switch to another switch.
PUT /api/v1/logical-ports/<lport-id>

Get MAC table of a logical port with a given port id (lport-id)


Returns MAC table of a specified logical port. If the target transport node id is not provided,
the NSX manager will ask the controller for the transport node where the logical port is located.
The query parameter "source=cached" is not supported. MAC table retrieval is not supported on
logical ports that are attached to a logical router.
GET /api/v1/logical-ports/<lport-id>/mac-table

Get MAC table of a logical port with a given port id (lport-id)


Returns MAC table in CSV format of a specified logical port. If the target transport node id is not provided,
the NSX manager will ask the controller for the transport node where the logical port is located.
The query parameter "source=cached" is not supported. MAC table retrieval is not supported on
logical ports that are attached to a logical router.
GET /api/v1/logical-ports/<lport-id>/mac-table?format=csv

Get realized state & location of a logical port


Returns transport node id for a specified logical port. Also returns
information about all address bindings of the specified logical port. This
includes address bindings discovered via various snooping methods like ARP
snooping, DHCP snooping etc. and addressing bindings that are realized
based on user configuration.
GET /api/v1/logical-ports/<lport-id>/state

Get Statistics for Logical Port of a Given Port ID (lport-id)


Returns statistics of a specified logical port. If the logical port is attached to
a logical router port, query parameter "source=realtime" is not supported.
GET /api/v1/logical-ports/<lport-id>/statistics

Get Operational Status for Logical Port of a Given Port ID (lport-id)


Returns operational status of a specified logical port.
GET /api/v1/logical-ports/<lport-id>/status

Get Operational Status Summary of All Logical Ports in the System


Returns operational status of all logical ports.
The query parameter "source=realtime" is not supported.
Pagination is not supported for this API.
The query parameters "cursor", "sort_ascending", "sort_by", "page_size" and "included_fields"
will be ignored.
GET /api/v1/logical-ports/status

List all Logical Switches


Returns information about all configured logical switches.
GET /api/v1/logical-switches

Create a Logical Switch


Creates a new logical switch. The request must include the
transport_zone_id, display_name, and admin_state (UP or DOWN). The
replication_mode (MTEP or SOURCE) is required for overlay logical
switches, but not for VLAN-based logical switches. A vlan needs to be
provided for VLAN-based logical switches
POST /api/v1/logical-switches

Get L2 forwarder remote mac addresses


Returns remote mac addresses of the l2 forwarder on logical switch.
It always returns realtime response.
GET /api/v1/logical-switches/<logical-switch-id>/inter-site-forwarder/site-span-info (Experimental)

Get L2 forwarder statistics


Returns statistics of the l2 forwarder on logical switch.
It always returns realtime response.
GET /api/v1/logical-switches/<logical-switch-id>/inter-site-forwarder/statistics (Experimental)

Get L2 forwarder status


Returns status per transport node of the l2 forwarder on logical switch.
GET /api/v1/logical-switches/<logical-switch-id>/inter-site-forwarder/status (Experimental)

Delete a Logical Switch


Removes a logical switch from the associated overlay or VLAN transport
zone. By default, a logical switch cannot be deleted if there are logical
ports on the switch, or it is added to a NSGroup.
Cascade option can be used to delete all ports and the logical switch.
Detach option can be used to delete the logical switch forcibly.
DELETE /api/v1/logical-switches/<lswitch-id>

Get Logical Switch associated with the provided id (lswitch-id)


Returns information about the specified logical switch Id.
GET /api/v1/logical-switches/<lswitch-id>

Update a Logical Switch


Modifies attributes of an existing logical switch. Modifiable
attributes include admin_state, replication_mode, switching_profile_ids
and VLAN spec. You cannot modify the original transport_zone_id.
PUT /api/v1/logical-switches/<lswitch-id>

Get MAC Table for Logical Switch of the Given ID (lswitch-id)


Returns MAC table of a specified logical switch from the given transport
node if a transport node id is given in the query parameter from the
Central Controller Plane.
The query parameter "source=cached" is not supported.
GET /api/v1/logical-switches/<lswitch-id>/mac-table

Get MAC Table for Logical Switch of the Given ID (lswitch-id)


Returns MAC table of a specified logical switch in CSV format from the given transport
node if a transport node id is given in the query parameter from the
Central Controller Plane.
The query parameter "source=cached" is not supported.
GET /api/v1/logical-switches/<lswitch-id>/mac-table?format=csv

Get the realized state associated with provided logical switch id


Returns current state of the logical switch configuration and details of only
out-of-sync transport nodes.
GET /api/v1/logical-switches/<lswitch-id>/state

Get Statistics for Logical Switch of the Given ID (lswitch-id)


Returns statistics of a specified logical switch.
The query parameter "source=realtime" is not supported.
GET /api/v1/logical-switches/<lswitch-id>/statistics

Get Logical Switch runtime status info for a given logical switch


Returns the number of ports assigned to a logical switch.
GET /api/v1/logical-switches/<lswitch-id>/summary

Get virtual tunnel endpoint table for logical switch of the given ID (lswitch-id)


Returns the virtual tunnel endpoint table of a specified logical switch
from the given transport node if a transport node id is given in the
query parameter, from the Central Controller Plane.
The query parameter "source=cached" is not supported.
GET /api/v1/logical-switches/<lswitch-id>/vtep-table

Get virtual tunnel endpoint table for logical switch of the given ID (lswitch-id)


Returns virtual tunnel endpoint table of a specified logical switch in
CSV format from the given transport node if a transport node id is
given in the query parameter from the Central Controller Plane.
The query parameter "source=cached" is not supported.
GET /api/v1/logical-switches/<lswitch-id>/vtep-table?format=csv

List logical switches by realized state


Returns a list of logical switches states that have realized state as provided
as query parameter.
GET /api/v1/logical-switches/state

Get Status Summary of All Logical Switches in the System


Returns Operational status of all logical switches.
The query parameter "source=realtime" is not supported.
GET /api/v1/logical-switches/status

List Switching Profiles


Returns information about the system-default and user-configured switching
profiles. Each switching profile has a unique ID, a display name, and
various other read-only and configurable properties. The default switching
profiles are assigned automatically to each switch.
GET /api/v1/switching-profiles

Create a Switching Profile


Creates a new, custom qos, port-mirroring, spoof-guard or port-security
switching profile. You can override their default switching profile assignments
by creating a new switching profile and assigning it to one or more logical
switches. You cannot override the default ipfix or ip_discovery switching profiles.
POST /api/v1/switching-profiles

Delete a Switching Profile


Deletes the specified switching profile.
DELETE /api/v1/switching-profiles/<switching-profile-id>

Get Switching Profile by ID


Returns information about a specified switching profile.
GET /api/v1/switching-profiles/<switching-profile-id>

Update a Switching Profile


Updates the user-configurable parameters of a switching profile. Only the qos,
port-mirroring, spoof-guard and port-security switching profiles can be modified.
You cannot modify the ipfix or ip-discovery switching profiles.
PUT /api/v1/switching-profiles/<switching-profile-id>

Get Counts of Ports and Switches Using This Switching Profile


GET /api/v1/switching-profiles/<switching-profile-id>/summary