Re: [netmod] evaluation of "when" under NMDA

Alex Campbell <Alex.Campbell@Aviatnet.com> Mon, 04 December 2017 22:10 UTC

Return-Path: <Alex.Campbell@Aviatnet.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BD2AD12785F for <netmod@ietfa.amsl.com>; Mon, 4 Dec 2017 14:10:49 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IClB-mJKJRac for <netmod@ietfa.amsl.com>; Mon, 4 Dec 2017 14:10:48 -0800 (PST)
Received: from mail-send.aviatnet.com (mail-send.aviatnet.com [192.147.115.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3A71C126BF3 for <netmod@ietf.org>; Mon, 4 Dec 2017 14:10:48 -0800 (PST)
From: Alex Campbell <Alex.Campbell@Aviatnet.com>
To: Ladislav Lhotka <lhotka@nic.cz>, Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
CC: NETMOD WG <netmod@ietf.org>
Thread-Topic: [netmod] evaluation of "when" under NMDA
Thread-Index: AQHTbRy3igyGlOvLkUCH4At/TPQkAqMz52iAgAAIyQCAAASzgIAADSaA//+7V0o=
Date: Mon, 04 Dec 2017 22:10:46 +0000
Message-ID: <1512425445999.89017@Aviatnet.com>
References: <1512404811.1422.63.camel@nic.cz> <20171204.173431.1294203680272812703.mbj@tail-f.com> <1512407158.6635.8.camel@nic.cz> <20171204172247.rj3ilazharvzbyn6@elstar.local>, <1512410991.8751.4.camel@nic.cz>
In-Reply-To: <1512410991.8751.4.camel@nic.cz>
Accept-Language: en-NZ, en-US
Content-Language: en-NZ
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.15.6.10]
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/sU9oxJh9TuDL3iFXHd2owDNlNBo>
Subject: Re: [netmod] evaluation of "when" under NMDA
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 04 Dec 2017 22:10:50 -0000

Hi,

'when' does not affect schema nodes, only data nodes.
The schema nodes is essentially the YANG itself, without reference to any particular instance data.

Given an example YANG fragment:

    list widgets {
        key name;
        leaf name {type string;}
        leaf can-frob {type boolean;}
        container frob-data {
            when "../frob-data = 'true'";
            leaf frob-count {type uint32; mandatory true;}
        }
    }

The schema could be written like this: (not in any real language)

    widgets [list] [keys: name]
    - name [name]
    - can-frob [boolean]
    - frob-data [container] [when ../frob-data = 'true']
        - frob-count [uint32]

The when statement does not make schema nodes "valid" or "invalid". It only indicates the conditions under which the nodes will be present in the data tree.

A data tree for this schema might look like this: (in the same not-real-language)
    widgets
    - name: Widget1
    - can-frob: false
    widgets
    - name: Widget2
    - can-frob: true
    - frob-data:
       - frob-count: 5

Widget1 doesn't have any frob-data because its can-frob is false, while Widget2 does because its can-frob is true.
However that doesn't mean Widget1 and Widget2 have different schemas. They are both instances of the same schema written above.

________________________________________
From: netmod <netmod-bounces@ietf.org> on behalf of Ladislav Lhotka <lhotka@nic.cz>
Sent: Tuesday, 5 December 2017 7:09 a.m.
To: Juergen Schoenwaelder
Cc: NETMOD WG
Subject: Re: [netmod] evaluation of "when" under NMDA

On Mon, 2017-12-04 at 18:22 +0100, Juergen Schoenwaelder wrote:
> On Mon, Dec 04, 2017 at 06:05:58PM +0100, Ladislav Lhotka wrote:
> > On Mon, 2017-12-04 at 17:34 +0100, Martin Bjorklund wrote:
> > > Ladislav Lhotka <lhotka@nic.cz> wrote:
> > > > Hi,
> > > >
> > > > if we have
> > > >
> > > > augment "/target/node" {
> > > >   when "...";
> > > >   ...
> > > > }
> > > >
> > > > is the "when" expression supposed to be evaluated separately in each
> > >
> > > datastore,
> > > > and the augment applied only in those datastores where the result is
> > > > true?
> > >
> > > Yes.
> >
> > But then it cannot be guaranteed that the schema for <operational> is a
> > superset
> > of the schema of configuration datastores - the when expression can evaluate
> > to
> > false in <operational> but true in <intended>.
> >
>
> For me, its still the same schema - a when expression does not change
> my notion of 'schema'.

Well, according to draft-ietf-netmod-revised-datastores-07:

   o  datastore schema: The combined set of schema nodes for all modules
      supported by a particular datastore, taking into consideration any
      deviations and enabled features for that datastore.

And "when" determines whether a given schema node is valid or not. So if a
schema node is invalid in the schema of <operational> but valid in the schema of
<intended>, then the former can hardly be a superset of the latter.

Lada

>
> /js
>
--
Ladislav Lhotka
Head, CZ.NIC Labs
PGP Key ID: 0xB8F92B08A9F76C67

_______________________________________________
netmod mailing list
netmod@ietf.org
https://www.ietf.org/mailman/listinfo/netmod