<?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: NSO: When statement with xpath on yang file in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/nso-when-statement-with-xpath-on-yang-file/m-p/3861671#M3816</link>
    <description>&lt;P&gt;Hi Jan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your replay.&lt;/P&gt;&lt;P&gt;I corrected makefile and yang file, please see the attached rar files for check.&lt;/P&gt;&lt;P&gt;My neds folder are showed in the following screen schot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ned Folder.jpg" style="width: 891px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/37330i7CF0DF17CB88ECD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ned Folder.jpg" alt="Ned Folder.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When i re-try make command, following error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[nso@itminso src]$ make
/home/nso/NSO-4.3.6/bin/ncsc  `ls OPM-IF-ann.yang  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; echo "-a OPM-IF-ann.yang"` \
             --yangpath ../../cisco-ios/src/ncsc-out/modules/yang --yangpath ../../cisco-ios-xr/src/yang -c -o ../load-dir/OPM-IF.fxs yang/OPM-IF.yang
../../cisco-ios/src/ncsc-out/modules/yang/tailf-ned-cisco-ios.yang:114976: warning: when tailf:cli-drop-node-name is given, it is recommended that tailf:cli-suppress-mode is used in combination. using tailf:cli-drop-nodename in a list child without using tailf:cli-suppress-mode on the list, might lead to confusing behaviour, where the user enters the submode without being able to give further configuration.
../../cisco-ios/src/ncsc-out/modules/yang/tailf-ned-cisco-ios.yang:124245: warning: when tailf:cli-drop-node-name is given, it is recommended that tailf:cli-suppress-mode is used in combination. using tailf:cli-drop-nodename in a list child without using tailf:cli-suppress-mode on the list, might lead to confusing behaviour, where the user enters the submode without being able to give further configuration.
&lt;EM&gt;&lt;STRONG&gt;yang/OPM-IF.yang:19: error: module 'tailf-ned-cisco-iosxr' not found
yang/OPM-IF.yang:65: error: the node 'interface' from module 'tailf-ned-cisco-iosxr' (in node 'config' from 'tailf-ncs') is not found
make: *** [../load-dir/OPM-IF.fxs] Error 1&lt;/STRONG&gt;&lt;/EM&gt;
[nso@itminso src]$ &lt;/PRE&gt;&lt;P&gt;Do you any idea?&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Maurizio&lt;/P&gt;</description>
    <pubDate>Thu, 23 May 2019 14:34:20 GMT</pubDate>
    <dc:creator>Maurizio Bau</dc:creator>
    <dc:date>2019-05-23T14:34:20Z</dc:date>
    <item>
      <title>NSO: When statement with xpath on yang file</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/nso-when-statement-with-xpath-on-yang-file/m-p/3861502#M3812</link>
      <description>&lt;P&gt;Hi All&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to deploy a Yang file on NSO service with following schema&lt;/P&gt;&lt;P&gt;- IF DeviceA are IOS TYPE, then 1 container;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried with the following pattern&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;when&lt;/SPAN&gt; &lt;SPAN&gt;"/ncs:devices/ncs:device[ncs:name=current()/../deviceA]/ncs:platform/ncs:name = 'ios'"&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;STRONG&gt;;&lt;/STRONG&gt; &lt;/SPAN&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;but when I launch the &lt;EM&gt;make&lt;/EM&gt; command, i've this logs&lt;/P&gt;&lt;P&gt;&lt;EM&gt;[nso@itminso src]$ make&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;/home/nso/NSO-4.3.6/bin/ncsc `ls OPM-IF-ann.yang &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; echo "-a OPM-IF-ann.yang"` \&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;-c -o ../load-dir/OPM-IF.fxs yang/OPM-IF.yang&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;yang/OPM-IF.yang:15: error: module 'tailf-ned-cisco-ios' not found&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;yang/OPM-IF.yang:19: error: module 'tailf-ned-cisco-ios-xr' not found&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;yang/OPM-IF.yang:53: error: the node 'deviceA' from module 'OPM-IF' (in node 'services' from 'tailf-ncs') is not found&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;yang/OPM-IF.yang:56: error: the node 'interface' from module 'tailf-ned-cisco-ios' (in node 'config' from 'tailf-ncs') is not found&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any Idea?&lt;/P&gt;&lt;P&gt;Thanks for all support&lt;/P&gt;&lt;P&gt;Maurizio&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;PRE&gt;import tailf-ned-cisco-ios {
    prefix ios;
}   

  import tailf-ned-cisco-ios-xr {
    prefix cisco-iosxr;
}

