Policy > Networking > Network Services > VPN > L2VPN > Sessions

Create or patch an L2VPN session under Tier-1 from Peer Codes (Deprecated)

Create or patch an L2VPN session under Tier-1 from Peer Codes.
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. IPSec VPN Service and Local Endpoint are created only
when required, i.e., an IPSec VPN Service does not already exist,
or an IPSec VPN Local Endpoint with same local address does not
already exist.
Updating the L2VPN Session can be performed only through this API
by specifying new peer codes. Use of specific APIs to update the
L2VPN Session and the different resources associated with it is
not allowed, except for IPSec VPN Service and Local Endpoint,
resources that are not system owned.
API supported only when L2VPN Service is in Client Mode.
This API is only available when using VMware NSX. Deprecated: This API is deprecated. Please use POST /infra/tier-1s/<tier-1-id>/l2vpn-services/<service-id>/sessions/<session-id>?action=create_with_peer_code instead. Note: Please note that request is validated and any error messages returned from validation may include the new VPN path instead of the deprecated path. Both new path and old path refer to same resource. Also VPN path returned in the Alarm, GPRR payload may include the new VPN path.

Request:

Method:
POST
URI Path(s):
/policy/api/v1/infra/tier-1s/{tier-1-id}/locale-services/{locale-service-id}/l2vpn-services/{service-id}/sessions/{session-id}?action=create_with_peer_code
Request Headers:
n/a
Query Parameters:
n/a
Request Body:
L2VPNSessionData+

Example Request:

POST https://<policy-mgr>/policy/api/v1/infra/tier-1s/cgw/locale-services/default/l2vpn-services/default/sessions/stretched-pa-site?action=create_with_peer_codes { "description": "Stretched Palo Alto Site", "display_name": "stretched-pa-site", "transport_tunnels": [ { "peer_code": "MCw0YTc2YTNlLHsic2l0ZU5hbWUiOiJwb2xpY3ktc2Vzc2lvbi1QUk9WSURFUi5obWl6YS5wYS1wdW5lLXJiLXZwbiIs InNyY1RhcElwIjoiMTY5LjI1NC42NC4yIiwiZHN0VGFwSXAiOiIxNjkuMjU0LjY0LjEiLCJpa2VPcHRpb24iOiJpa2V2 MiIsImVuY2FwUHJvdG8iOiJncmUvaXBzZWMiLCJkaEdyb3VwIjoiZGgxNCIsImVuY3J5cHRBbmREaWdlc3QiOiJhZXMt Z2NtL3NoYS0yNTYiLCJwc2siOiJkZWZhdWx0IiwidHVubmVscyI6W3sibG9jYWxJZCI6IjI0LjI0LjI0LjI0IiwicGVl cklkIjoiMTEuMTEuMTEuMTEifV19", "peer_address": "10.10.10.10", "local_address": "20.20.20.20" } ] }

Successful Response:

Response Code:
200 OK
Response Headers:
n/a
Response Body:
n/a

Required Permissions:

crud

Feature:

policy_vpn

Additional Errors: