Ejemplo n.º 1
0
from pprint import pprint as pp 
from lxml import etree

# for the example ...
from exampleutils import *
from jnpr.eznc import Netconf as Junos

login = dict(user='******', host='vsrx_cyan', password='******')
jdev = Junos(**login)
jdev.open()

# you can run any cli command using the :cli: method, for example
print "showing command: 'show version'"
print jdev.cli("show version")

# showing command: 'show version'

# Hostname: jnpr-dc-fw
# Model: junosv-firefly
# JUNOS Software Release [12.1X44-D10.4]


# you can also obtain the XML RPC for the associated command by 
# doing this:

print "showing as XML RPC command:"
xml_cmd = jdev.cli("show version | display xml rpc")

# this is an actual XML element, so we can dump it for debug:
etree.dump(xml_cmd)
Ejemplo n.º 2
0
from pprint import pprint as pp
from lxml import etree

# for the example ...
from exampleutils import *
from jnpr.eznc import Netconf as Junos

login = dict(user='******', host='vsrx_cyan', password='******')
jdev = Junos(**login)
jdev.open()

# you can run any cli command using the :cli: method, for example
print "showing command: 'show version'"
print jdev.cli("show version")

# showing command: 'show version'

# Hostname: jnpr-dc-fw
# Model: junosv-firefly
# JUNOS Software Release [12.1X44-D10.4]

# you can also obtain the XML RPC for the associated command by
# doing this:

print "showing as XML RPC command:"
xml_cmd = jdev.cli("show version | display xml rpc")

# this is an actual XML element, so we can dump it for debug:
etree.dump(xml_cmd)

# showing as XML RPC command: