How to hide "identity" when identityref are being used


I want to hide, one of the STP protocol from the enabled protocol list.
Problem is that it is defined as identity and used with identityref so I am doubtful if deviation can work, I need to take full openconfig and remove protol from it.
I could not find any option like hidden, in the guide.

Is there any option I can use to hide protocol from displaying in the configuration :slight_smile:

# stp global config enabled-protocol <tab>
Possible completions:

leaf-list enabled-protocol {
type identityref {
base oc-stp-types:STP_PROTOCOL;

 " base oc-stp-types:STP_PROTOCOL" is defined in 

public/openconfig-spanning-tree-types.yang at master · openconfig/public · GitHub.
identity RAPID_PVST {
“Rapid Per Vlan Spanning Tree Protocol”;

One more doubt on similar area -
What is use of status in identity, what will happen if I mark any identity as obsolete?

If what bothers you is that “STP” can be configured, you can “deviate in” a must statement that forbids the value for the leaf-list. If you do not want the value to be offered during tab-completion, you can implement your own completion callback for the type or for the leaf-list. I am not aware of any way of removing the identity without modifying the YANG module.

If you add something like “status obsolete” to an identity, you can disable it too if you compile the module with e.g. --max-status deprecated; but then again, I don’t think you can add the status statement to an identity without modifying the module.

Thanks for suggestions, I think throwing error with constraint can be used here.