# Hide display of data

**URL:** <https://dmap-community.ductus.global/t/hide-display-of-data/332>\
**Category:** YANG\
**Created:** [December 19, 2015, 4:14pm UTC](https://dmap-community.ductus.global/t/hide-display-of-data/332 "2015-12-19T16:14:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![moorthymbm](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@moorthymbm](https://dmap-community.ductus.global/u/moorthymbm)\
**Post date:** [December 19, 2015, 4:14pm UTC](https://dmap-community.ductus.global/t/hide-display-of-data/332/1 "2015-12-19T16:14:24Z")

</div>

Hi,

I have yang model as below,  
container A {  
config false;  
callpoint a1;  
leaf 1 {  
}  
leaf 2 {  
}  
leaf 3{  
}  
container B {  
callpont b1;  
leaf 5;  
leaf 6;  
leaf 7;  
}  
container C {  
callpoint c1;  
leaf 5;  
leaf 6;  
leaf 7;  
}  
}

If I give show A,

It displays all the datum under A. But I need only leaf 1,2,3. How to hide container b and container c?

Any idea?  
Please suggest…

Thanks in advance.,  
Banumoorthy M

---

<div class="post-metadata">

**Author:** ![waitai](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/waitai/32/436_2.png) [@waitai](https://dmap-community.ductus.global/u/waitai)\
**Post date:** [December 21, 2015, 1:32am UTC](https://dmap-community.ductus.global/t/hide-display-of-data/332/2 "2015-12-21T01:32:06Z")

</div>

You can use the tailf:hidden statement to hide any part of your data model. Refer to Chapter 3.9, Hidden Data, for more information of this feature.

An alternative is to customize the auto-rendered show output as was suggested in your other post titled: [Key value handling between datahandler and yang model](https://discuss.tail-f.com/t/key-value-handling-between-datahandler-and-yang-model/331).

---

<div class="post-metadata">

**Author:** ![moorthymbm](https://avatars.discourse-cdn.com/v4/letter/m/977dab/32.png) [@moorthymbm](https://dmap-community.ductus.global/u/moorthymbm)\
**Post date:** [December 31, 2015, 3:33am UTC](https://dmap-community.ductus.global/t/hide-display-of-data/332/3 "2015-12-31T03:33:53Z")

</div>

Hi Wai,

For the above mentioned yang model,  
If I give show A,  
It should display 1,2,3  
And if I give show A B,  
it should display 5,6,7  
And if I give show A C  
it should display 5,6,7 respective to container C

Thanks in advance,  
Banumoorthy M

---

<div class="post-metadata">

**Author:** ![waitai](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/waitai/32/436_2.png) [@waitai](https://dmap-community.ductus.global/u/waitai)\
**Post date:** [January 4, 2016, 11:40pm UTC](https://dmap-community.ductus.global/t/hide-display-of-data/332/4 "2016-01-04T23:40:00Z")

</div>

You can use the show templates feature as described in Chapter 16.27.2, Show templates, of the ConfD 6.0 User Guide to customize the output of the show command to implement your use case.

If you modify your YANG model as follows:

```
module ABC {
  namespace "http://example.com/ns/ABC";
  prefix abc;

  import tailf-common {
  prefix tailf;
}

  container A {
    config false;
    tailf:cli-show-template
      "$(/A/l1?$(l1|ljust:1) )"
      +"$(/A/l2?$(l2|ljust:1) )"
      +"$(/A/l3?$(l3|ljust:1))\n";
    leaf l1 {
      type int32;
    }
    leaf l2 {
      type int32;
    }
    leaf l3{
      type int32;
    }

    container B {
      tailf:cli-show-template
        "$(/A/B/l4?$(l4|ljust:1) )"
        +"$(/A/B/l5?$(l5|ljust:1) )"
        +"$(/A/B/l6?$(l6|ljust:1))\n";
      leaf l4 {
        type int32;
      }
      leaf l5 {
        type int32;
      }
      leaf l6 {
        type int32;
      }
    }

    container C {
      tailf:cli-show-template
        "$(/A/C/l7?$(l7|ljust:1) )"
        +"$(/A/C/l8?$(l8|ljust:1) )"
        +"$(/A/C/l9?$(l9|ljust:1))\n";
      leaf l7 {
        type int32;
      }
      leaf l8 {
         type int32;
      }
      leaf l9 {
        type int32;
      }
    }
  }
}

```

When you run confd with the above YANG model and with the operational data initialized, the cli output will now look as follows:

```
admin connected from 127.0.0.1 using console on WAITAI-M-K092
admin@WAITAI-M-K092> show A
1 2 3
[ok][2016-01-04 15:36:53]
admin@WAITAI-M-K092> show A B
5 6 7
[ok][2016-01-04 15:37:00]
admin@WAITAI-M-K092> show A C
5 6 7
[ok][2016-01-04 15:37:02]
admin@WAITAI-M-K092>
```

---

<div class="post-metadata">

**Author:** ![msrinivas20](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@msrinivas20](https://dmap-community.ductus.global/u/msrinivas20)\
**Post date:** [September 14, 2016, 12:31pm UTC](https://dmap-community.ductus.global/t/hide-display-of-data/332/5 "2016-09-14T12:31:46Z")

</div>

I want to add yang model something like,

the leaf should not show in CLI, but in show runnning-config

I tried,

```
    leaf myname {
        tailf:cli-show-config;
        view:pathmap "rtmindex";
        config false;
       type uint32;
        }

```

but not working

---

<div class="post-metadata">

**Author:** ![waitai](https://yyz2.discourse-cdn.com/flex010/user_avatar/dmap-community.ductus.global/waitai/32/436_2.png) [@waitai](https://dmap-community.ductus.global/u/waitai)\
**Post date:** [September 14, 2016, 9:23pm UTC](https://dmap-community.ductus.global/t/hide-display-of-data/332/6 "2016-09-14T21:23:26Z")

</div>

It works for me when I tried the following YANG snippet:

```
container mycontainer {
  config false;
  leaf myname {
    tailf:cli-show-config;
    type uint32;
  }
}

```

which resulted in the following CLI behavior:

```
localhost# show running-config | include mycontainer
mycontainer myname 30

```

It’s worth mentioning that mycontainer won’t show up as a possible selection when you do “show running-config ?” as it isn’t configuration data, but it will show up as a line item in the output of “show running-config”.
