Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
curl -k -H "Authorization: ApiKey usernameapiuser:api_keysecret" -H "Content-Type: application/json" -X POST --data '{"node_name": "NU-SXXXXX1", "operational_state": "In service", "route_distinguisher": "rd1", "vrf_target": "vt1", "end_points": [{"device": "se-tug.nordu.net", "port":"l2vpn_test_port"}, {"device": "se-fre.nordu.net", "port":"l2vpn_test_port"}]}' https://nidev-consumer.nordu.net/api/v1/l2vpn/

Return:
{
    "created": "20122013-1002-08T1420T16:1345:5241.711006228176", 
    "creator": "/api/v1/user/159/", 
    "description": ""null, 
    "handle_id": 1109911717,
    "l2vpn_id": 1,
    "modified": "20122013-1002-08T1420T16:1345:5241.711090228213", 
    "modifier": "/api/v1/user/159/", 
    "node": {
        "description": "",
        "handle_id": 1109911717,
        "l2vpn_id": 1,
        "name": "NU-S000206SXXXXX1", 
        "node_type": "Service", 
        "operational_state": "ReservedIn service", 
        "service_class": "MPLS", 
        "service_type": "L2VPN"
    }, 
    "node_id": 924513707, 
    "node_meta_type": "logical", 
    "node_name": "NU-S000206SXXXXX1", 
    "node_type": "/api/v1/node_type/service/", 
    "object_path": "/service/11717/", 
    "operational_state": "ReservedIn service", 
    "relationships": [
        "/api/v1/relationship/3212947575/", 
        "/api/v1/relationship/3213047576/", 
        "/api/v1/relationship/3213147577/"
    ], 
    "resource_uri": "/api/v1/l2vpn/NU-S000206/",11717/", 
    "route_distinguisher": "rd1", 
    "service_type": "L2VPN", 
    "vrf_target": "vt1"
}

l2vpn_id is unique for L2VPNs and should be used as base for route distinguisher and vrf target.

Setting L2VPN service attributes

...

Using curl
Code Block
curl -k -H "Authorization: ApiKey usernameapiuser:api_keysecret" -H "Content-Type: application/json" -X PUT --data '{"operational_state": "In service", "description": "Test REST API call l2vpn"}' https://nidev-consumer.nordu.net/api/v1/l2vpn/NU-S000206SXXXXX1/

Return:
{
    "created": "20122013-1002-08T1420T16:1345:5241.711006228176", 
    "creator": "/api/v1/user/159/", 
    "description": "Test REST API call l2vpn", 
    "handle_id": 11099, 
    "l2vpn_id": 111717, 
    "modified": "20122013-1002-08T1420T16:3251:3816.686338077192", 
    "modifier": "/api/v1/user/159/", 
    "node": {
        "description": "Test REST API call l2vpn", 
        "handle_id": 1109911717, 
        "l2vpn_id": 1, 
        "name": "NU-S000206SXXXXX1", 
        "node_type": "Service", 
        "operational_state": "In service", 
        "service_class": "MPLS", 
        "service_type": "L2VPN"
    }, 
    "node_id": 924513707, 
    "node_meta_type": "logical", 
    "node_name": "NU-S000206SXXXXX1", 
    "node_type": "/api/v1/node_type/service/", 
    "object_path": "/service/11717/", 
    "operational_state": "In service", 
    "relationships": [
        "/api/v1/relationship/3212947577/", 
        "/api/v1/relationship/3213047576/", 
        "/api/v1/relationship/3213147575/"
    ], 
    "resource_uri": "/api/v1/l2vpn/NU-S000206/11717/", 
    "route_distinguisher": "rt1", 
    "vrf_target": "vrf1"
}

Anchor
backuprestore
backuprestore

...