Hi,
I was working on it and got a use case where I want to put range conditionally.
Ex. set user configurable maximum windows devices range from 1-5 and linux devices range from 1-10.
How to display range in confd cli like below :
test(config)#router ABC config platform windows max-devices ?
Description: No of devices can be connected.
Possible completions:
<unsignedShort, 1 … 5>
test(config)#router ABC config platform linux max-devices ?
Description: No of devices can be connected.
Possible completions:
<unsignedShort, 1 … 10>
I tried to use display-when, when and must but seems all works on leaf but here its required to put on type.
So below one is failing.
leaf max-devices {
type uint16{
display-when "../paltform='windows'";
range "1..5";
}
type uint16{
display-when "../paltform='linux'";
range "1..10";
}
}
One possible solution is to put range from 1 to 10 and validate it in code. But I am curious if above requirement can be solved in confd schema itself.
Any suggestion will be helpful for me.
Thanks.