On Mon, Sep 26, 2016 at 06:50:50PM +0000, JOEY BOYD wrote:
> Hi all,
> 
> I have a question regarding conditional default values. For example, suppose 
> we have this modeled definition of a thing.
> 
> container thing {
> 
>   leaf a {
>     type uint8 {
>       range "1..2";
>     }
>   }
> 
>   leaf b {
>     type uint8 {
>       range "1..100";
>     }
>   }
> }
> 
> The 'thing' is described in some underlying standard which states that if 'a' 
> is equal to 1, the default value of 'b' is 50 while if 'a' is equal to 2, the 
> default value of 'b' is 100. Note that all values 1-100 are valid for 'b' 
> regardless of 'a'. We are only discussing defaults. Can such a constraint be 
> modeled? My initial thinking is that it cannot but wanted to query this group 
> to see if it is possible.
>

Yes, your thinking is correct - this can't be expressed formally in
YANG. You have to write things down in a description statement.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to