# Tailf:export not working when given outside its module

**URL:** https://dmap-community.ductus.global/t/tailf-export-not-working-when-given-outside-its-module/4385
**Category:** YANG
**Created:** [March 24, 2023, 10:11am UTC](https://dmap-community.ductus.global/t/tailf-export-not-working-when-given-outside-its-module/4385 "2023-03-24T10:11:40Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![ashik](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@ashik](https://dmap-community.ductus.global/u/ashik)
#### Post date: [March 24, 2023, 10:11am UTC](https://dmap-community.ductus.global/t/tailf-export-not-working-when-given-outside-its-module/4385/1 "2023-03-24T10:11:40Z")

</div>

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,

```plaintext
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,

```plaintext
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

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [March 27, 2023, 9:48am UTC](https://dmap-community.ductus.global/t/tailf-export-not-working-when-given-outside-its-module/4385/2 "2023-03-27T09:48:34Z")

</div>

From the confdc(1) man page:

```auto
-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`

---

<div class="post-metadata">

### Author: ![ashik](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@ashik](https://dmap-community.ductus.global/u/ashik)
#### Post date: [March 28, 2023, 6:12am UTC](https://dmap-community.ductus.global/t/tailf-export-not-working-when-given-outside-its-module/4385/3 "2023-03-28T06:12:55Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [March 28, 2023, 7:41am UTC](https://dmap-community.ductus.global/t/tailf-export-not-working-when-given-outside-its-module/4385/4 "2023-03-28T07:41:41Z")

</div>

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:

```auto
$ 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:

```auto
$ confdc -c --export none --output $CONFD_DIR/etc/confd/tailf-netconf-extensions.fxs tailf-netconf-extensions.yang
...

```

Regards

---

<div class="post-metadata">

### Author: ![ashik](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@ashik](https://dmap-community.ductus.global/u/ashik)
#### Post date: [March 29, 2023, 4:10pm UTC](https://dmap-community.ductus.global/t/tailf-export-not-working-when-given-outside-its-module/4385/5 "2023-03-29T16:10:49Z")

</div>

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

---

<div class="post-metadata">

### Author: ![cohult](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/cohult/32/221_2.png) [@cohult](https://dmap-community.ductus.global/u/cohult)
#### Post date: [March 29, 2023, 5:34pm UTC](https://dmap-community.ductus.global/t/tailf-export-not-working-when-given-outside-its-module/4385/6 "2023-03-29T17:34:24Z")

</div>

Try

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

```

MAAPI will always have access

---

<div class="post-metadata">

### Author: ![ashik](https://avatars.discourse-cdn.com/v4/letter/a/b5e925/32.png) [@ashik](https://dmap-community.ductus.global/u/ashik)
#### Post date: [March 31, 2023, 5:45am UTC](https://dmap-community.ductus.global/t/tailf-export-not-working-when-given-outside-its-module/4385/7 "2023-03-31T05:45:17Z")

</div>

Hi Cohult, Thank you so much for the support.
