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

> -----Original Message-----
> From: Martin Bjorklund <[email protected]>
> Sent: Monday, August 27, 2018 3:07 AM
> To: Sterne, Jason (Nokia - CA/Ottawa) <[email protected]>
> Cc: [email protected]; [email protected]
> Subject: Re: [netmod] RFC6243 "with defaults" report-all and YANG "when"
> statements
> 
> "Sterne, Jason (Nokia - CA/Ottawa)" <[email protected]> wrote:
> > Also adding NETCONF.  This spans both groups.
> >
> > From: Sterne, Jason (Nokia - CA/Ottawa)
> > Sent: Friday, August 24, 2018 9:27 AM
> > To: [email protected]
> > 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

_______________________________________________
netmod mailing list
[email protected]
https://www.ietf.org/mailman/listinfo/netmod

Reply via email to