nxpy: Network XML Python Proxy
Project description
nxpy: Network XML Python Proxy
nxpy
maps exported XML configuration (from Juniper network devices) to python
classes. It is compatible only with Junipers' xml configuration and is developed
to work alongside ncclient.
nxpy allows for retrieving the device configuration in xml format (using either netconf or "show configuration | display xml" via an expect script), transform the configuration to python classes in order to manipulate them (view, edit, delete). After editing, the configuration can be applied back to the device via netconf or cli expect.
Furthermore, it allows for building configuration via python classes, and apply it to the device(s) via netconf or cli expect. For the time, it supports limited configuration changes.
Installing
Requirements:
- Python 2.6 <= version < 3.0
- lxml (tested with 2.2.6)
To install:
python setup.py install
Examples
- Grab the configuration in xml format
Let's say that you have grabbed your Juniper device configuration in xml format (This is STRICT!!!). You can use either "show configuration | display xml" (and copy paste the output to a file), or use an automated cli excpect script or invoke netconf. nxpy is developed as a companion to ncclient.
- Feed the configuration to nxpy
import nxpy as np
conf = np.Parser(<configuration_file_OR_configuration_text>)
conf = conf.export()
To check if it worked:
conf.interfaces
(...you should get the list of device interfaces)
Changelog
- v0.4.3:
- Python packaging changes (README,setup.py)
- Change license to GPLv3
- v0.4.2:
- Preliminary support for L2VPNS
- Ethernet OAM support
- v0.4.1:
- Fix version in setup.py
- v0.4:
- Added full support for bgp flowspec (routing-options flow) configuration
- v0.3:
- Support for basic interface configuration (name, description, vlan)
- Support for basic vlan configuration
License
This project is licensed under the GPL License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for juniper_nxpy-0.4.2-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1e58057ec997d37c54e1e617519dbc2a541ab64c9de0b22f2f50253a00714428 |
|
MD5 | ad4b0699102eed7345644389201ecb37 |
|
BLAKE2b-256 | 0be7ec827a5313567b2a59d27a4f97f2baa4060256a00af165964bc63ee2d180 |