augment /ncs:services {
list OPM-IF {
key name;

uses ncs:service-data;
ncs:servicepoint "OPM-IF";

leaf name {
type string;
}

// Scelta del Device.
leaf deviceA {
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
}
}

leaf vlan-id {
     tailf:info "VLAN ID";
      mandatory true;
      type int32 {
        range "2 .. 4094" {
          error-message "Invalid value for VLAN ID";
        }
      }
   }
// Sezione Interfaccia
  choice interfaceA {
        case ios {
when "/ncs:devices/ncs:device[ncs:name=current()/../deviceA]/ncs:platform/ncs:name = 'ios'";
// /devices/device[name='IOS-CO']/platform/name ios
          leaf Giga_ios {
            type leafref {
              path "/ncs:devices/ncs:device[ncs:name=current()/../deviceA]/ncs:config/ios:interface/ios:GigabitEthernet/ios:name";
            }
          }
        }
case ios-xr {
when "/ncs:devices/ncs:device[ncs:name=current()/../deviceA]/ncs:platform/ncs:name = 'ios-xr'";
          leaf Giga_xr {
            type leafref {
              path "/ncs:devices/ncs:device[ncs:name=current()/../deviceA]/ncs:config/cisco-iosxr:interface/cisco-iosxr:GigabitEthernet/cisco-iosxr:id";
            }
          }
        }
      }

}&lt;/PRE&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 May 2019 10:43:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/nso-when-statement-with-xpath-on-yang-file/m-p/3861502#M3812</guid>
      <dc:creator>Maurizio Bau</dc:creator>
      <dc:date>2019-05-23T10:43:03Z</dc:date>
    </item>
    <item>
      <title>Re: NSO: When statement with xpath on yang file</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/nso-when-statement-with-xpath-on-yang-file/m-p/3861613#M3814</link>
      <description>&lt;P&gt;There are two issues here. The first one is in the Makefile (which you are not showing). You need to add to the YANGPATH so that the compiler can find the modules you are importing. In a standard NSO example Makefile, you can add at the top (for each NED you are importing):&lt;/P&gt;
&lt;P&gt;YANGPATH += ../../&amp;lt;ned-name&amp;gt;/src/ncsc-out/modules&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The other problem is that the when expression path to deviceA is incorrect. You need to remove ../ after your call to current. I know this may not be completely intuitive, but choice and case don't count as data nodes (do a get-config and see for yourself).&lt;/P&gt;
&lt;P&gt;when "/ncs:devices/ncs:device[ncs:name=current()/deviceA]/ncs:platform/ncs:name = 'ios'";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 13:43:32 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/nso-when-statement-with-xpath-on-yang-file/m-p/3861613#M3814</guid>
      <dc:creator>Jan Lindblad</dc:creator>
      <dc:date>2019-05-23T13:43:32Z</dc:date>
    </item>
    <item>
      <title>Re: NSO: When statement with xpath on yang file</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/nso-when-statement-with-xpath-on-yang-file/m-p/3861671#M3816</link>
      <description>&lt;P&gt;Hi Jan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your replay.&lt;/P&gt;&lt;P&gt;I corrected makefile and yang file, please see the attached rar files for check.&lt;/P&gt;&lt;P&gt;My neds folder are showed in the following screen schot&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ned Folder.jpg" style="width: 891px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/37330i7CF0DF17CB88ECD4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Ned Folder.jpg" alt="Ned Folder.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;When i re-try make command, following error&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[nso@itminso src]$ make
