Restricting list of IDENTITIES on YANG

There is a list of entries defined in a IDENTITY list in a standard YANG model (IETF model). Not all of them are supported.

How can this be restricted from being displayed to User on CLI?
Is there a way via YANG deviations or TAIL-F extensions?

We already tried “REFINE” in YANG and “tailf:cli-disallow-value”. These still display the un-supported IDENTITIES to user and then dis-allow. Is there a way to restrict the display itself.

thanks in advance

Have you looked at the feature/if-feature standard YANG-statements? Once you have tagged identities, in this case, with if-feature statements you can enable/disable support with the --feature option to confdc.

The if-feature statement is a compile time way to trim certain nodes in the tree.
It can also be used for identities.

But if you want this to be decided during runtime (Example: Based on some other configuration elements), I suggest you implement a completion callback to control what values should be displayed to the CLI user.

You can find more details and an example of how to implement this in the user guide:
16.12.1. Customizing CLI completion

Thanks Jonas, Nabil.

The list is shared amongst 2 different features at runtime so the if-feature would not work.

Completion callback is the next option to try. Should work.