Lohit raj
Lohit raj

Reputation: 23

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?

Upvotes: 0

Views: 621

Answers (1)

Jeyashree
Jeyashree

Reputation: 26

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

Upvotes: 1

Related Questions