My Third Step towards Automation: How to map Junos Commands to PyEZ RPC

In JUNOS, it’s very easy to find any RPC equivalent of the existing command by running “show route | display xml rpc”. This helps to find what is equivalent RPC command of show route as per below output.


It’s very difficult to find every time on cli what is equivalent of RPC of any Junos command. So we can leverage PyEZ to find the same and in the upcoming posts, you can check how it can be leverage to pass the different values directly in the RPC calls. In PyEZ we can call display_xml_rpc library to get the information of any RPC equivalent Junos Command.

from jnpr.junos import Device
from jnpr.junos.exception import ConnectError
dev = Device(host=’′, user=’lab’, passwd=’lab’)
except ConnectError as err:
print “Cannot connect to device: {0}”.format(err)


Share on facebook
Share on twitter
Share on linkedin

Leave a Reply

Your email address will not be published. Required fields are marked *

Become a member

Full Access to 739 Lessons. New Lessons Added Every Week!

Awesome Deal! Get 2 Months for FREE!

No Obligations. Cancel At Any Time!