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

From: "Sterne, Jason (Nokia - CA/Ottawa)" <[email-masked]>
Date: Fri, 24 Aug 2018 13:28:06 +0000

Also adding NETCONF.  This spans both groups.

From: Sterne, Jason (Nokia - CA/Ottawa)
Sent: Friday, August 24, 2018 9:27 AM
To: [email-masked]
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 ?

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.

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

---

From: Martin Bjorklund <[email-masked]>
Date: Mon, 27 Aug 2018 09:06:34 +0200 (CEST)

> 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 co…

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

---

From: "Sterne, Jason (Nokia - CA/Ottawa)" <[email-masked]>
Date: Mon, 27 Aug 2018 12:30:33 +0000

Thanks Martin. That makes sense and matches the impression I got from various statements in the RFCs.

> -----Original Message-----
> From: Martin Bjorklund <[email-masked]>
> Sent: Monday, August 27, 2018 3:07 AM
> To: Sterne, Jason (Nokia - CA/Ottawa) <[email-masked]>
> Cc: [email-masked]; [email-masked]
> Subject: Re: [netmod] RFC6243 "with defaults" report-all and YANG "when"
> statements
> 
> > 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.
>