Subject: [Netconf] "depth" parameter: nest-level semantics

From: "Alberto Gonzalez Prieto (albertgo)" <[email-masked]>
Date: Tue, 3 Dec 2013 21:36:55 +0000

Hello,

I wanted to confirm my understanding of the semantics of a nest-level.

I understand that a nest-level is composed of a resource + its children.
Data resources are: containers and lists.
Children of a data resource are: leaves, leaf-lists, anyxml. How about presence containers?

1) In the example of 3.8.1, for a depth of 2, the response includes  2 containers (I.e., jukebox and library) and 1 list (I.e., artist). Would that make it 3 resources, and therefore 3 nest-levels?

2) I am assuming that choice and case nodes are "transparent"  wrt nest-levels. Is this the case?
That is, for the following resource

Container alpha {

     choice interface-type {
         case a {
             leaf foo { ... }
         }
         case b {
             container bar { ...}
         }
     }

}

For a get for "alpha" and depth = 1, the leaf "foo" should be returned if it existed. "Bar" would not be returned if it existed.

Thanks,

Alberto

---

From: Andy Bierman <[email-masked]>
Date: Tue, 3 Dec 2013 13:53:45 -0800

> Children of a data resource are: leaves, leaf-lists, anyxml. How about
This is changing in restconf-03.
In order to allow optional YANG terminals to be deleted without
requiring implementation of YANG Patch, all YANG node types
will be considered data resources.

>  1) In the example of 3.8.1, for a depth of 2, the response includes  2
> containers (I.e., jukebox and library) and 1 list (I.e., artist). Would
> that make it 3 resources, and therefore 3 nest-levels?
>

yes -- the depth applies to real nodes.

>
>  Container alpha {
>
>      choice interface-type {
>          case a {
>              leaf foo { ... }
>          }
>          case b {
>              container bar { ...}
>          }
>      }
>
> }
>
>
>
>  For a get for "alpha" and depth = 1, the leaf "foo" should be returned
> if it existed. "Bar" would not be returned if it existed.
>

Not in restconf-03.  The approach above is kind of broken
because there is no way for a client to just test for the existence
of a container without retrieving all the leafs.

depth=2 would return the leaf foo and an empty container bar.
depth=3 would return the leaf foo, the container bar, and the children of
bar.

>  Alberto

Andy

---

From: "Alberto Gonzalez Prieto (albertgo)" <[email-masked]>
Date: Tue, 3 Dec 2013 22:09:19 +0000

Thanks Andy,

So I understand that (in the context of data resources) a nest level is composed by all the "real" nodes that share parent. I.e., container, list, leaf, leaf-list, anyxml.
Two follow-up questions. Two use cases:

  *   a GET for a container w/ depth =1,
     *   should it just return an empty container if it exists? This makes sense for presence containers. How about non-presence ones? Would it return an empty container it the containers contains data?
  *   a GET for a list w/ depth =1,
     *   should it return just an empty list if it exists (I.e., if the list has at least 1 element) ?

Thanks,

Alberto

From: Andy Bierman <[email-masked]<mailto:[email-masked]>>
Date: Tuesday, December 3, 2013 1:53 PM
To: Alberto Gonzalez Prieto <[email-masked]<mailto:[email-masked]>>
Cc: Netconf <[email-masked]<mailto:[email-masked]>>
Subject: Re: [Netconf] "depth" parameter: nest-level semantics

On Tue, Dec 3, 2013 at 1:36 PM, Alberto Gonzalez Prieto (albertgo) <[email-masked]<mailto:[email-masked]>> wrote:
Hello,

Container alpha {

     choice interface-type {
         case a {
             leaf foo { ... }
         }
         case b {
             container bar { ...}
         }
     }

}

depth=2 would return the leaf foo and an empty container bar.
depth=3 would return the leaf foo, the container bar, and the children of bar.

Thanks,

Alberto

Andy

---

From: Andy Bierman <[email-masked]>
Date: Tue, 3 Dec 2013 14:14:02 -0800

On Tue, Dec 3, 2013 at 2:09 PM, Alberto Gonzalez Prieto (albertgo) <
[email-masked]> wrote:

>  Thanks Andy,
>
>  So I understand that (in the context of data resources) a nest level is
> composed by all the "real" nodes that share parent. I.e., container, list,
> leaf, leaf-list, anyxml.
>    - a GET for a container w/ depth =1,
>       - should it just return an empty container if it exists? This makes
>       sense for presence containers. How about non-presence ones? Would it return
>       an empty container it the containers contains data?
>
>
It would return an empty container no matter how many children it had

>
>    -
>    - a GET for a list w/ depth =1,
>       - should it return just an empty list if it exists (I.e., if the
>       list has at least 1 element) ?
>
>
One empty list node (no keys) would be returned if there are 1 or more
instances.
(I wanted a keys-only parameter but it got left out.  depth=2 will return
more than
the keys with each list instance.)

>    -

Andy