I can't seem to get interface statistics from IOS XR devices... I've tried a few different filters but the only result is null.
A similar method to get NTP status works.
Here is the python code:
from ncclient import manager
import xmltodict
import json
ncm = manager.connect(host='10.10.10.1', port=830, username='cisco',
password='cisco123', device_params={'name': 'iosxr'}, timeout=100)
print(ncm.connected)
vf = """
<filter type="subtree">
<interfaces xmlns="urn:ietf:params:xml:ns:yang:ietf-interfaces">
<interfaces-state>
</interfaces-state>
</interfaces>
</filter>"""
software_data = ncm.get(vf)
software_json = xmltodict.parse(str(software_data))
print(json.dumps(software_json['rpc-reply'], indent=2))
I've also tried filters using ifoper-mgr, like this:
vf = """
<filter type="subtree">
<ifmgr-oper xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-oper">
<interface-properties>
<data-nodes/>
</interface-properties>
</ifmgr-oper>
</filter>
"""