09-23-2020 05:30 AM - edited 09-23-2020 05:30 AM
Hi!
I am trying to retrieve information on interfaces from a XR.
But I only get error messages..
sysView.Interfaces.Interface.append(interface) AttributeError: type object 'Interface' has no attribute 'append'
The code I am trying to run:
service = NetconfService() provider = NetconfServiceProvider(address=ipaddress, username=user, password=password) model = ifmgr_oper.InterfaceProperties() dataNode = ifmgr_oper.InterfaceProperties.DataNodes.DataNode() dataNode.data_node_name = "default" sysView = ifmgr_oper.InterfaceProperties.DataNodes.DataNode.SystemView() interface = ifmgr_oper.InterfaceProperties.DataNodes.DataNode.SystemView.Interfaces.Interface() interface.interface_name = "Gi0/0/0/1" sysView.Interfaces.Interface.append(interface) dataNode.SystemView.append(sysView) model.DataNodes.DataNode.append(dataNode) interface = service.get(provider=provider, read_filter=model) print(interface)
My imports:
import ydk.models.cisco_ios_xr.Cisco_IOS_XR_ifmgr_oper as ifmgr_oper from ydk.services.netconf_service import NetconfService from ydk.providers.netconf_provider import NetconfServiceProvider
I followed examples from previous asked questions:
Used the guide:
http://ydk.cisco.com/py/docs/guides/crud_guide.html#creating-a-configuration-with-a-list-and-a-presence-class
And read the docs:
Any clues on what I am doing wrong?
Kind regards,
Simon Johansen
Solved! Go to Solution.
09-24-2020 01:42 AM - edited 09-24-2020 01:43 AM
09-24-2020 01:42 AM - edited 09-24-2020 01:43 AM
This post have been solved here:
https://community.cisco.com/t5/yang-development-kit-ydk/issues-retrieving-xr-interface-information/m-p/4155139
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide