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

How it works…

In step 1, we pull the necessary Python standard library and PyEZ framework definitions into the global namespace so that we can make use of them. Steps 2 through 5 are all very similar to what we’ve seen in previous recipes: setting error handlers, parsing command- line arguments, and opening the PyEZ Device() constructor respectively.

But of particular note, though, in step 1 is the reference to jnpr.junos.op.inventory.ModuleTable, which is, PyEZ-included class that represents a JUNOS device hardware module and is instantiated through a Python factory loader shim from a piece of YAML definition.

YAML is a markup language that is able to define hierarchical datastructures, in a similar way to JSON and XML. It is able to represent ...

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