Re: [netmod] XPath questions about revised datastores

Andy Bierman <andy@yumaworks.com> Thu, 15 June 2017 15:59 UTC

Return-Path: <andy@yumaworks.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 09E111292CE for <netmod@ietfa.amsl.com>; Thu, 15 Jun 2017 08:59:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.599
X-Spam-Level:
X-Spam-Status: No, score=-2.599 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=yumaworks-com.20150623.gappssmtp.com
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 JxP5IIYIpK9k for <netmod@ietfa.amsl.com>; Thu, 15 Jun 2017 08:59:31 -0700 (PDT)
Received: from mail-wm0-x22c.google.com (mail-wm0-x22c.google.com [IPv6:2a00:1450:400c:c09::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B84AD1241FC for <netmod@ietf.org>; Thu, 15 Jun 2017 08:59:27 -0700 (PDT)
Received: by mail-wm0-x22c.google.com with SMTP id d73so3310825wma.0 for <netmod@ietf.org>; Thu, 15 Jun 2017 08:59:27 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yumaworks-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=JifA0oKdx0fvohdm52l49dz2VKdR0YqBkuQ4j0R3zQk=; b=17xM2dA7Wwq9CAclXRlX5i3OKuTRvEqhEZ7SHtRtRFGmgJuOkmr2UB0dnu5w9k75eV LWcqRtna/fohEliWlOnPeMNAud+tAYcPi9wVG7HzueWNlcp6WJy9ewWOioyUYvUVeK0X NOAesJiMrH5aj5GzoeUFmSkg4eJDdaXw5lipaHxTMs4g6k1C83nCRXFzvKlgWumIuMJb sF7Q9K20K/Uf+b6kyCkhHlSsy4UVEV5SWQsNSJf+Gv30XooDubxlKnkqfubMYgv8YNdJ UnZ2ykInrv/zXKYZNVw9hZVgTznqo5DUuMnlh4lylm9bsQ9/L9X9aXvepm9kvE149aZ7 ZOTw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=JifA0oKdx0fvohdm52l49dz2VKdR0YqBkuQ4j0R3zQk=; b=WErJWJsdamSbqKhwoxRjcemRZ7IYXui+Z7Iy800JQ/cwG3kxOSfv0R+9Zq9W10nU5D WJ1JzRLtV6iJQizuxl9DYKq0PZQXtaVyOAh2NfU7m9FR+Odrw0o0isCHEV28zpajWhPd ONkF6rRHaQwiDJeJ7hXo4flwM0326XY6SYWZC88ajolMT/Gjgs2sRVnmJXJJpenJ2hfu srYSGL3QsNfs19eiIkewmbBHFyBZ5O5Lthf1ZGe+///PWupfCk2wCJYRWBz390soAssk MDXQe5buJRw+ymkGMfBE8y+QdcgYg+KM6uAunkI7xbT+apUnbFXo8xndDK4WN3aEZ7Hw efYg==
X-Gm-Message-State: AKS2vOxdHJ4W5sQp4vHoxFkMshYCVHvZvEPTvh83JiD35Q+wJnoN4UfK D1jJILLD/Mw4Aso7DZbAiTyimzmd2E2x
X-Received: by 10.28.191.29 with SMTP id p29mr3936020wmf.60.1497542366098; Thu, 15 Jun 2017 08:59:26 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.223.182.173 with HTTP; Thu, 15 Jun 2017 08:59:25 -0700 (PDT)
In-Reply-To: <20170615.174143.206077667263578256.mbj@tail-f.com>
References: <CABCOCHS1oFGZMzDRANhdRrH1S+75RNbgdDggqW84ee7uwd5fbQ@mail.gmail.com> <20170615122716.GB58434@elstar.local> <CABCOCHR4C16nJeizcCdmM966OEvid6zjzxL69QSaTriAZa67Xw@mail.gmail.com> <20170615.174143.206077667263578256.mbj@tail-f.com>
From: Andy Bierman <andy@yumaworks.com>
Date: Thu, 15 Jun 2017 08:59:25 -0700
Message-ID: <CABCOCHTN8x8=h4McG5Rf+m+XjO6YmwUaR-JfwhecL=CdbEGfag@mail.gmail.com>
To: Martin Bjorklund <mbj@tail-f.com>
Cc: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>, "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="94eb2c071c94c4948f055201c08d"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/JMvC6FBtmZWoglwzak16eZzTOoM>
Subject: Re: [netmod] XPath questions about revised datastores
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: Thu, 15 Jun 2017 15:59:34 -0000

On Thu, Jun 15, 2017 at 8:41 AM, Martin Bjorklund <mbj@tail-f.com> wrote:

> Andy Bierman <andy@yumaworks.com> wrote:
> > On Thu, Jun 15, 2017 at 5:27 AM, Juergen Schoenwaelder <
> > j.schoenwaelder@jacobs-university.de> wrote:
> >
> > > Andy,
> > >
> > > section 5.1 of draft-ietf-netmod-revised-datastores-02.txt discusses
> > > the XPath context. An xpath expression in a config-false container
> > > will resolve to the operational state.
> > >
> > >
> >
> > So the usual method of "augment when" is broken:
> >
> > WRONG: Will evaluate when-stmt against config
> >
> >    augment /foo {
> >        when "some condition";
> >        container stats { }
> >   }
>
> Do you mean that stats is a config true container?  And presumably in
> the stats containter you have config false leafs?
>
>
no -- stats is a config false container


> I think this works as expected.  In a conventional datastore
> (e.g. running), the stats container exists if "some condition" is true
> in that datastore.
>


no -- in my example the desire is to augment the operational state based on
the
operational value of a config=true leaf



> In the operational state, the stats container exists if "some
> condition" is true in that the operational state datastore.
>
> >  Correct: Will evaluate when-stmt against operational:
> >
> >    augment /foo {
> >        container stats {
> >          config false;
> >          when "different condition";
> >        }
> >    }
>
> In this case the stats container will never exist in any conventional
> datastore, since it is config false.
>
> In the operational state, the stats container exists if "different
> condition" is true in that the operational state datastore.
>
> > Forcing the augmenting node to be the XPath context node impacts the
> > possible expressions.
> > I think the RD draft should make all this clear.
>
> This is not different from how it works today wrt candidate vs running
> for example.
>

no -- the datastore doesn't change based on the context node config-stmt
value
for candidate and running.



>
>
> /martin
>
>
>

Andy


>
> >
> >
> >
> > /js
> > >
> >
> >
> > Andy
> >
> >
> > >
> > > On Wed, Jun 14, 2017 at 11:07:35AM -0700, Andy Bierman wrote:
> > > > Hi,
> > > >
> > > > I don't know if getting rid of /foo-state is such a great idea,
> > > > especially wrt/ counters and other objects that are not
> > > > related to intended config vs. applied config.
> > > >
> > > > Q1) how does a client know the difference between an auto-generated
> > > > foo-state.yang and a real foo-state.yang?  Seem like a YANG extension
> > > > is needed to flag an auto-generated foo-state.yang
> > > >
> > > > Q2) How does XPath reference an operational node if the /foo-state
> > > > subtree has been moved to the /foo config subtree?
> > > >
> > > > module foo {
> > > >
> > > >      container foo {
> > > >           leaf stat-collect-type {
> > > >              type enumeration {
> > > >                enum stat-set1;
> > > >                enum stat-set2;
> > > >              }
> > > >            }
> > > >       }
> > > >
> > > >      container foo-state {
> > > >           config false;
> > > >           leaf stat-collect-type {
> > > >              type enumeration {
> > > >                enum stat-set1;
> > > >                enum stat-set2;
> > > >              }
> > > >            }
> > > >            container stat-set1 {
> > > >               when "../stat-collect-type = 'stat-set1'";
> > > >               ...
> > > >            }
> > > >            container stat-set2 {
> > > >               when "../stat-collect-type = 'stat-set2'";
> > > >               ...
> > > >            }
> > > >      }
> > > > }
> > > >
> > > > In this example, there is a request stat collect type
> > > /foo/stat-collect-type
> > > > and there is an operational value (what the server/device is capable
> > > > of collecting -- e.g. client requests stat-set2 knowing the server
> > > > will change it to stat-set1 if set2 not supported)
> > > >
> > > > So if /foo-state is folded into /foo (because that is the intent --
> to
> > > get
> > > > rid of this extra stat-collect-type leaf), then how do the when-stmts
> > > > get applied to the operational value instead of the configured value?
> > > > The same issue applies if the when-stmts are within an augment-stmt
> > > >
> > > > WANT:
> > > >
> > > >  augment /foo-state {
> > > >     when "stat-collect-type = 'stat-set1'";
> > > >     container stat-set1 {
> > > >        ...
> > > >     }
> > > >  }
> > > >
> > > > RD Provides:
> > > >
> > > >   augment /foo {
> > > >     when "stat-collect-type = 'stat-set1'";
> > > >     container stat-set1 {
> > > >        config false;
> > > >        ...
> > > >     }
> > > >  }
> > > >
> > > > There is no way to use when-stmt to reference the operational value.
> > > > This is a rather common usage of the when-stmt, so it should not
> > > > be removed if RD is used.
> > > >
> > > >
> > > >
> > > > Andy
> > >
> > > > _______________________________________________
> > > > netmod mailing list
> > > > netmod@ietf.org
> > > > https://www.ietf.org/mailman/listinfo/netmod
> > >
> > >
> > > --
> > > 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/>
> > >
>