<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: get_config error in Tools</title>
    <link>https://community.cisco.com/t5/tools/get-config-error/m-p/3464360#M3057</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Santiago for t&lt;SPAN style="font-size: 10pt;"&gt;he quick response!&amp;nbsp; This is great information, and will help me get up to speed quickly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 15 Nov 2016 17:26:02 GMT</pubDate>
    <dc:creator>kegrozis</dc:creator>
    <dc:date>2016-11-15T17:26:02Z</dc:date>
    <item>
      <title>get_config error</title>
      <link>https://community.cisco.com/t5/tools/get-config-error/m-p/3464358#M3055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm a newbie to YDK.&amp;nbsp; I'm trying to pull the configurations from XRv instances using ydk.services.NetconfService.get_config.&amp;nbsp; However, I'm not correctly entering my attributes.&amp;nbsp; Provider is self explanatory, but I keep getting errors on 'source' and 'get_filter'.&amp;nbsp; Can you provide additional details on this method or an example?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DL class="method" style="margin: 0 0 24px;"&gt;&lt;DT style="font-weight: bold; margin: 0 0 6px; font-size: 14.399999618530273px; background-color: #f0f0f0; color: #555555; padding: 6px; border-left-width: 3px; border-left-color: #cccccc;"&gt;&lt;CODE class="descname" style="font-family: Consolas, 'Andale Mono WT', 'Andale Mono', 'Lucida Console', 'Lucida Sans Typewriter', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Liberation Mono', 'Nimbus Mono L', Monaco, 'Courier New', Courier, monospace; color: #000000;"&gt;get_config&lt;/CODE&gt;&lt;SPAN class="sig-paren"&gt;(&lt;/SPAN&gt;&lt;EM&gt;provider&lt;/EM&gt;, &lt;EM&gt;source&lt;/EM&gt;, &lt;EM&gt;get_filter&lt;/EM&gt;, &lt;EM&gt;with_defaults_option=None&lt;/EM&gt;&lt;SPAN class="sig-paren"&gt;)&lt;/SPAN&gt;&lt;/DT&gt;&lt;DD style="margin: 0 0 12px 24px;"&gt;&lt;/DD&gt;&lt;/DL&gt;&lt;P style="font-size: 16px; margin-bottom: 12px !important;"&gt;Execute a get-config operation to retrieve all or part of a specified configuration.&lt;/P&gt;&lt;TABLE class="field-list docutils" frame="void" rules="none" style="margin-bottom: 24px; border: none;"&gt;&lt;TBODY valign="top"&gt;&lt;TR class="field field-odd" style="color: #404040; font-family: Lato, proxima-nova, 'Helvetica Neue', Arial, sans-serif; font-size: 16px;"&gt;&lt;TH class="field-name" style="font-size: 14.399999618530273px; padding: 8px 10px 8px 16px;"&gt;Parameters:&lt;/TH&gt;&lt;TD class="field-body" style="font-size: 14.399999618530273px; padding: 5px 16px 8px 0; border: none;"&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;get_filter&lt;/STRONG&gt; – Subtree or XPath filter to use&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;source&lt;/STRONG&gt; – Particular configuration to retrieve&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;with_defaults&lt;/STRONG&gt; – The explicit defaults processing mode requested&lt;/LI&gt;&lt;/UL&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR class="field field-even" style="color: #404040; font-family: Lato, proxima-nova, 'Helvetica Neue', Arial, sans-serif; font-size: 16px;"&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;-Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 22:34:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/get-config-error/m-p/3464358#M3055</guid>
      <dc:creator>kegrozis</dc:creator>
      <dc:date>2016-11-14T22:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: get_config error</title>
      <link>https://community.cisco.com/t5/tools/get-config-error/m-p/3464359#M3056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find an example at:&lt;/P&gt;&lt;P&gt;&lt;A href="https://gist.github.com/111pontes/b86dfca192e7fa55250bd5b06dd8babf" title="https://gist.github.com/111pontes/b86dfca192e7fa55250bd5b06dd8babf"&gt;nc-get-config-xr-ip-domain-cfg-99-ydk.py · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;That app uses NETCONF service to get DNS config.&amp;nbsp; Currently, you have to retrieve the configuration one model at a time. We're already tracking the enhancement to allow users to read the entire config (no filter):&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/CiscoDevNet/ydk-gen/issues/255" title="https://github.com/CiscoDevNet/ydk-gen/issues/255"&gt;Proposal for YDK read/write API · Issue #255 · CiscoDevNet/ydk-gen · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;We were also tracking improvements to the documentation of services.&amp;nbsp; Several enhancements have been committed and will be generally available in the next YDK-PY release:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/CiscoDevNet/ydk-gen/issues/239" title="https://github.com/CiscoDevNet/ydk-gen/issues/239"&gt;Revise service documentation · Issue #239 · CiscoDevNet/ydk-gen · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If you're new to YDK, you may want to consider the CRUD service first.&amp;nbsp; You also have to retrieve the configuration one model at a time, but that service will abstract a lot of the NETCONF details for you.&amp;nbsp; You can find the CRUD equivalent to read DNS config at:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/CiscoDevNet/ydk-py-samples/blob/master/samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-ip-domain-cfg/nc-read-xr-ip-domain-cfg-10-ydk.py" style="font-size: 10pt;" title="https://github.com/CiscoDevNet/ydk-py-samples/blob/master/samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-ip-domain-cfg/nc-read-xr-ip-domain-cfg-10-ydk.py"&gt;ydk-py-samples/nc-read-xr-ip-domain-cfg-10-ydk.py at master · CiscoDevNet/ydk-py-samples · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;That app is a boilerplate, you need to uncomment line 78 and implement 'process_ip_domain'.&amp;nbsp; You can find an example of an app using the CRUD service to read hostname configuration and processing the object to provide human-readable output at:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/CiscoDevNet/ydk-py-samples/blob/master/samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-shellutil-cfg/nc-read-xr-shellutil-cfg-20-ydk.py" style="font-size: 10pt;" title="https://github.com/CiscoDevNet/ydk-py-samples/blob/master/samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-shellutil-cfg/nc-read-xr-shellutil-cfg-20-ydk.py"&gt;ydk-py-samples/nc-read-xr-shellutil-cfg-20-ydk.py at master · CiscoDevNet/ydk-py-samples · GitHub&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Hope that helps!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Nov 2016 23:52:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/get-config-error/m-p/3464359#M3056</guid>
      <dc:creator>saalvare</dc:creator>
      <dc:date>2016-11-14T23:52:18Z</dc:date>
    </item>
    <item>
      <title>Re: get_config error</title>
      <link>https://community.cisco.com/t5/tools/get-config-error/m-p/3464360#M3057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Santiago for t&lt;SPAN style="font-size: 10pt;"&gt;he quick response!&amp;nbsp; This is great information, and will help me get up to speed quickly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Nov 2016 17:26:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/get-config-error/m-p/3464360#M3057</guid>
      <dc:creator>kegrozis</dc:creator>
      <dc:date>2016-11-15T17:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: get_config error</title>
      <link>https://community.cisco.com/t5/tools/get-config-error/m-p/3464361#M3058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santiago,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried nc-get-config-xr-ip-domain-99-ydk.py, but I am not able to get this script to run properly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I condensed the script to the following:&lt;/P&gt;&lt;P&gt;from ydk.services import NetconfService, Datastore&lt;/P&gt;&lt;P&gt;from ydk.providers import NetconfServiceProvider&lt;/P&gt;&lt;P&gt;from ydk.models.cisco_ios_xr import Cisco_IOS_XR_ip_domain_cfg \&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; as xr_ip_domain_cfg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;provider = NetconfServiceProvider(address="10.82.79.35",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; port=830,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; username="cisco",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; password="cisco",&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protocol="ssh")&lt;/P&gt;&lt;P&gt;netconf = NetconfService()&lt;/P&gt;&lt;P&gt;ip_domain = xr_ip_domain_cfg.IpDomain()&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ip_domain = netconf.get_config(provider, Datastore.running, ip_domain)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;provider.close()&lt;/P&gt;&lt;P&gt;exit()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;======&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm getting the following traceback:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "/Users/kgrozis/Docker/netconf/bin/get-config-xr-ip-domain", line 15, in &amp;lt;module&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ip_domain = netconf.get_config(provider, Datastore.running, ip_domain)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ydk/services/netconf_service.py", line 311, in get_config&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return provider.decode(payload_convert(payload), None)&lt;/P&gt;&lt;P&gt;&amp;nbsp; File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ydk/services/netconf_service.py", line 469, in payload_convert&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; return etree.tostring(chchs[0], pretty_print=True, encoding='utf-8').decode('utf-8')&lt;/P&gt;&lt;P&gt;IndexError: list index out of range&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;=======&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using the following software:&lt;/P&gt;&lt;P&gt;- XRv9K: 6.1.1&lt;/P&gt;&lt;P&gt;- YDK: .5.1&lt;/P&gt;&lt;P&gt;- python: 2.7.11&lt;/P&gt;&lt;P&gt;- MacOS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am able to get other scripts to run like hello-ydk.py.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2016 14:56:33 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/get-config-error/m-p/3464361#M3058</guid>
      <dc:creator>kegrozis</dc:creator>
      <dc:date>2016-11-16T14:56:33Z</dc:date>
    </item>
    <item>
      <title>Re: get_config error</title>
      <link>https://community.cisco.com/t5/tools/get-config-error/m-p/3464362#M3059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-size: 13.3333px;"&gt;Kevin,&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;this seems like a bug in YDK. Apparently, it tries to validate the config even though it is non-existant.&amp;nbsp; Try adding some config with any of the nc-create* apps at&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;A href="https://git.io/vPxvp" title="https://git.io/vPxvp"&gt;ydk-py-samples/samples/basic/crud/models/cisco-ios-xr/Cisco-IOS-XR-ip-domain-cfg at master · CiscoDevNet/ydk-py-samples …&lt;/A&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;&lt;/P&gt;&lt;P style="font-size: 13.3333px;"&gt;Then, &lt;SPAN style="color: #3d3d3d; font-family: arial; font-size: 12px;"&gt;nc-get-config-xr-ip-domain-99-ydk.py should run fine. I'll confirm the bug and file the YDK.&amp;nbsp; Thanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 03:39:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/get-config-error/m-p/3464362#M3059</guid>
      <dc:creator>saalvare</dc:creator>
      <dc:date>2016-11-18T03:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: get_config error</title>
      <link>https://community.cisco.com/t5/tools/get-config-error/m-p/3464363#M3060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Kevin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;YDK issue tracked at:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/CiscoDevNet/ydk-gen/issues/305" style="font-size: 10pt;" title="https://github.com/CiscoDevNet/ydk-gen/issues/305"&gt;https://github.com/CiscoDevNet/ydk-gen/issues/305&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for bringing attention to this.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Nov 2016 00:30:36 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/get-config-error/m-p/3464363#M3060</guid>
      <dc:creator>saalvare</dc:creator>
      <dc:date>2016-11-19T00:30:36Z</dc:date>
    </item>
  </channel>
</rss>

