How to add restriction to a integer leaf with set of values in yang

461 Views Asked by At

I want to set restriction to my yang leaf I tried something like this

 leaf remind-me-before {
     tailf:info "Remind me before value";
         type uint16 {
              range "30, 25, 10, 5, 7";
         }    
     }
  }

but it throws an error saying error: bad argument value "30, 25, 10, 5, 7", should be of type range-arg

Can someone say how to achieve this?

1

There are 1 best solutions below

3
On BEST ANSWER

Please use the syntax as below -

leaf remind-me-before {
     tailf:info "Remind me before value";
         type uint16 {
              range "30 | 25 | 10 | 5 | 7"; >>> separated by '|'
         }    
     }
  }