Versions Compared

Key

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

...

In addition to the search box at the top of the page you can also use the URL field for searching.

Code Block

/findall/[value]/
ex. /findall/10/
/findall/[key]/[value]/
ex. /findall/link/10/
/findin/[node type]/[value]/
ex. /findin/optical-node/10/
/findin/[node type]/[key]/[value]/
ex. /findin/optical-node/link/10/
/getall/[node type]/
ex. /getall/optical-node/

...

Create a new L2VPN service

Using curl
Code Block

curl -k -H "Authorization: ApiKey apiuser:secret" -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": "2013-02-20T16:45:41.228176", 
    "creator": "/api/v1/user/59/", 
    "description": null, 
    "handle_id": 11717, 
    "modified": "2013-02-20T16:45:41.228213", 
    "modifier": "/api/v1/user/59/", 
    "node": {
        "handle_id": 11717, 
        "name": "NU-SXXXXX1", 
        "node_type": "Service", 
        "operational_state": "In service", 
        "service_class": "MPLS", 
        "service_type": "L2VPN"
    }, 
    "node_id": 13707, 
    "node_meta_type": "logical", 
    "node_name": "NU-SXXXXX1", 
    "node_type": "/api/v1/node_type/service/", 
    "object_path": "/service/11717/", 
    "operational_state": "In service", 
    "relationships": [
        "/api/v1/relationship/47575/", 
        "/api/v1/relationship/47576/", 
        "/api/v1/relationship/47577/"
    ], 
    "resource_uri": "/api/v1/l2vpn/11717/", 
    "route_distinguisher": "rd1", 
    "service_type": "L2VPN", 
    "vrf_target": "vt1"
}

Setting L2VPN service attributes

Using curl
Code Block

curl -k -H "Authorization: ApiKey apiuser:secret" -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-SXXXXX1/

Return:
{
    "created": "2013-02-20T16:45:41.228176", 
    "creator": "/api/v1/user/59/", 
    "description": "Test REST API call l2vpn", 
    "handle_id": 11717, 
    "modified": "2013-02-20T16:51:16.077192", 
    "modifier": "/api/v1/user/59/", 
    "node": {
        "description": "Test REST API call l2vpn", 
        "handle_id": 11717, 
        "name": "NU-SXXXXX1", 
        "node_type": "Service", 
        "operational_state": "In service", 
        "service_class": "MPLS", 
        "service_type": "L2VPN"
    }, 
    "node_id": 13707, 
    "node_meta_type": "logical", 
    "node_name": "NU-SXXXXX1", 
    "node_type": "/api/v1/node_type/service/", 
    "object_path": "/service/11717/", 
    "operational_state": "In service", 
    "relationships": [
        "/api/v1/relationship/47577/", 
        "/api/v1/relationship/47576/", 
        "/api/v1/relationship/47575/"
    ], 
    "resource_uri": "/api/v1/l2vpn/11717/", 
    "route_distinguisher": "rt1", 
    "vrf_target": "vrf1"
}

...

You can backup the Postgresql and Neo4j databases using these scripts:

Code Block

# Backup the SQL database
su - postgres -c "pg_dumpall > /opt/nistore/producers/noclook/sql/postgres.sql"
# Run NOCLook producer for backup purpose
cd /opt/norduni/src/scripts/
rm /opt/nistore/producers/noclook/json/*
./noclook_producer.py -O /opt/nistore/producers/noclook/json/
# Push the changes to nistore master
/usr/local/sbin/ni-push.sh -r /opt/nistore/

...

Code Block
titlerestore.conf

# All producers need to be listed here with a path data or empty
[data]
juniper_conf = 
nmap_services = 
alcatel_isis = 
noclook = /opt/nistore/producers/noclook/json/
Code Block

sudo -u postgres psql -f /opt/nistore/producers/noclook/sql/postgres.sql postgres
noclook_consumer.py -C restore.conf -I

When using postgres you have to reset the autoincrementing handle_id property.

Code Block

python manage.py sqlsequencereset noclook

Copy output from the previous command and paste it in the dbshell.

Code Block

python manage.py dbshell

Now everything should be restored and ready to be updated as usual with noclook_consumer.py.

...

Issue tracker: https://project.nordu.net/browse/NORDUNIDEV

Graph Gists

Version 1.0: http://gist.neo4j.org/?e598ce9c6851fd803243
Version 2.0: http://gist.neo4j.org/?fe682b1dc394dd8e4421

Anchor
setup
setup

How to set up a NI suite

...