ashik
March 24, 2023, 10:11am
1
Hi Team,
I am trying to restrict quite number of yang models using tailf:export for various NBI.
So i constructed a new yang just for this purpose.
One observation I see is,
module tailf-aaa {
..
tailf:export none;
..
}
The above is working when tailf:export is given directly inside the module.
whereas in below newly constructed yang, it fails,
module hide {
tailf:annotate-module "tailf-aaa"
{
tailf:export none;
}
tailf:annotate-module "tailf-acm"
{
tailf:export none;
}
}
Kindly clarify and help on the same…
Regards,
Ash
cohult
March 27, 2023, 9:48am
2
From the confdc(1) man page:
-a, --annotate
AnnotationFile
YANG users that are utilizing the tailf:annotate extension must use
this flag to indicate the YANG annotation file(s).
See for example the examples.confd/nmda/05-hardware-management/Makefile on how that is done with an annotation file that uses tailf:annotate-module
ashik
March 28, 2023, 6:12am
3
Hi Cohult,
Actually I need to hide all the confD provided yang modules for NETCONF such as ‘tailf-netconf-monitoring’, ‘tailf-netconf-query’, ‘tailf-netconf-extensions’ etc. I dont wish to have it visible to NETCONF. So i am trying to annotate all these Confd provided modules and also some needed modules in one single annotate yang.
But i keep getting error like below,
#confdc -c -a hidden-ann.yang hidden.yang
…
…
hidden-ann.yang:92: warning: Module ‘tailf-netconf-extensions’ not found.
hidden-ann.yang:97: warning: Module ‘tailf-netconf-monitoring’ not found.
hidden-ann.yang:102: warning: Module ‘tailf-netconf-query’ not found.
My annotate file changes,
tailf:annotate-module "tailf-meta-extensions"
{
tailf:export none;
}
tailf:annotate-module "tailf-netconf-extensions"
{
tailf:export none;
}
tailf:annotate-module "tailf-netconf-monitoring"
{
tailf:export none;
}
tailf:annotate-module "tailf-netconf-query"
{
tailf:export none;
}
Regards,
Ash
cohult
March 28, 2023, 7:41am
4
Hi Ash,
As the example I pointed to previously show, you need to compile the annotation YANG module with the YANG module you want to annotate:
$ confdc -c -a tailf-netconf-extensions-hidden-ann.yang tailf-netconf-extensions.yang
...
or, a simpler way, if your goal is to not export the YANG module, is to use the confdc --export
flag:
$ confdc -c --export none --output $CONFD_DIR/etc/confd/tailf-netconf-extensions.fxs tailf-netconf-extensions.yang
...
Regards
ashik
March 29, 2023, 4:10pm
5
Hi Cohult,
Thanks for your suggestion and it works.
I would like to have it exposed for both maapi and as well as CLI.
Is this a valid one ? (Adding required NBI using comma)
$ confdc -c --export maapi,cli --output $CONFD_DIR/etc/confd/abc.fxs abc.yang
Regards,
Ash
cohult
March 29, 2023, 5:34pm
6
Try
$ confdc -c --export cli --export netconf ...
MAAPI will always have access
ashik
March 31, 2023, 5:45am
7
Hi Cohult, Thank you so much for the support.