<?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: Recommended way to import external yang in NSO Developer Hub Discussions</title>
    <link>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899667#M4095</link>
    <description>Have you added to the yang path in the makefile? So that it can reach all the files. &lt;BR /&gt;</description>
    <pubDate>Tue, 30 Jul 2019 02:06:53 GMT</pubDate>
    <dc:creator>vleijon</dc:creator>
    <dc:date>2019-07-30T02:06:53Z</dc:date>
    <item>
      <title>Recommended way to import external yang</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899416#M4089</link>
      <description>&lt;P&gt;I am looking over the guides and trying to find information on the correct way to use external yang files. For example, lets say I do not want to recreate ethernet-groupings for XE and just want to import Cisco's submodule&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Cisco-IOS-XE-interfaces&amp;nbsp;&lt;/PRE&gt;&lt;P&gt;and from there use the grouping&lt;/P&gt;&lt;PRE&gt;grouping ethernet-grouping&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Would I just copying over the "Cisco-IOS-XE-interfaces" over to the "/opt/ncs/ncs-4.7.3.1/src/ncs/yang" folder that contains all the other default talif/ietf yang files and then import it into my yang?&lt;/P&gt;&lt;PRE&gt;module TESTPKG {

  namespace "http://example.com/TESTPKG";
  prefix TESTPKG;

  import Cisco-IOS-XE-native {
    prefix xe;
  }
}&lt;/PRE&gt;&lt;P&gt;Is this recommended our is a better method preferred over copying the source yang files? Or is it better to use the ios-ned and create choices/groupings similar to the accepted solution in this &lt;A href="https://community.cisco.com/t5/nso-developer-hub-discussions/how-can-i-reference-existing-interface-types-interfaces/td-p/3537469" target="_self"&gt;thread&lt;/A&gt;?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 16:44:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899416#M4089</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2019-07-29T16:44:41Z</dc:date>
    </item>
    <item>
      <title>Re: Recommended way to import external yang</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899500#M4092</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You do not need to "copy and paste", you could simply write:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;uses xe:ethernet-grouping&lt;/PRE&gt;
&lt;P&gt;Now, this only works because ethernet-grouping is was originally grouped. What if it wasn't? Well, there is a YANG Schema Mount standard just out of the IETF (RFC 8528) but NSO only supports it for the NEDs but not for other packages.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 19:01:29 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899500#M4092</guid>
      <dc:creator>rogaglia</dc:creator>
      <dc:date>2019-07-29T19:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Recommended way to import external yang</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899653#M4094</link>
      <description>&lt;P&gt;Just read over the Yang Schema mount rfc, looks very handy. Any plans to release it to more than NEDS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I must be missing something trivial on getting external yang files to work in my package. I created the following structure to test a custom yang file in the /opt/ncs/current/src/ncs/yang directory.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;/opt/ncs/ncs-4.7.2/src/ncs/yang/
└── test-external-pkg.yang

module test-external-pkg {

  namespace "http://example.com/test-external-pkg";
  prefix tpext;

}&lt;/PRE&gt;&lt;P&gt;When I run make on my test package src folder it comes back fine. When I went to reload NSO I got a namespace error. I tried adding it as a required-package in the package-meta-data.xml, thinking this is not the right approach but I find a similar error on this &lt;A href="https://community.cisco.com/t5/nso-developer-hub-discussions/nso-package-reload-error-missing-namespace/td-p/3828899" target="_self"&gt;post&lt;/A&gt; so I tried it.&lt;/P&gt;&lt;PRE&gt;&amp;lt;ncs-package xmlns="http://tail-f.com/ns/ncs-packages"&amp;gt;
  &amp;lt;name&amp;gt;testpkg&amp;lt;/name&amp;gt;
  &amp;lt;package-version&amp;gt;1.0&amp;lt;/package-version&amp;gt;
  &amp;lt;description&amp;gt;Generated Python package&amp;lt;/description&amp;gt;
  &amp;lt;ncs-min-version&amp;gt;4.7&amp;lt;/ncs-min-version&amp;gt;
  &amp;lt;required-package&amp;gt;
     &amp;lt;name&amp;gt;test-external-pkg&amp;lt;/name&amp;gt;
  &amp;lt;/required-package&amp;gt;
  &amp;lt;component&amp;gt;
    &amp;lt;name&amp;gt;main&amp;lt;/name&amp;gt;
    &amp;lt;application&amp;gt;
      &amp;lt;python-class-name&amp;gt;testpkg.main.Main&amp;lt;/python-class-name&amp;gt;
    &amp;lt;/application&amp;gt;
  &amp;lt;/component&amp;gt;
