NSX-T Data Center REST API

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.
This api is now deprecated. Please use new api -
/infra/segments/<segment-id>/ports
GET /api/v1/logical-ports (Deprecated)

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. This api is now deprecated. Please use new api -
PUT /infra/segments/<segment-id>/ports/<port-id>
POST /api/v1/logical-ports (Deprecated)

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. This api is now deprecated.
Please use new api - DELETE /infra/segments/<segment-id>/ports/<port-id>
DELETE /api/v1/logical-ports/<lport-id> (Deprecated)

Get Information About a Logical Port


Returns information about a specified logical port. in impactor-ufo branch. Please use corresponding policy API /infra/segments/<segment-id>/ports/<lport-id>
GET /api/v1/logical-ports/<lport-id> (Deprecated)

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.
This api is now deprecated.
Please use new api - /infra/segments/<segment-id>/ports/<port-id>
PUT /api/v1/logical-ports/<lport-id> (Deprecated)

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. This api is now deprecated. Please use new api -
GET policy/api/v1/infra/realized-state/realized-entities?intent_path={{intent-path}}
GET policy/api/v1/infra/realized-state/status?intent_path={{intent-path}}
GET /api/v1/logical-ports/<lport-id>/state (Deprecated)

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 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. This api is now deprecated.
Please use new api - for QOS profile, please use - /infra/qos-profiles
GET /api/v1/switching-profiles (Deprecated)

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.
This api is now deprecated. Please use new api -
For eg. for QOS profile, please use - PUT /infra/qos-profiles/<qos-profile-id>
POST /api/v1/switching-profiles (Deprecated)

Delete a Switching Profile


Deletes the specified switching profile. This api is now deprecated. Use new api - for QOS profile, please use - DELETE /infra/qos-profiles/<qos-profile-id>
DELETE /api/v1/switching-profiles/<switching-profile-id> (Deprecated)

Get Switching Profile by ID


Returns information about a specified switching profile. This api is now deprecated. Please use new api - for QOS profile, please use - /infra/qos-profiles/<qos-profile-id>
GET /api/v1/switching-profiles/<switching-profile-id> (Deprecated)

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. This api is now deprecated.
Use new api, for eg., QOS profile - PATCH /infra/qos-profiles/<qos-profile-id>
PUT /api/v1/switching-profiles/<switching-profile-id> (Deprecated)

Get Counts of Ports and Switches Using This Switching Profile


This api is now deprecated. Please use new api - GET policy/api/v1/infra/realized-state/status?intent_path={{intent-path}}
GET /api/v1/switching-profiles/<switching-profile-id>/summary (Deprecated)