cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
900
Views
0
Helpful
0
Replies

restricting a leafref type with pattern

kerim mohammed
Level 3
Level 3

Hi,

 

I am looking for ways of restricting a leafref type particularly using regular expression for a leafref node/element. looks like patter statement don't work with leafref. The idea is to narrow down list of devices being displayed by putting some kind of restriction on the name key element:

 

leaf-list leafs {
type leafref {
path "/ncs:devices/ncs:device/ncs:name";
pattern "[a-lA-L-_]*(Leaf|LEAF)[0-9]+";
}
}

 

error message:

yang/dcrouting.yang:36: error: restriction 'pattern' is not valid for the base type

 

any suggestion?

 

Thanks,

Kerim

0 Replies 0