Versions Compared

Key

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

...

Using curl
Code Block
curl -k -H "Authorization: ApiKey username:api_key" -H "Content-Type: application/json" -X POST --data '{"end_points": [{"equipment": "se-tug.nordu.net", "port":"l2vpn_test_port"}, {"equipment": "se-fre.nordu.net", "port":"l2vpn_test_port"}]}' https://nidev-consumer.nordu.net/api/v1/l2vpn/

Return:
{
    "created": "2012-10-08T14:13:52.711006",
    "creator": "/api/v1/user/1/",
    "description": "",
    "handle_id": 11099,
    "l2vpn_id": 1,
    "modified": "2012-10-08T14:13:52.711090",
    "modifier": "/api/v1/user/1/",
    "node": {
        "description": "",
        "handle_id": 11099,
        "l2vpn_id": 1,
        "name": "NU-S000206",
        "node_type": "Service",
        "operational_state": "Reserved",
        "service_class": "MPLS",
        "service_type": "L2VPN"
    },
    "node_id": 9245,
    "node_meta_type": "logical",
    "node_name": "NU-S000206",
    "node_type": "/api/v1/node_type/service/",
    "operational_state": "Reserved",
    "relationships": [
        "/api/v1/relationship/32129/",
        "/api/v1/relationship/32130/",
        "/api/v1/relationship/32131/"
    ],
    "resource_uri": "/api/v1/l2vpn/NU-S000206/",
    "service_type": "L2VPN"
}

...

Only operational_status and description can be set for L2VPN services until more is needed.

Using curl
Code Block
curl -k -H "Authorization: ApiKey username:api_key" -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-S000206/

Return:
{
    "created": "2012-10-08T14:13:52.711006", 
    "creator": "/api/v1/user/1/", 
    "description": "Test REST API call l2vpn", 
    "handle_id": 11099, 
    "l2vpn_id": 1, 
    "modified": "2012-10-08T14:32:38.686338", 
    "modifier": "/api/v1/user/1/", 
    "node": {
        "description": "Test REST API call l2vpn", 
        "handle_id": 11099, 
        "l2vpn_id": 1, 
        "name": "NU-S000206", 
        "node_type": "Service", 
        "operational_state": "In service", 
        "service_class": "MPLS", 
        "service_type": "L2VPN"
    }, 
    "node_id": 9245, 
    "node_meta_type": "logical", 
    "node_name": "NU-S000206", 
    "node_type": "/api/v1/node_type/service/", 
    "operational_state": "In service", 
    "relationships": [
        "/api/v1/relationship/32129/", 
        "/api/v1/relationship/32130/", 
        "/api/v1/relationship/32131/"
    ], 
    "resource_uri": "/api/v1/l2vpn/NU-S000206/"
}

...