<?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: Configuring interface with NetconfService returns &amp;quot;Unsupported capability :candidate&amp;quot; in Tools</title>
    <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4151571#M1613</link>
    <description>&lt;P&gt;Aahh of course, I see now!&lt;/P&gt;&lt;P&gt;Should've checked the first lines in the script and not obsessed over the code and the logger output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot! everything works flawlessly now.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Sep 2020 18:04:40 GMT</pubDate>
    <dc:creator>MahdiR</dc:creator>
    <dc:date>2020-09-15T18:04:40Z</dc:date>
    <item>
      <title>Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4149000#M1603</link>
      <description>&lt;P&gt;I'm testing interface configuration using NetconfService, but i get the following error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Traceback (most recent call last):
  File "test.py", line 32, in &amp;lt;module&amp;gt;
    service.edit_config(provider=provider, target=Datastore.candidate, config=ifc)
  File "/home/sima-dev/.local/lib/python3.6/site-packages/ydk/services/netconf_service.py", line 103, in edit_config
    default_operation, test_option, error_option)
  File "/usr/lib/python3.6/contextlib.py", line 99, in __exit__
    self.gen.throw(type, value, traceback)
  File "/home/sima-dev/.local/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
    _raise(_exc)
  File "/home/sima-dev/.local/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 54, in _raise
    exec("raise exc from None")
  File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
ydk.errors.YServiceProviderError:  Unsupported capability :candidate&lt;/PRE&gt;&lt;P&gt;And I found this in the output of the logger:&lt;/P&gt;&lt;PRE&gt;&amp;lt;error-message xml:lang="en"&amp;gt;Unsupported capability :candidate&amp;lt;/error-message&amp;gt;&lt;/PRE&gt;&lt;P&gt;Should Datastore.candidate be a supported capability on the device? I thought this was implied as long as the device supported netconf!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code:&amp;nbsp; (This is my first time configuring via netconf, so it might also be something that I'm doing wrong in the code)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;import logging
import ydk.models.cisco_ios_xe.Cisco_IOS_XE_interfaces_oper as ifc_oper
from ydk.services.netconf_service import NetconfService
from ydk.services import Datastore
from ydk.providers.netconf_provider import NetconfServiceProvider


def enable_logging(level):
    log = logging.getLogger('ydk')
    log.setLevel(level)
    handler = logging.StreamHandler()
    formatter = logging.Formatter(
        "%(asctime)s - %(name)s - %(levelname)s - %(message)s")
    handler.setFormatter(formatter)
    log.addHandler(handler)


if __name__ == "__main__":
    enable_logging(logging.INFO)

    service = NetconfService()
    provider = NetconfServiceProvider(address="ip",
                                      username="username",
                                      password="password")

    model = ifc_oper.Interfaces()
    ifc = ifc_oper.Interfaces.Interface()
    
    ifc.name = "GigabitEthernet0/0/7"
    ifc.description = "test description"
    model.interface.append(ifc)

    service.edit_config(provider=provider, target=Datastore.candidate, config=ifc)

    interface = service.get(provider=provider, read_filter=ifc)

    print(interface.description)&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Sep 2020 09:29:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4149000#M1603</guid>
      <dc:creator>MahdiR</dc:creator>
      <dc:date>2020-09-10T09:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4149539#M1604</link>
      <description>&lt;P&gt;Hi Mahdi&lt;/P&gt;&lt;P&gt;The script looks fine. The issue could be with the router, which apparently does not support candidate datastore. Try simply replace this line:&lt;/P&gt;&lt;PRE&gt;   service.edit_config(provider=provider, target=Datastore.running, config=ifc)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 05:36:27 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4149539#M1604</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2020-09-11T05:36:27Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4149598#M1605</link>
      <description>&lt;P&gt;I get this when I run the code with Datastore.running:&lt;/P&gt;&lt;PRE&gt;Traceback (most recent call last):
  File "/home/sima-dev/simon_dev/pyenivest/customer_unit/test.py", line 33, in &amp;lt;module&amp;gt;
    service.edit_config(provider=provider, target=Datastore.running, config=ifc)
  File "/home/sima-dev/.local/lib/python3.6/site-packages/ydk/services/netconf_service.py", line 103, in edit_config
    default_operation, test_option, error_option)
  File "/usr/lib/python3.6/contextlib.py", line 99, in exit
    self.gen.throw(type, value, traceback)
  File "/home/sima-dev/.local/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 82, in handle_runtime_error
    _raise(_exc)
  File "/home/sima-dev/.local/lib/python3.6/site-packages/ydk/errors/error_handler.py", line 54, in _raise
    exec("raise exc from None")
  File "&amp;lt;string&amp;gt;", line 1, in &amp;lt;module&amp;gt;
