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

Drawing the graph

The HTML file is defined in template form in graph.html.template. There is actually not much template activity happening here at all. We're simply using the template capability so that we can rapidly substitute different graphs—all in JSON format—into the same HTML/JavaScript logic without much overhead.

After we've defined the usual HTML headings, we create a main() function in which we do all of our work. We start by extracting a possible filtering expression from the URL and making a regular expression from it. This means that the user can append a filter expression to the URL using the query string (?) operator, and we can act upon his wishes to restrict the list of nodes that we view. This is a particularly useful feature ...

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