O'Reilly logo

JUNOS Automation Cookbook by Adam Chappell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Running the example graph

Take the example graph that we proposed at the beginning of the recipe, and use it as a test:

$ cat test.json'{"nodes": ["Ams", "Fra", "Lon", "Par"], "links": [["Ams", "Fra", 10], ["Fra", "Par", 10], ["Par", "Lon", 10], ["Lon", "Ams", 10]]}'

Run the template instantiation Python code on it in order to produce a finalized graph.html file.

$ ./render-graph.py test.json

Use your browser to view the resulting file. Observe that VivaGraph has placed the four nodes from the example graph in the center and has placed links between them and that you can freely interact with the graph, moving nodes about as you please.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required