Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    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 documentation at http://junos-pyez.readthedocs.org/.

    Table 1: Junos PyEZ Modules

    jnpr.junos Modules

    Description

    device

    Defines the Device class, which represents the device running Junos OS and enables you to connect to and retrieve facts from the device.

    exception

    Defines exceptions encountered when accessing, configuring, and managing devices running Junos OS.

    factory

    Contains code pertaining to Tables and Views, including the loadyaml() method, which is used to load custom Tables and Views.

    op

    Includes predefined operational Tables and Views that can be used to filter output for common operational commands.

    resources

    Includes predefined configuration Tables and Views representing specific configuration resources, which can be used to programmatically configure devices running Junos OS.

    transport

    Contains code used by the Device class to support different connection types such as telnet and serial console connections.

    utils

    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 a NETCONF session over SSH. All connection methods support retrieving device facts, performing operations, and executing RPCs on demand. Support for serial console connections and for telnet 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.

    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 op, resources, and factory modules pertain to Tables and Views. The op module contains predefined operational Tables and Views that can be used to extract specific information from the output of common operational commands 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.

    Modified: 2017-08-29