Re: [Netconf] [netmod] RFC6243 "with defaults" report-all and YANG "when" statements

Martin Bjorklund <mbj@tail-f.com> Mon, 27 August 2018 07:06 UTC

Return-Path: <mbj@tail-f.com>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 41921130DF3; Mon, 27 Aug 2018 00:06:41 -0700 (PDT)
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, 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 x0mNhZx60CbT; Mon, 27 Aug 2018 00:06:40 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id C62FE130DDF; Mon, 27 Aug 2018 00:06:39 -0700 (PDT)
Received: from localhost (unknown [173.38.220.61]) by mail.tail-f.com (Postfix) with ESMTPSA id F095A1AE0312; Mon, 27 Aug 2018 09:06:34 +0200 (CEST)
Date: Mon, 27 Aug 2018 09:06:34 +0200
Message-Id: <20180827.090634.908058368768636307.mbj@tail-f.com>
To: jason.sterne@nokia.com
Cc: netmod@ietf.org, netconf@ietf.org
From: Martin Bjorklund <mbj@tail-f.com>
In-Reply-To: <VI1PR07MB398181F0ECB96E28BBC290EB9B360@VI1PR07MB3981.eurprd07.prod.outlook.com>
References: <VI1PR07MB3981EC4CC1EF663F59A6A4EF9B360@VI1PR07MB3981.eurprd07.prod.outlook.com> <VI1PR07MB398181F0ECB96E28BBC290EB9B360@VI1PR07MB3981.eurprd07.prod.outlook.com>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/L-adz3dCDLLJqlyMFOu0zkfxpGg>
Subject: Re: [Netconf] [netmod] RFC6243 "with defaults" report-all and YANG "when" statements
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.27
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 27 Aug 2018 07:06:41 -0000

"Sterne, Jason (Nokia - CA/Ottawa)" <jason.sterne@nokia.com> wrote:
> Also adding NETCONF.  This spans both groups.
> 
> From: Sterne, Jason (Nokia - CA/Ottawa)
> Sent: Friday, August 24, 2018 9:27 AM
> To: netmod@ietf.org
> Subject: RFC6243 "with defaults" report-all and YANG "when" statements
> 
> Hi all,
> 
> RFC6243 has a 'report-all' retrieval mode:
> 
>    When data is retrieved with a <with-defaults> parameter equal to
>    'report-all', all data nodes MUST be reported, including any data
>    nodes considered to be default data by the server.
> 
> I wanted to confirm how YANG "when" statements are supposed to interact with 'report-all'.
> 
> If a 'when' statement is (e.g. in some container abc) is currently not satisfied, then I believe a 'report-all' would not report the container abc or any of the descendant nodes of abc.  Is that correct ?

Yes.

> A "when" statement (when not satisfied) makes the associated nodes "invalid" so I assume that means they don't exist with their default values at all.

Correct.

An invalid "when" expression has the same effect on the node as
erasing the definition from the module.


/martin


> 
> e.g.
> leaf foo { type uint32; }
> container abc {
>    when "../foo = 1";
>    leaf test1 { type uint32; default 50 }
> }
> 
> If the <running> currently has this instance data:
>     foo = 2
> then I believe a 'report-all' retrieval would only return the following:
>     <foo>2</foo>
> and it would *not* return this data:
>     <abc>
>        <test1>50</test1>
>     </abc>
> 
> Jason