NSX Autonomous Edge REST API

Create an L2VPN session from Peer Code

Create an L2VPN session from Peer Code.
In addition to the L2VPN Session, the IPSec VPN Session, along
with the IKE, Tunnel, and DPD Profiles are created and owned by
the system. Local Endpoint are created only when required, i.e.,
an IPSec VPN Local Endpoint with same local address does not
already exist.
API supported only when L2VPN Service is in Client Mode.

Request:

Method:
POST
URI Path(s):
/vpn/l2vpn/sessions?action=create_with_peer_code
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
L2VPNSession+

Example Request:

{ "description": "L2Vpn session", "display_name": "L2Vpn session", "transport_tunnels": [ { "peer_code": "MCwwYTMyNWE4LHsic2l0ZU5hbWUiOiJJUFNlY1ZQTl9Sb3V0ZUJhc2VzZFNlc3Npb25fMDAxIiwic3JjVGFwSXAiOiIx NjkuMjU0LjY0LjIiLCJkc3RUYXBJcCI6IjE2OS4yNTQuNjQuMSIsImlrZU9wdGlvbiI6ImlrZXYyIiwiZW5jYXBQcm90 byI6ImdyZS9pcHNlYyIsImRoR3JvdXAiOiJkaDE0IiwiZW5jcnlwdEFuZERpZ2VzdCI6ImFlcy1nY20vc2hhLTI1NiIs InBzayI6InBhbmthaiIsInR1bm5lbHMiOlt7ImxvY2FsSWQiOiIxLjEuNS4xMDAiLCJwZWVySWQiOiIxOTIuMTY4LjEy OC4xIiwibG9jYWxWdGlJcCI6IjE5Mi4xNjguMS4yLzI0In1dfQ==", "peer_address": "10.10.10.10", "local_address": "20.20.20.20" } ] }

Successful Response:

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

Example Response:

{ "resource_type": "L2VPNSession", "description": "L2vpn session", "id": "a4181e5c-5532-4498-af88-1c09a452a0b6", "display_name": "L2Vpn session", "transport_tunnels": [ { "peer_address": "10.10.10.10", "local_address": "20.20.20.20", "ipsec_session_id": "07829375-9aa8-4f82-9cb7-3c028bf81ca3" } ] "enabled": true }

Required Permissions:

crud

Feature:

vpn

Additional Errors: