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

There’s more

In this recipe, we called the load() method of the Config object in order to submit the configuration as a plain string. We can also use the load() method with the named parameter path=“filename” in order to have PyEZ directly read the configuration from a file on disk.

We used the named parameter, format=“set”, to tell PyEZ the format in which the configuration should be expected. It is also possible to supply configuration to JUNOS through PyEZ in one of the alternate formats.

Format parameter

Description

Default file extension

format=“set”

Plain-text set/delete instructions

.set

format=“text”

Plain-text hierarchical braced configuration (as seen in the show configuration)

.conf, .txt

format=“xml” ...

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