- play_arrow Disclaimer
- play_arrow Junos PyEZ Overview
- play_arrow Install Junos PyEZ
- play_arrow Connect to and Retrieve Facts From a Device Using Junos PyEZ
- play_arrow Use Junos PyEZ to Manage Device Operations
- Use Junos PyEZ to Execute RPCs on Junos Devices
- Suppress RpcError Exceptions Raised for Warnings in Junos PyEZ Applications
- Use Junos PyEZ to Halt, Reboot, or Shut Down Junos Devices
- Use Junos PyEZ to Install Software on Junos Devices
- Use Junos PyEZ to Perform File System Operations
- Transfer Files Using Junos PyEZ
- Specify the XML Parser for a Junos PyEZ Session
- play_arrow Use Junos PyEZ to Manage the Configuration
- Use Junos PyEZ to Retrieve a Configuration
- Use Junos PyEZ to Compare the Candidate Configuration and a Previously Committed Configuration
- Use Junos PyEZ to Configure Junos Devices
- Use the Junos PyEZ Config Utility to Configure Junos Devices
- Use Junos PyEZ to Commit the Configuration
- Example: Use Junos PyEZ to Load Configuration Data from a File
- Example: Use Junos PyEZ to Roll Back the Configuration
- Use Junos PyEZ to Manage the Rescue Configuration on Junos Devices
- play_arrow Troubleshoot Junos PyEZ
Use Junos PyEZ Operational Tables and Views that Parse Unstructured Output
Junos PyEZ operational (op) Tables for unstructured output extract data from the text output of a CLI command executed on a Junos device or a vty command executed on a given Flexible PIC Concentrator (FPC). After loading or importing the Table definition into your Python module, you can retrieve the Table items and extract and manipulate the data.
To retrieve information from a specific device, you must
create a Table instance and associate it with the Device
object representing the target device. For example:
from jnpr.junos import Device from jnpr.junos.command.ospf_neighbor import OspfNeighborTable with Device(host='router.example.com') as dev: stats = OspfNeighborTable(dev)
To use the Table in your Junos PyEZ application to execute
the command and retrieve the data, call the Table’s get()
method and supply any required or optional parameters.
If the Table defines default arguments, for example, for the args
, filters
, key_items
, or target
parameters,
the get()
method uses these defaults unless
you override them in the argument list.
from jnpr.junos import Device from jnpr.junos.command.ospf_neighbor import OspfNeighborTable from pprint import pprint import json with Device(host='router.example.com') as dev: stats = OspfNeighborTable(dev) stats.get() pprint(json.loads(stats.to_json()))