<?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: How to segregate between user-defined config and default configs on a device from Java Api in NSO in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-segregate-between-user-defined-config-and-default-configs/m-p/3902934#M4144</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can have a look at the flags for your MAAPI session in the doc: "doc/api/java/com/tailf/maapi/MaapiFlag.html". The flags NO_DEFAULT should be able to solve your problem (quoting 5.2 doc):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;NO_DEFAULTS
public static final MaapiFlag NO_DEFAULTS
This flag specifies that we want to be informed when we read leafs with default values that have not had a value set.
This is indicated by the returned value being of class ConfDefault (type J_DEFAULT) instead of the actual value. The default value for such leafs can be obtained from the Maapi.loadSchemas() tree provided by the library.&lt;/PRE&gt;
&lt;P&gt;You can set the flags at transaction creation or using the setFlags function. I don't have a working example in Java but I have used similar mechanism in python in the past.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2019 08:54:14 GMT</pubDate>
    <dc:creator>gmuloche</dc:creator>
    <dc:date>2019-08-05T08:54:14Z</dc:date>
    <item>
      <title>How to segregate between user-defined config and default configs on a device from Java Api in NSO</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-segregate-between-user-defined-config-and-default-configs/m-p/3902244#M4141</link>
      <description>&lt;P&gt;I am trying to delete all user-defined configuration on a device using NAVU API in action package, but when I traverse the tree, I get all the default leafs as well&lt;/P&gt;
&lt;P&gt;for example for nx device these are default configs and not done by operator explicitly:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;leaf path: /ncs:devices/device{rfs1nx}/config/nx:interface/Ethernet{1/25}/mtu leaf value: 1500&lt;BR /&gt;leaf path: /ncs:devices/device{rfs1nx}/config/nx:interface/Ethernet{1/25}/delay leaf value: 1&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Executing live-status action gives me the user-defined config only but then how can I create Xpath for leaf deletion using these config lines? Any suggestions?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;output of live-status:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;interface Ethernet1/12&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;description NXC&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;shutdown&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;switchport access vlan 999&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;speed 1000&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;no snmp trap link-status&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Appreciate any inputs!!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 17:59:55 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-segregate-between-user-defined-config-and-default-configs/m-p/3902244#M4141</guid>
      <dc:creator>neetimit</dc:creator>
      <dc:date>2019-08-02T17:59:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to segregate between user-defined config and default configs on a device from Java Api in NSO</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-segregate-between-user-defined-config-and-default-configs/m-p/3902934#M4144</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can have a look at the flags for your MAAPI session in the doc: "doc/api/java/com/tailf/maapi/MaapiFlag.html". The flags NO_DEFAULT should be able to solve your problem (quoting 5.2 doc):&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;NO_DEFAULTS
public static final MaapiFlag NO_DEFAULTS
This flag specifies that we want to be informed when we read leafs with default values that have not had a value set.
This is indicated by the returned value being of class ConfDefault (type J_DEFAULT) instead of the actual value. The default value for such leafs can be obtained from the Maapi.loadSchemas() tree provided by the library.&lt;/PRE&gt;
&lt;P&gt;You can set the flags at transaction creation or using the setFlags function. I don't have a working example in Java but I have used similar mechanism in python in the past.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 08:54:14 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-segregate-between-user-defined-config-and-default-configs/m-p/3902934#M4144</guid>
      <dc:creator>gmuloche</dc:creator>
      <dc:date>2019-08-05T08:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to segregate between user-defined config and default configs on a device from Java Api in NSO</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-segregate-between-user-defined-config-and-default-configs/m-p/3903203#M4145</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/166202"&gt;@gmuloche&lt;/a&gt;&amp;nbsp; Thanks so much! this worked perfectly.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 16:08:58 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/how-to-segregate-between-user-defined-config-and-default-configs/m-p/3903203#M4145</guid>
      <dc:creator>neetimit</dc:creator>
      <dc:date>2019-08-05T16:08:58Z</dc:date>
    </item>
  </channel>
</rss>

