To get OR combination of keys

Hi,

I have done yang model for employee db.
list employee {
leaf name {
type string;
}
leaf empno {
type int32;
}
leaf grade {
type string;
}
}
For above yang model,

I need the output as,
show employee <name|no>

If I have key as “name no” or “no name”, It prompts me to enter name before no or vice-versa.
But my requirement is to enter only no, without giving any value to name or else name without giving no.
I have referred one topic called “How to define YANG list with multiple optional keys”. But I need to have model without entering * to the primary key…
How can I handle OR key option…

Any idea…please suggest…

Thanks in advance,
Banumooorthy M

From your description of the show command requirement, it appears that you are designing an operational data list. But then your YANG model is lacking a “config false;” statement for the employee list.

For operational data lists, you can define them without keys as is described in Chapter 6.11, Operational data lists without keys, of the ConfD 6.0 User Guide. An example show output of an operational data list without keys is as follows:

WAITAI-M-K092# show employee 
NAME  EMPNO  GRADE      
------------------------
john  100    associate  

WAITAI-M-K092# show employee name john
NAME  EMPNO  GRADE      
------------------------
john  100    associate  

WAITAI-M-K092# show employee empno 100
NAME  EMPNO  GRADE      
------------------------
john  100    associate