Skip to content

Commit

Permalink
Update rpmeta.py
Browse files Browse the repository at this point in the history
As requested an expanded example of both filter_xml and options
  • Loading branch information
astiphout authored Jul 9, 2016
1 parent d2c51fd commit 89dec90
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions lib/jnpr/junos/rpcmeta.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,18 @@ def get_config(self, filter_xml=None, options={}):
"""
retrieve configuration from the Junos device
:filter_xml: XPath expression consisting of XML tag names separated by slashes,
defines what to retrieve; when omitted then the entire configuration is returned
:filter_xml: fully XML formatted tag which defines what to retrieve,
when omitted the entire configuration is returned;
the following returns the device host-name configured with "set system host-name":
:options: is a dictionary of XML attributes to set within the <get-configuration> RPC.
config = dev.rpc.get_config(filter_xml=etree.XML('<configuration><system><host-name/></system></configuration>'))
:options: is a dictionary of XML attributes to set within the <get-configuration> RPC;
the following returns the device host-name either configured with "set system host-name"
and if unconfigured, the value inherited from apply-group re0|re1, typical for multi-RE systems:
config = dev.rpc.get_config(filter_xml=etree.XML('<configuration><system><host-name/></system></configuration>'),
options={'database':'committed','inherit':'inherit'})
"""
rpc = E('get-configuration', options)
Expand Down

0 comments on commit 89dec90

Please sign in to comment.