Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

juniper-nxpy-0.4.2.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

juniper_nxpy-0.4.2-py2-none-any.whl (21.2 kB view details)

Uploaded Python 2

File details

Details for the file juniper-nxpy-0.4.2.tar.gz.

File metadata

  • Download URL: juniper-nxpy-0.4.2.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3rc1

File hashes

Hashes for juniper-nxpy-0.4.2.tar.gz
Algorithm Hash digest
SHA256 63003fa1456530fd8dce4ce04f8e26d05692604fac53e89a600c33320100ee93
MD5 ecb6d117926298669f900b1808fcacf7
BLAKE2b-256 ad82a808ff5708b74aedcfeb3f693c2e736a217db884e516766d8ecd5f2f3d3c

See more details on using hashes here.

File details

Details for the file juniper_nxpy-0.4.2-py2-none-any.whl.

File metadata

  • Download URL: juniper_nxpy-0.4.2-py2-none-any.whl
  • Upload date:
  • Size: 21.2 kB
  • Tags: Python 2
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.4.2 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3rc1

File hashes

Hashes for juniper_nxpy-0.4.2-py2-none-any.whl
Algorithm Hash digest
SHA256 1e58057ec997d37c54e1e617519dbc2a541ab64c9de0b22f2f50253a00714428
MD5 ad4b0699102eed7345644389201ecb37
BLAKE2b-256 0be7ec827a5313567b2a59d27a4f97f2baa4060256a00af165964bc63ee2d180

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page