ConfD User Community

Display-group nodes are being shown in parent level


#1

I have tried the example yang model

container arp {
    config false;
    tailf:callpoint jarp_data;
    list arpe {
      key "ip ifname";
      max-elements 1024;
      tailf:display-groups "none summary details";

      leaf ip {
        type inet:ip-address;
      }
      leaf ifname {
        type string;
      }
      leaf hwaddr {
        type string;
        mandatory true;
        tailf:display-groups "none summary details";
      }
      leaf permanent {
        type boolean;
        mandatory true;
        tailf:display-groups "none details";
      }
      leaf published {
        type boolean;
        mandatory true;
        tailf:display-groups "details";
      }
    }
  }

The cli looks like

root@localhost 01:51:49> show arp
Possible completions:
  arpe         -
  details      -
  displaylevel - Depth to show
  summary      -

We have configured display-groups inside a list ‘arpe’ but why they are being shown in possible completions of container ‘arp’.
I don’t want ‘details’ and ‘summary’ to be shown under container arp. Is there any way we can do that?


#2

Yeah, I have also faced this problem. Anyone knows the solution for this?


#3

Got a solution for this.
Remove “tailf:display-groups” in list and configure only for leaves.It worked for me. Atleast display-group names were not showing in the parent level :slight_smile:


#4

Follow up question for the same scenario
SInce the nodes ‘arpe’, ‘details’ and ‘summary’ are being shown in possible completions

Is there any way that we can add ‘tailf:info’ for those display group nodes?


#5

@per @cohult @mnovak Do you know a solution for this?


#6

You can add a tail:info statement for the list arpe. It will display the information:
Example:

admin@localhost> show arp ?
Description: This is the arp node
Possible completions:
arpe - This is the arpe list
details -

I don’t think there is a way to specify “tail:info” for the display-groups.
“details -” doesn’t look good here, without an info text.
I understand why it would make sense to add a way to specify the info text for display groups.

But there is a workaround, using a completion callback. It would require writing minimal code.
Look for: “/clispec/$MODE/modifications/completion” in the user guide and also the example: examples.confd/cli/completion.