Subject: [Netconf] Require Clarifications ///RE: Regarding empty value provided for xml element inedit-config operation

From: Rohit A Pobbathi <[email-masked]>
Date: Sat, 26 Mar 2011 08:21:04 +0530

Dear Martin,

Thanks for your inputs to my queries.

I still have some questions regarding the handling of EMPTY tag in
<edit-config> operation.

1. You have mentioned
In an <edit-config>, <mtu/> means that the mtu leaf should be set to
the value "", or created if it was of type 'empty'.

My Query: Here I am considering mtu leaf as a field in a table.
How to treat value "" for a field which is NOT string type ?
What if NULL Value for the field is treated as INVALID ?

2. You have mentioned
As Juergen wrote, see the with-defaults draft for details.  But the
short answer is that you need to delete the leaf in order to get the
"reset to default" behavior:

  <mtu nc:operation="delete"/>

My Query: Can we provide "operation" at leaf level ?
Why there is no mention regarding "rest to default" behaviour in the
with-defaults draft document.

Thanks & Regards,
Rohit

****************************************************************************
***********
-----Original Message-----
From: Martin Bjorklund [mailto:[email-masked]] 
Sent: Wednesday, February 16, 2011 2:11 PM
To: [email-masked]
Cc: [email-masked]; [email-masked]
Subject: Re: [Netconf] Regarding empty value provided for xml element
inedit-config operation

Hi,

Rohit A Pobbathi <[email-masked]> wrote:
> Our question in specific is how to handle a SELECTION node (i.e. <mtu />
or
> <mtu></mtu>) in a <edit-config> Request ?

<mtu/> would be a "selection node" if it was part of a subtree filter
in a <get> or <get-config> request.

In an <edit-config>, <mtu/> means that the mtu leaf should be set to
the value "", or created if it was of type 'empty'.

> The intention of the SELECTION node in <edit-config> request is to set the
> particular element to DEFAULT i.e. to CLEAR the value.
>
> Is there any mechanism to set the value of Fields to Default in Edit ?

As Juergen wrote, see the with-defaults draft for details.  But the
short answer is that you need to delete the leaf in order to get the
"reset to default" behavior:

  <mtu nc:operation="delete"/>

Note that this operation might fail, depending on how defaults are
handled by the server, and the contents of the datastore (see
with-defaults for details!).  If you have a server that supports
:base:1.1 (as defined in draft-ietf-netconf-4741bis), you can send:

  <mtu nc:operation="remove"/>

This operation doesn't fail if the mtu doesn't exist.

/martin

---

From: Martin Bjorklund <[email-masked]>
Date: Sat, 26 Mar 2011 11:02:39 +0100 (CET)

Hi,

> What if NULL Value for the field is treated as INVALID ?

Assuming that mtu is a leaf of type integer, with a default value,
having:

  <mtu/>

in the edit-config means that you're trying to set mtu to "", which is
an invalid value if the mtu is an integer.  So such a request would
fail with error-tag 'invalid-value'.

> with-defaults draft document.

The text in that document describes what happens in the different
cases, but it doesn't use the term "reset to default".

/martin