<?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: interface no shutdown in Tools</title>
    <link>https://community.cisco.com/t5/tools/interface-no-shutdown/m-p/3434870#M3087</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you have the Cisco_IOS_XR_ifmgr_cfg module imported as xr_ifmgr_cfg, this fragment of code shows how to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;from ydk.types import DELETE&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;if __name__ == "__main__":&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; provider = NetconfServiceProvider(...&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; crud = CRUDService()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configurations = xr_ifmgr_cfg.InterfaceConfigurations()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configuration = interface_configurations.InterfaceConfiguration()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configuration.active = "act"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configuration.interface_name = "GigabitEthernet0/0/0/0"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configuration.shutdown = DELETE()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configurations.interface_configuration.append(interface_configuration)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # delete configuration on NETCONF device&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; crud.update(provider, interface_configurations)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The important points to note are:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt;"&gt;The import of the special type "&lt;SPAN style="font-family: 'courier new', courier;"&gt;DELETE&lt;/SPAN&gt;"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt;"&gt;The use of the special type "&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;DELETE&lt;/SPAN&gt;", an instance of which is assigned to "&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;interface_configuration.shutdown&lt;/SPAN&gt;".&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt;"&gt;Using "&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;crud.update&lt;/SPAN&gt;" to update the field inside the object.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Einar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 02 Jan 2017 02:21:54 GMT</pubDate>
    <dc:creator>einarnn</dc:creator>
    <dc:date>2017-01-02T02:21:54Z</dc:date>
    <item>
      <title>interface no shutdown</title>
      <link>https://community.cisco.com/t5/tools/interface-no-shutdown/m-p/3434869#M3086</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May I know how to "no shutdown" the interface??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can only find the interface_configuration.shutdown=empty() to explicitly shutdown the interface but can't find a function to explicitly no shutdown the interface.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 01 Jan 2017 16:37:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/interface-no-shutdown/m-p/3434869#M3086</guid>
      <dc:creator>yitung</dc:creator>
      <dc:date>2017-01-01T16:37:16Z</dc:date>
    </item>
    <item>
      <title>Re: interface no shutdown</title>
      <link>https://community.cisco.com/t5/tools/interface-no-shutdown/m-p/3434870#M3087</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming you have the Cisco_IOS_XR_ifmgr_cfg module imported as xr_ifmgr_cfg, this fragment of code shows how to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;from ydk.types import DELETE&lt;/STRONG&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;if __name__ == "__main__":&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="font-size: 10pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; provider = NetconfServiceProvider(...&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;)&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; crud = CRUDService()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configurations = xr_ifmgr_cfg.InterfaceConfigurations()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configuration = interface_configurations.InterfaceConfiguration()&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configuration.active = "act"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configuration.interface_name = "GigabitEthernet0/0/0/0"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configuration.shutdown = DELETE()&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-size: 10pt; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; interface_configurations.interface_configuration.append(interface_configuration)&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; # delete configuration on NETCONF device&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; crud.update(provider, interface_configurations)&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The important points to note are:&lt;/SPAN&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt;"&gt;The import of the special type "&lt;SPAN style="font-family: 'courier new', courier;"&gt;DELETE&lt;/SPAN&gt;"&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt;"&gt;The use of the special type "&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;DELETE&lt;/SPAN&gt;", an instance of which is assigned to "&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;interface_configuration.shutdown&lt;/SPAN&gt;".&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN style="font-size: 10pt;"&gt;Using "&lt;SPAN style="font-size: 13.3333px; font-family: 'courier new', courier;"&gt;crud.update&lt;/SPAN&gt;" to update the field inside the object.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Einar&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2017 02:21:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/interface-no-shutdown/m-p/3434870#M3087</guid>
      <dc:creator>einarnn</dc:creator>
      <dc:date>2017-01-02T02:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: interface no shutdown</title>
      <link>https://community.cisco.com/t5/tools/interface-no-shutdown/m-p/3434871#M3088</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Einar,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; It works when the interface is "admin shutdown". However, if the interface is up, I can't use this method.&lt;/P&gt;&lt;P&gt;It causes me an additional step to check the interface status first before issuing this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Is it possible to "no shutdown" the interface without query the interface status??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many Thanks!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;======================================&lt;/P&gt;&lt;P&gt;ydk.errors.YPYServiceProviderError: Server rejected request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error-type: application&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error-tag: data-missing&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error-severity: error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; error-path: ns1:interface-configurations/ns1:interface-configuration[active = 'act' and interface-name = 'GigabitEthernet0/0/0/0']/ns1:shutdown&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2017 14:20:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/interface-no-shutdown/m-p/3434871#M3088</guid>
      <dc:creator>yitung</dc:creator>
      <dc:date>2017-01-02T14:20:44Z</dc:date>
    </item>
    <item>
      <title>Re: interface no shutdown</title>
      <link>https://community.cisco.com/t5/tools/interface-no-shutdown/m-p/3434872#M3089</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Right now, I'm afraid that no, you can't do what you want with the YDK. This is because of how we map operations through to the underlying netconf protocol. DELETE maps to operation='delete' in netconf, which requires that the data to be deleted exists, or an error is generated. Netconf can do this, with operation='remove', but this is not supported today. It would be a fairly simple enhancement if you want to try patching this. You would need to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Introduce a new class "REMOVE" in the file &lt;STRONG&gt;&lt;A href="https://github.com/CiscoDevNet/ydk-gen/blob/master/sdk/python/core/ydk/types.py" title="https://github.com/CiscoDevNet/ydk-gen/blob/master/sdk/python/core/ydk/types.py"&gt;ydk-gen/types.py at master · CiscoDevNet/ydk-gen · GitHub&lt;/A&gt;&lt;/STRONG&gt;&lt;/LI&gt;&lt;LI&gt;Modify _encoder.py (near &lt;A href="https://github.com/CiscoDevNet/ydk-gen/blob/master/sdk/python/core/ydk/providers/_encoder.py#L83-L85" title="https://github.com/CiscoDevNet/ydk-gen/blob/master/sdk/python/core/ydk/providers/_encoder.py#L83-L85"&gt;ydk-gen/_encoder.py at master · CiscoDevNet/ydk-gen · GitHub&lt;/A&gt;) to have an elif clause for the new "REMOVE" class to generate the correct netconf binding. Probably something like:&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; elif isinstance(value, REMOVE) and not is_filter:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&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; xc = 'urn:ietf:params:xml:ns:netconf:base:1.0'&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&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; member_elem.set('{' + xc + '}operation', 'remove')&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Feel free to either &lt;SPAN style="font-size: 10pt;"&gt;&lt;A class="jive-link-external-small" href="http://cs.co/ydk-gen" rel="nofollow" target="_blank"&gt;http://cs.co/ydk-gen&lt;/A&gt;&lt;SPAN&gt; and try this out, or submit an issue. &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt;"&gt;Hope this helps!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Cheers,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;Einar&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Jan 2017 15:34:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/tools/interface-no-shutdown/m-p/3434872#M3089</guid>
      <dc:creator>einarnn</dc:creator>
      <dc:date>2017-01-02T15:34:09Z</dc:date>
    </item>
  </channel>
</rss>

