At Aviat we've been using deviations for this: module aviat-ietf-interfaces-dev { // ...
deviation "/if:interfaces/if:interface" { deviate add { must "if:type = 'ianaift:l2vlan' or if:type = 'ianaift:ethernetCsmacd' or if:type = 'rl:radio-link-terminal' or if:type = 'rl:carrier-termination' or if:type = 'ianaift:ieee8023adLag'"; } } } ________________________________________ From: netmod <netmod-boun...@ietf.org> on behalf of Vladimir Vassilev <vladi...@transpacket.com> Sent: Wednesday, 30 November 2016 11:05 p.m. To: Jan Lindblad; netmod@ietf.org Subject: Re: [netmod] How to prevent a client from modifying the type of an interface? On 11/29/2016 05:18 PM, Jan Lindblad wrote: > Bart, > > Jürgen et al are of course right in what they say, but if you really > want to use YANG to enable a manager to know a priori what values are > possible for a particular leaf somewhere, that's easy too -- if you > see the addition of a new proprietary YANG module as a possibility. > > module device-limitations { > ... > container limitations { > must > "not(/if:interfaces/if:interface[not(if:type='ianaift:fastdsl')])" { > error-message "There must not be any interfaces that are not of > fastdsl interface type"; > } > } > } +1. We use the same approach for defining device specific limitations in YANG. _______________________________________________ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod _______________________________________________ netmod mailing list netmod@ietf.org https://www.ietf.org/mailman/listinfo/netmod