&amp;lt;/ncs-package&amp;gt;&lt;/PRE&gt;&lt;P&gt;The reload gives the error that the package is undefined so I must be missing a piece since this isn't a package, only a single yang file.&lt;/P&gt;&lt;PRE&gt;Error: Failed to load NCS package: testpkg; required package test-external-pkg of version undefined is not present (found none)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 01:42:32 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899653#M4094</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2019-07-30T01:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Recommended way to import external yang</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899667#M4095</link>
      <description>Have you added to the yang path in the makefile? So that it can reach all the files. &lt;BR /&gt;</description>
      <pubDate>Tue, 30 Jul 2019 02:06:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899667#M4095</guid>
      <dc:creator>vleijon</dc:creator>
      <dc:date>2019-07-30T02:06:53Z</dc:date>
    </item>
    <item>
      <title>Re: Recommended way to import external yang</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899692#M4096</link>
      <description>&lt;P&gt;I put my custom test-external-pkg.yang into the &lt;STRONG&gt;/opt/ncs/current/src/ncs/yang&lt;/STRONG&gt; directory where all the other default yang files ( for example ietf-inet-types.yang)&lt;/P&gt;&lt;P&gt;Then ran the &lt;STRONG&gt;make&lt;/STRONG&gt; command, it created my test-external-pkg.fxs inside of the &lt;STRONG&gt;/opt/ncs/current/src/ncs/yang&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;After watching the debug logs of NSO trying to start I noticed that all the other default .fxs files were located in:&lt;/P&gt;&lt;PRE&gt;/opt/ncs/ncs-4.7.2/etc/ncs/&lt;/PRE&gt;&lt;P&gt;I manually moved my test-external-pkg.fxs to that above directory and it worked.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;sudo mv /opt/ncs/current/src/ncs/yang/test-external-pkg.fxs /opt/ncs/ncs-4.7.2/etc/ncs/&lt;/PRE&gt;&lt;P&gt;Still looking for docs on the correct process of adding a custom yang then getting the .fxs to create in the proper load directory. Thinking something with the way I am running the make command.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jul 2019 03:35:59 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3899692#M4096</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2019-07-30T03:35:59Z</dc:date>
    </item>
    <item>
      <title>Re: Recommended way to import external yang</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3900004#M4100</link>
      <description>Looks like you can add dirs as load paths in nso.conf. I think my process now is to create yangs, run make command to get the .fxs and move it to the load directory specified in ncs.conf&lt;BR /&gt;&lt;BR /&gt;&amp;lt;load-path&amp;gt;&lt;BR /&gt;&amp;lt;dir&amp;gt;./packages&amp;lt;/dir&amp;gt;&lt;BR /&gt;&amp;lt;dir&amp;gt;${NCS_DIR}/etc/ncs&amp;lt;/dir&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!-- To disable northbound snmp altogether --&amp;gt;&lt;BR /&gt;&amp;lt;!-- comment out the path below --&amp;gt;&lt;BR /&gt;&amp;lt;dir&amp;gt;${NCS_DIR}/etc/ncs/snmp&amp;lt;/dir&amp;gt;&lt;BR /&gt;&amp;lt;/load-path&amp;gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Jul 2019 13:11:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3900004#M4100</guid>
      <dc:creator>tsiemers1</dc:creator>
      <dc:date>2019-07-30T13:11:53Z</dc:date>
    </item>
    <item>
      <title>Re: Recommended way to import external yang</title>
      <link>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3900103#M4103</link>
      <description>In your Makefile for your package, you can update the YANGPATH to include the path to the yang files you need.&lt;BR /&gt;&lt;BR /&gt;In each package there is a load-dir where fxs files are loaded. The default makefile for a package places the fxs files there.&lt;BR /&gt;</description>
      <pubDate>Tue, 30 Jul 2019 15:15:53 GMT</pubDate>
      <guid>https://community.cisco.com/t5/nso-developer-hub-discussions/recommended-way-to-import-external-yang/m-p/3900103#M4103</guid>
      <dc:creator>vleijon</dc:creator>
      <dc:date>2019-07-30T15:15:53Z</dc:date>
    </item>
  </channel>
</rss>

