Hi,
I tried to clear isis process using Yang xml RPC but facing some issues. Please do the needful.
def clear_isis(host, user, password):
try:
with manager.connect(host=host, username=user, password=password, look_for_keys=False,hostkey_verify=False,timeout=150) as m:
isis_filter = '''
<clear-isis-process xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-isis-act">
<input>
<instance>
<instance-identifier>1000</instance-identifier>
</instance>
</input>
</clear-isis-process>
'''
#cisco_isis = m.edit_config(target = 'candidate',config = isis_filter)
#m.commit()
cisco_isis = m.dispatch(isis_filter)
print cisco_isis
#m.get('subtree', isis_filter)
except Exception as exe:
print 'Exception caught in clear_isis()',exe
clear_isis('1.1.1.1', 'user', 'password')
Output:
Exception caught in clear_isis() Invalid tag name u'\n<clear-isis-process xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-isis-act">\n<input>\n<instance>\n<instance-identifier></instance-identifier>\n</instance>\n</input>\n</clear-isis-process>\n
Thank you,
Divya