Lindsay Hill automation, networking, product management

Brocade PyNOS Python Libraries

PyNOS v1.1 has been published. This is a python library that simplifies automating Brocade VDX systems. It is built on top of ncclient, and uses NETCONF to communicate with the VDX systems. Using the libraries is much simpler than writing your own NETCONF calls.

What can I do with it?

Use Python to script configuration or management tasks against VDX devices, e.g.:

  • Configure interfaces & VLANs

  • Find LLDP neighbors

  • Find out which port a MAC is connected to

  • Configure BGP

  • Configure SNMP

You can also use Python as an interactive shell to run commands against multiple systems.


Connect to device and check firmware version & uptime:

>>> import pynos.device
>>> conn = ('', '22')
>>> auth = ('admin', 'password')
>>> dev=pynos.device.Device(conn=conn, auth=auth)
>>> dev.connection
>>> dev.firmware_version
>>> dev.system.uptime
{'seconds': '1', 'hours': '13', 'minutes': '0', 'days': '1'}

Change switchport description:

>>> with pynos.device.Device(conn=conn, auth=auth) as dev:
...     dev.interface.description(
...     int_type='tengigabitethernet', name='225/0/38',
...     desc=RTR1 Ethernet1)

Who should use it?

Any Brocade VDX customers that want to automate network configuration - e.g. to integrate with their provisioning systems.

It’s helpful to have some Python experience. This is a toolbox for making some things easier - it is not a complete application in itself.

Where Can I Get It?

To install it, run pip install pynos

The code is also available on GitHub:

The documentation is here:

Share this: