Junos PyEZ Modules Overview
Junos PyEZ is a microframework for Python that enables you to
manage and automate devices running Junos OS. Junos PyEZ consists
of the jnpr.junos
package, which contains
modules that handle device connectivity and provide operational and
configuration utilities.
Table 1 outlines the primary Junos PyEZ modules that are used to manage devices running Junos OS. For detailed information about each module, see the Junos PyEZ API Reference at http://junos-pyez.readthedocs.org/.
Table 1: Junos PyEZ Modules
jnpr.junos Modules | Description |
---|---|
| Defines the |
| Includes predefined operational Tables and Views that can be used to filter unstructured output returned from CLI and vty commands and convert it to JSON. |
| Defines exceptions encountered when accessing, configuring, and managing devices running Junos OS. |
| Contains code pertaining to Tables and Views, including
the |
| A dictionary-like object of read-only facts about the
device. These facts are accessed using the |
| Includes predefined operational Tables and Views that can be used to filter structured output returned from RPCs. |
| Includes predefined configuration Tables and Views representing specific configuration resources, which can be used to programmatically configure devices running Junos OS. |
| Contains code used by the |
| Includes configuration utilities, file system utilities, shell utilities, software installation utilities, and secure copy utilities. |
In Junos PyEZ, each device is modeled as an instance of the jnpr.junos.device.Device
class. The device
module provides access to devices running Junos OS through a serial
console connection, telnet, or SSH and also supports connecting to
the device through a telnet or SSH connection to a console server
that is connected to the device’s CONSOLE port. All
connection methods support retrieving device facts, performing operations,
and executing RPCs on demand. Support for serial console connections
and for telnet and SSH connections through a console server enables
you to connect to and initially configure new or zeroized devices
that are not yet configured for remote access. Facts about the device
are accessed using the facts
attribute
of the Device
object instance.
The utils
module defines submodules
and classes that handle software installation, file system and copy
operations, and configuration management. The exception
module defines exceptions encountered when managing devices running
Junos OS.
The command
, op
, resources
, and factory
modules pertain to Tables and Views. The command
and op
modules contain predefined operational
Tables and Views that can be used to extract specific information
from the output of common operational commands and RPCs on devices
running Junos OS. The resources
module
contains predefined configuration Tables and Views that can be used
to configure specific resources on devices running Junos OS. The factory
module contains methods that enable you to
load your own custom Tables and Views in Junos PyEZ applications.