Re: [netmod] XPath questions about revised datastores

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Thu, 15 June 2017 12:27 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 7C857129BF5 for <netmod@ietfa.amsl.com>; Thu, 15 Jun 2017 05:27:21 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RP_MATCHES_RCVD=-0.001, URIBL_BLOCKED=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 3H2pETGBRmgc for <netmod@ietfa.amsl.com>; Thu, 15 Jun 2017 05:27:19 -0700 (PDT)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7A3F1129BCF for <netmod@ietf.org>; Thu, 15 Jun 2017 05:27:18 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id AE982F4B; Thu, 15 Jun 2017 14:27:17 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.217]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id 72bGVdMjPU-u; Thu, 15 Jun 2017 14:27:16 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Thu, 15 Jun 2017 14:27:17 +0200 (CEST)
Received: from localhost (demetrius1.jacobs-university.de [212.201.44.46]) by hermes.jacobs-university.de (Postfix) with ESMTP id 8E0B620091; Thu, 15 Jun 2017 14:27:17 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius1.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id rXdV5mLTCkgM; Thu, 15 Jun 2017 14:27:17 +0200 (CEST)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 1C3E720090; Thu, 15 Jun 2017 14:27:17 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id E947F3FC2F6F; Thu, 15 Jun 2017 14:27:16 +0200 (CEST)
Date: Thu, 15 Jun 2017 14:27:16 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Andy Bierman <andy@yumaworks.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Message-ID: <20170615122716.GB58434@elstar.local>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Andy Bierman <andy@yumaworks.com>, "netmod@ietf.org" <netmod@ietf.org>
References: <CABCOCHS1oFGZMzDRANhdRrH1S+75RNbgdDggqW84ee7uwd5fbQ@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CABCOCHS1oFGZMzDRANhdRrH1S+75RNbgdDggqW84ee7uwd5fbQ@mail.gmail.com>
User-Agent: Mutt/1.6.0 (2016-04-01)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/0eK32ywop3He_i2xba8kHzzUWPI>
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 12:27:21 -0000

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.

/js

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/>