Tailf:export not working when given outside its module

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

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

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

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

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

Try

$ confdc -c --export cli --export netconf ...

MAAPI will always have access

Hi Cohult, Thank you so much for the support.