Management Plane API > Networking > Logical Switching > 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

Request:

Method:
POST
URI Path(s):
/api/v1/logical-switches
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
LogicalSwitch+

Example Request:

POST https://<nsx-mgr>/api/v1/logical-switches { "transport_zone_id":"cfaec4c7-45c2-439b-b7c6-2c3aeabd9976", "replication_mode": "MTEP", "admin_state":"UP", "display_name":"test-logical-switch", "hybrid": true }

Successful Response:

Response Code:
201 Created
Response Headers:
Content-type: application/json
Response Body:
LogicalSwitch+

Example Response:

{ "id": "92225022-a786-4c7d-91d1-1f9afa6deebe", "display_name": "test-logical-switch", "resource_type": "LogicalSwitch", "address_bindings": [], "transport_zone_id": "cfaec4c7-45c2-439b-b7c6-2c3aeabd9976", "replication_mode": "MTEP", "admin_state": "UP", "vni": 56200, "hybrid": true, "switching_profile_ids": [ { "value": "64814784-7896-3901-9741-badeff705639", "key": "IpDiscoverySwitchingProfile" }, { "value": "fad98876-d7ff-11e4-b9d6-1681e6b88ec1", "key": "SpoofGuardSwitchingProfile" }, { "value": "93b4b7e8-f116-415d-a50c-3364611b5d09", "key": "PortMirroringSwitchingProfile" }, { "value": "fbc4fb17-83d9-4b53-a286-ccdf04301888", "key": "SwitchSecuritySwitchingProfile" }, { "value": "f313290b-eba8-4262-bd93-fab5026e9495", "key": "QosSwitchingProfile" } ], "_last_modified_user": "admin", "_last_modified_time": 1435285527986, "_create_time": 1435285527986, "_create_user": "admin", "_revision": 0, "_schema": "/v1/schema/LogicalSwitch" }

Required Permissions:

crud

Feature:

switching_switches

Additional Errors: