ā05-06-2017 07:19 AM
Hi, I'm trying to configure a loopback interface on XR6.1.2 device using YDK and I cannot figure out how to set the ipv4network parameters.
I'm 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 I 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 I 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)? I 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?
Thanks,
Paulius
ā05-17-2017 08:44 AM
I 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
$
ā05-22-2017 11:28 AM
Were you able to solve your IDE integration?
ā05-23-2017 12:57 AM
Hi,
Yes I have, I even forgot about this post . It was totally my mistake as I did not include Cisco_IOS_XR_ipv4_io_cfg the first time I generated a bundle and installed it. After realising my mistake I 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 I was unable to use the needed arguments.
Thanks for your help and great tutorials!!
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