/home/nso/NSO-4.3.6/bin/ncsc  `ls OPM-IF-ann.yang  &amp;gt; /dev/null 2&amp;gt;&amp;amp;1 &amp;amp;&amp;amp; echo "-a OPM-IF-ann.yang"` \
             --yangpath ../../cisco-ios/src/ncsc-out/modules/yang --yangpath ../../cisco-ios-xr/src/yang -c -o ../load-dir/OPM-IF.fxs yang/OPM-IF.yang
../../cisco-ios/src/ncsc-out/modules/yang/tailf-ned-cisco-ios.yang:114976: warning: when tailf:cli-drop-node-name is given, it is recommended that tailf:cli-suppress-mode is used in combination. using tailf:cli-drop-nodename in a list child without using tailf:cli-suppress-mode on the list, might lead to confusing behaviour, where the user enters the submode without being able to give further configuration.
../../cisco-ios/src/ncsc-out/modules/yang/tailf-ned-cisco-ios.yang:124245: warning: when tailf:cli-drop-node-name is given, it is recommended that tailf:cli-suppress-mode is used in combination. using tailf:cli-drop-nodename in a list child without using tailf:cli-suppress-mode on the list, might lead to confusing behaviour, where the user enters the submode without being able to give further configuration.
&lt;EM&gt;&lt;STRONG&gt;yang/OPM-IF.yang:19: error: module 'tailf-ned-cisco-iosxr' not found
yang/OPM-IF.yang:65: error: the node 'interface' from module 'tailf-ned-cisco-iosxr' (in node 'config' from 'tailf-ncs') is not found
make: *** [../load-dir/OPM-IF.fxs] Error 1&lt;/STRONG&gt;&lt;/EM&gt;
[nso@itminso src]$ &lt;/PRE&gt;&lt;P&gt;Do you any idea?&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;Maurizio&lt;/P&gt;</description>
      <pubDate>Thu, 23 May 2019 14:34:20 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/nso-when-statement-with-xpath-on-yang-file/m-p/3861671#M3816</guid>
      <dc:creator>Maurizio Bau</dc:creator>
      <dc:date>2019-05-23T14:34:20Z</dc:date>
    </item>
    <item>
      <title>Re: NSO: When statement with xpath on yang file</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/nso-when-statement-with-xpath-on-yang-file/m-p/3864472#M3836</link>
      <description>Hi Jan and Hi All&lt;BR /&gt;i found a solution about Jan's indication and in particular&lt;BR /&gt;- Correct yang xpath statement on when condition&lt;BR /&gt;- Insert in a make file following section&lt;BR /&gt;...&lt;BR /&gt;YANGPATH += /home/nso/NSO-4.3.6/packages/neds/cisco-ios/src/yang \&lt;BR /&gt;/home/nso/NSO-4.3.6/packages/neds/cisco-iosxr/src/yang \&lt;BR /&gt;/home/nso/NSO-4.3.6/packages/neds/cisco-ios/src/ncsc-out/modules/yang \&lt;BR /&gt;/home/nso/NSO-4.3.6/packages/neds/cisco-iosxr/src/ncsc-out/modules/yang&lt;BR /&gt;&lt;BR /&gt;....&lt;BR /&gt;&lt;BR /&gt;With this section, when i lanch a make command, i've more warning but nothing error and the packages work fine.&lt;BR /&gt;&lt;BR /&gt;Thanks Jan&lt;BR /&gt;Bye&lt;BR /&gt;Maurizio&lt;BR /&gt;</description>
      <pubDate>Wed, 29 May 2019 13:13:28 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/nso-when-statement-with-xpath-on-yang-file/m-p/3864472#M3836</guid>
      <dc:creator>Maurizio Bau</dc:creator>
      <dc:date>2019-05-29T13:13:28Z</dc:date>
    </item>
  </channel>
</rss>

