Пример #1
0
# 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:
# <get-software-information>
# </get-software-information>

# you can then take that output then feed it back into the :rpc: metaexec

cmd_rsp = jdev.rpc( xml_cmd )

# now dump the XML response output;

print "showing as XML RPC response:"
etree.dump( cmd_rsp )

# showing as XML RPC response:
# <software-information>
# <host-name>jnpr-dc-fw</host-name>
# <product-model>junosv-firefly</product-model>
# <product-name>junosv-firefly</product-name>
# <package-information>
# <name>junos</name>
# <comment>JUNOS Software Release [12.1X44-D10.4]</comment>
# </package-information>
Пример #2
0
# 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:
# <get-software-information>
# </get-software-information>

# you can then take that output then feed it back into the :rpc: metaexec

cmd_rsp = jdev.rpc(xml_cmd)

# now dump the XML response output;

print "showing as XML RPC response:"
etree.dump(cmd_rsp)

# showing as XML RPC response:
# <software-information>
# <host-name>jnpr-dc-fw</host-name>
# <product-model>junosv-firefly</product-model>
# <product-name>junosv-firefly</product-name>
# <package-information>
# <name>junos</name>
# <comment>JUNOS Software Release [12.1X44-D10.4]</comment>
# </package-information>