Trying to configure a loopback interface on XR6.1.2 device using YDK and cannot figure out how to set the ipv4network parameters.
Using this config as a sample ydk-py-samples/nc-create-xr-ifmgr-cfg-30-ydk.py at master · CiscoDevNet/ydk-py-samples · GitHub. The problem is that cannot locate the InterfaceConfiguration attribute ipv4network:
When looking through the generated python models, the Cisco_IOS_XR_ifmgr_cfg module does contain attribute ipv4network, but still cannot use it when writing code. Could this indicate some kind of problems in module augmentation (as Cisco_IOS_XR_ifmgr_cfg is augmented by Cisco_IOS_XR_ipv4_io_cfg module for IP configuration attributes). Have tried this with a full XR6.1.2 bundle and with a bundle including only required modules for such config, the result is the same. Or could this indicate problems with my working environment.
wonder if this is an issue with your IDE. App runs just fine for me. Have you tried another editor/IDE.
$ ./nc-create-xr-ifmgr-cfg-30-ydk.py ssh://xxxx:xxxx@host -v 2017-05-17 08:39:39,364 - ydk.providers.netconf_provider - INFO - NetconfServiceProvider connected to host using ssh 2017-05-17 08:39:39,436 - ydk.services.crud_service - INFO - CREATE operation initiated 2017-05-17 08:39:39,439 - ydk.providers._provider_plugin - DEBUG - <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:15949427-787e-4fec-b43a-0413a242f79b"> <edit-config> <target> <candidate/> </target> <config xmlns:xc="urn:ietf:params:xml:ns:netconf:base:1.0"> <interface-configurations xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ifmgr-cfg"> <interface-configuration> <active>act</active> <interface-name>Loopback0</interface-name> <description>PRIMARY ROUTER LOOPBACK</description> <interface-virtual></interface-virtual> <ipv4-network xmlns="http://cisco.com/ns/yang/Cisco-IOS-XR-ipv4-io-cfg"> <addresses> <primary> <address>172.16.255.1</address> <netmask>255.255.255.255</netmask> </primary> </addresses> </ipv4-network> </interface-configuration> </interface-configurations> </config> </edit-config> </rpc> 2017-05-17 08:39:39,504 - ydk.providers._provider_plugin - DEBUG - <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:15949427-787e-4fec-b43a-0413a242f79b"> <ok/> </rpc-reply> 2017-05-17 08:39:39,505 - ydk.providers._provider_plugin - DEBUG - <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <commit/> </rpc> 2017-05-17 08:39:40,776 - ydk.providers._provider_plugin - DEBUG - <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:15949427-787e-4fec-b43a-0413a242f79b"> <ok/> </rpc-reply> 2017-05-17 08:39:40,776 - ydk.services.crud_service - INFO - CREATE operation completed 2017-05-17 08:39:41,024 - ydk.providers.netconf_provider - INFO - NetconfServiceProvider disconnected from host using ssh $ $ pip list | grep ydk ydk 0.5.4 ydk-models-cisco-ios-xr 6.2.1 ydk-models-ietf 0.1.1 ydk-models-openconfig 0.1.2 $
The issue was did not include Cisco_IOS_XR_ipv4_io_cfg the first time generated a bundle and installed it. After realizing my mistake did include this model in a bundle but did not specify the argument --upgrade when installing it, thus the cisco_ios_xr module stayed the same and was unable to use the needed arguments.
Comments
0 comments
Please sign in to leave a comment.