On Tue, Feb 21, 2017 at 10:02 PM, Zhengguangying (Walker) <
[email protected]> wrote:

> Hi Andy,
>
>
>
>     Thanks for your reply, my mean is not make the “Deviations be
> conditional”, but want to add “when” statements to exist module
> definition,  because vendor may cannot support all specifications defined
> in IETF-YANG but need to add some constrains.
>
>
>

YANG deviations do not support when-stmt at all.
You can add and delete must-stmts (but not replace them
(replace can be done with delate + add).

You cannot add, delete, or replace a when-stmt.
Add is not allowed since only 1 when-stmt per data node is permitted.
I don't see any reason why replace and delete should have been left out,
but they were.
I also don't get why it is safe to replace the type-stmt but not the
status-stmt.
Lots of restrictions on deviations are hard to understand.



> Thanks & Regards
>
>
>
> Walker (Guangying zheng)
>
>
>

Andy


>
>
> *From:* Andy Bierman [mailto:[email protected]]
> *Sent:* 2017年2月22日 3:24
> *To:* Zhengguangying (Walker)
> *Cc:* [email protected]; Qudan (Beijing-NOS); Guopeipei (Peipei Guo);
> Yangang
> *Subject:* Re: [netmod] Hi all, one issue about YANG deviate's
> Substatements
>
>
>
>
>
>
>
> On Tue, Feb 21, 2017 at 12:32 AM, Zhengguangying (Walker) <
> [email protected]> wrote:
>
> Hi all,
>
>
>
>   When we define YANG models, there has one issue about “deviate's
> Substatements”
>
>
>
>   In section *7.20.3.2.  The "deviate" Statement given the *Substatements
> supported, but “when” not there.
>
> config       | 7.21.1       | 0..1        |
>
>                | default      | 7.6.4, 7.7.4 | 0..n        |
>
>                | mandatory    | 7.6.5        | 0..1        |
>
>                | max-elements | 7.7.6        | 0..1        |
>
>                | min-elements | 7.7.5        | 0..1        |
>
>                | must         | 7.5.3        | 0..n        |
>
>                | type         | 7.4          | 0..1        |
>
>                | unique       | 7.8.3        | 0..n        |
>
>                | units        | 7.3.3        | 0..1        |
>
>                +--------------+--------------+-------------+
>
> Now, we have the scenario to add “when” constrains when deviate the
> existed YANG module, how I can do it?
>
>
>
>
>
> You cannot add when-stmts to deviations.
>
> It is not supported.  Deviations cannot be conditional.
>
>
>
> May be it need extend the Substatements of “devite” to add ”when”, what’s
> yours opinion, please help to share, thanks.
>
>
>
> Thanks & regards
>
>
>
> Walker (Guangying zheng)
>
>
>
>
>
>
>
>
>
> Andy
>
>
>
>
> _______________________________________________
> netmod mailing list
> [email protected]
> https://www.ietf.org/mailman/listinfo/netmod
>
>
>
_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to