ydk.errors.YServiceProviderError:  object is not writable
2020-09-11 08:28:32,136 - ydk - INFO - Disconnected from device&lt;/PRE&gt;&lt;P&gt;What are the best practices for configuration? using running datastore or candidate?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 08:47:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4149598#M1605</guid>
      <dc:creator>MahdiR</dc:creator>
      <dc:date>2020-09-11T08:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4149811#M1606</link>
      <description>&lt;P&gt;When you connect to the Netconf service using NetconfServiceProvider, it reads device capabilities (logged only on DEBUG level). Here example for Cisco IOS XE. YDK sends request RPC:&lt;/P&gt;&lt;PRE&gt;2020-09-11 08:56:04,605 - ydk - DEBUG - Trace: Writing message (session &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&amp;lt;hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&amp;gt;&lt;BR /&gt;  &amp;lt;capabilities&amp;gt;&lt;BR /&gt;    &amp;lt;capability&amp;gt;urn:ietf:params:netconf:base:1.0&amp;lt;/capability&lt;BR /&gt;    &amp;lt;capability&amp;gt;urn:ietf:params:netconf:base:1.1&amp;lt;/capability&amp;gt;&lt;BR /&gt;&lt;STRONG&gt;    &amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:writable-running:1.0&amp;lt;/capability&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;    &amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:candidate:1.0&amp;lt;/capability&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;    &amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:startup:1.0&amp;lt;/capability&amp;gt;&lt;BR /&gt;    &amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:rollback-on-error:1.0&amp;lt;/capability&amp;gt;&lt;BR /&gt;  &amp;lt;/capabilities&amp;gt;&lt;BR /&gt;&amp;lt;/hello&amp;gt;&lt;/PRE&gt;&lt;P&gt;Receives from device:&lt;/P&gt;&lt;PRE&gt;2020-09-11 08:56:05,133 - ydk - DEBUG - Trace: Received message (session &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; &lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&amp;lt;hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"&amp;gt;&lt;BR /&gt;&amp;lt;capabilities&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:base:1.0&amp;lt;/capability&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:base:1.1&amp;lt;/capability&amp;gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:writable-running:1.0&amp;lt;/capability&amp;gt;&lt;/STRONG&gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:xpath:1.0&amp;lt;/capability&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:validate:1.0&amp;lt;/capability&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:validate:1.1&amp;lt;/capability&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:rollback-on-error:1.0&amp;lt;/capability&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:notification:1.0&amp;lt;/capability&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:interleave:1.0&amp;lt;/capability&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=explicit&amp;amp;amp;also-supported=report-all-tagged&amp;lt;/capability&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;urn:ietf:params:netconf:capability:yang-library:1.0?revision=2016-06-21&amp;amp;amp;module-set-id=730825758336af65af9606c071685c05&amp;lt;/capability&amp;gt;&lt;BR /&gt;&amp;lt;capability&amp;gt;http://tail-f.com/ns/netconf/actions/1.0&amp;lt;/capability&amp;gt;&lt;/PRE&gt;&lt;P&gt;Here you can see that the device supports only &lt;EM&gt;running&lt;/EM&gt; datastore, which means you can write configuration directly to running configuration.&lt;/P&gt;&lt;P&gt;Alternatively, the IOS XR supports &lt;EM&gt;candidate&lt;/EM&gt; configuration, which means that all device configurations must be done in the candidate datastore and then committed to the running config.&lt;/P&gt;&lt;P&gt;Please run your script with DEBUG logging level and check what capabilities your device is supporting. Attach the log to the post for better understanding of what is going on.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Sep 2020 16:13:48 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4149811#M1606</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2020-09-11T16:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150047#M1607</link>
      <description>&lt;P&gt;I've attached the output, using DEBUG logging level.&lt;/P&gt;&lt;P&gt;It looks like my device supports running, however I'm not sure why I still get the error!&lt;/P&gt;</description>
      <pubDate>Sat, 12 Sep 2020 07:16:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150047#M1607</guid>
      <dc:creator>MahdiR</dc:creator>
      <dc:date>2020-09-12T07:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150218#M1608</link>
      <description>&lt;P&gt;Something wrong with connectivity to the device - the YDK connects to device, gets all the capabilities, gets YANG1.1 capabilities and then unexpectedly sends disconnect request.&lt;/P&gt;&lt;PRE&gt;&lt;FONT size="2"&gt;&lt;STRONG&gt;2020-09-12 07:09:31,568 - ydk - INFO - Connected to FRD-ASR920-Utviklingtest01&lt;/STRONG&gt; on port 830 using ssh with timeout of -1&lt;/FONT&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;2020-09-12 07:09:31,575 - ydk - INFO - Disconnected from device&lt;/FONT&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;2020-09-12 07:09:31,576 - ydk - DEBUG - Trace: Writing message (session 102):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;lt;rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;lt;close-session/&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;lt;/rpc&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;2020-09-12 07:09:31,618 - ydk - DEBUG - Trace: Received message (session 102):&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;&amp;lt;rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="2"&amp;gt;&amp;lt;ok/&amp;gt;&amp;lt;/rpc-reply&amp;gt;&lt;/FONT&gt;&lt;/PRE&gt;&lt;P&gt;There are no error messages. Very strange!&lt;/P&gt;&lt;P&gt;Could you please try to pass top entity to the netconf service call, like this:&lt;/P&gt;&lt;PRE&gt;    ifcs = ifc_oper.Interfaces()
    ifc = ifc_oper.Interfaces.Interface()
    
    ifc.name = "GigabitEthernet0/0/7"
    ifc.description = "test description"
    ifcs.interface.append(ifc)
&lt;BR /&gt;    service.edit_config(provider=provider, target=Datastore.running, config=ifcs)&lt;BR /&gt;&lt;BR /&gt;    interfaces = service.get(provider=provider, read_filter=ifc_oper.Interfaces())&lt;/PRE&gt;</description>
      <pubDate>Tue, 15 Sep 2020 17:17:42 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150218#M1608</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2020-09-15T17:17:42Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150518#M1609</link>
      <description>&lt;P&gt;I've attached the output, passing top entity to netconf service call.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 06:11:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150518#M1609</guid>
      <dc:creator>MahdiR</dc:creator>
      <dc:date>2020-09-14T06:11:52Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150806#M1610</link>
      <description>&lt;P&gt;Again, you are trying to write to 'candidate' datastore, which is not supported on your device. Error:&lt;/P&gt;&lt;PRE&gt;&amp;lt;error-message xml:lang="en"&amp;gt;Unsupported capability :candidate&amp;lt;/error-message&amp;gt;&lt;/PRE&gt;&lt;P&gt;You need to write directly to the 'running' datastore.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 16:14:07 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150806#M1610</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2020-09-14T16:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150946#M1611</link>
      <description>&lt;P&gt;Sorry about that! I've attached the new output.&lt;/P&gt;&lt;P&gt;But it still gives me the same error as before, that running config is not writable! Even though the device supports that capability.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2020 20:24:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4150946#M1611</guid>
      <dc:creator>MahdiR</dc:creator>
      <dc:date>2020-09-14T20:24:18Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4151550#M1612</link>
      <description>&lt;P&gt;Hi Mahdi&lt;/P&gt;&lt;P&gt;The issue here is that you are using status model&amp;nbsp;&lt;EM&gt;Cisco_IOS_XE_interfaces_oper&lt;/EM&gt; to do the interface configuration. That is why you are getting &lt;EM&gt;not-writable&lt;/EM&gt; error. Please use&amp;nbsp;&lt;EM&gt;Cisco_IOS_XE_interfaces_cfg&lt;/EM&gt; model for interface configuration, then you can use status model to get interface status.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 17:26:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4151550#M1612</guid>
      <dc:creator>yangorelik</dc:creator>
      <dc:date>2020-09-15T17:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: Configuring interface with NetconfService returns "Unsupported capability :candidate"</title>
      <link>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4151571#M1613</link>
      <description>&lt;P&gt;Aahh of course, I see now!&lt;/P&gt;&lt;P&gt;Should've checked the first lines in the script and not obsessed over the code and the logger output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot! everything works flawlessly now.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Sep 2020 18:04:40 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/configuring-interface-with-netconfservice-returns-quot/m-p/4151571#M1613</guid>
      <dc:creator>MahdiR</dc:creator>
      <dc:date>2020-09-15T18:04:40Z</dc:date>
    </item>
  </channel>
</rss>

