Search code examples
yang

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


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?


Solution

  • 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 '|'
             }    
         }
      }