Subject: Re: [Netconf] restconf default handling

From: Robert Wilton <[email-masked]>
Date: Wed, 7 Jun 2017 16:47:53 +0100

Hi,

On 31/05/2017 20:09, Andy Bierman wrote:
>
>
> On Wed, May 31, 2017 at 12:04 PM, Kent Watsen <[email-masked] 
> <mailto:[email-masked]>> wrote:
>
>     s3.5.4, p.3 says:
>
>      If the target of a GET method is a data node that represents a leaf
>      or leaf-list that has a default value and the leaf or leaf-list has
>      not been instantiated yet, the server MUST return the default value
>      or values that are in use by the server.  In this case, the server
>      MUST ignore its "basic-mode", described in Section 4.8.9, and return
>      the default value.
>
>     Is this really what we want?  What happened to trusting that clients
>     are YANG-aware?  How can a client otherwise test if a leaf is set
>     (e.g., get a 404) without GET-ing the parent container and then
>     checking if the leaf is present?
>
>     I ask because this doesn't seem right, and there may be a way to not
>     carry this into the support for revised-datastores...
>
>
> I think this is right.
> If the target resource is a leaf or leaf-list and the YANG default is 
> returned.
> If the target resource is an ancestor of the same leaf or leaf-list then
> the with-defaults mode determines if the default is added to the response.
>
> If the client asks for a specific terminal node, then why not just 
> return it?
Because a client may want to know whether the server holds an explicitly 
configured value for that leaf/leaf-list.

If a client wants defaults to be taken into account then then could just 
make the query using the with-defaults query parameter.

Making a GET of a leaf/leaf-list a special case doesn't make any sense 
to me, it just seems confusing.

> This is simpler for the client.
I think that it is anything but simpler for the client. :-)

Having GET of a leaf, and GET of the parent container returning 
different information for that same leaf does not seem simple.

It is also slightly unclear what happens if the "with-defaults" query 
parameter is used on a leaf.  My reading of the draft is that the query 
parameter would be honoured and override the leaf behaviour described in 
3.5.4.  Is that right?

>     K.
> Andy

Thanks,
Rob

>
>     _______________________________________________
>     Netconf mailing list
>     [email-masked] <mailto:[email-masked]>
>     https://www.ietf.org/mailman/listinfo/netconf
>     <https://www.ietf.org/mailman/listinfo/netconf>
>
>
>
>
> _______________________________________________
> Netconf mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netconf