Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ncclient import manager
- import logging
- with manager.connect(host='172.17.14.242', port=830, username='admin', password='admin',
- device_params={'name': 'alu'},
- hostkey_verify=False) as m:
- req_xml_2 = '''
- <configure xmlns="urn:alcatel-lucent.com:sros:ns:yang:conf-r13">
- <router/>
- </configure>
- '''
- print("Displaying the whole config as XML")
- print(m.get_config(source='running'))
- print("\n\n\n\n\n\n")
- print("Displaying the filtered part as defined by req_xml_2 filter ")
- c = m.get_config(source='running', filter=('subtree', req_xml_2))
- print(c)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement