09-24-2019 12:55 AM
We are using some internal yang files which should not be exposed via Netconf ( shouldn`t be even showed as part of capability exchange.)
How to do this ?
(tailf:hidden doesn`t works in module level)
09-24-2019 04:06 AM - edited 09-24-2019 04:18 AM
It's possible to compile the YANG file to not be exported to any agent with e.g.
ncsc --export none -c -o md.fxs md.yang
or explicitly list the agents that should export the model.
Another way to achieve the same thing is to annotate the YANG model with an annotation file e.g. md-ann.yang
module md-ann {
namespace "urn:dummy";
prefix dummy;
import tailf-common {
prefix tailf;
}
tailf:annotate-module 'md' {
tailf:export none;
}
}
This is then used when compiling
ncsc -a md-ann.yang -c -o md.fxs md.yang
Both mechanism shown above effectively removes the module from the NETCONF hello capability listing, netconf-state, and also the YANG library. It is however still listed in /ncs-state/loaded-data-models.
09-24-2019 08:37 AM
Thanks. That worked fine.
How to hide tailf related yang files ?
09-25-2019 02:01 AM
09-26-2019 02:18 AM
We are bundling yang files using the below command to create ncs-device-type netconf.
ncsc --ncs-compile-bundle ... --ncs-device-type netconf --ncs-device-dir ...
But, the "--export" option is not available for this command.
Even we specify "tailf:export none:" in the yang file,they are getting exported.
Any known issues ?
09-26-2019 03:07 AM - edited 09-26-2019 03:08 AM
I tried with a toy example
ncsc --ncs-compile-bundle . --ncs-device-dir . --ncs-device-type ... ... --export none
And it worked.
I see that '--export' is not listed together with '--ncs-compile-bundle' in the usage output, but it seems to work.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide