Subject: [Netconf] multiple top-level nodes?

From: Kent Watsen <[email-masked]>
Date: Wed, 12 Feb 2014 18:29:03 +0000

Can <get-config> with no filter return multiple top-level nodes?

All the examples in RFC 6241 show just a single top-level node being
returned.  For instance:

     <rpc message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <get/>
     </rpc>

     <rpc-reply message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <data>
         <top xmlns="http://example.com/schema/1.2/config">
           ...
         </top>
       </data>
     </rpc-reply>

But is this possible?

     <rpc-reply message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <data>
         <top1 xmlns="http://example.com/schema/1.2/config-1">
           ...
         </top1>
         <top2 xmlns="http://example.com/schema/1.2/config-2">
           ...
         </top2>
         <top3 xmlns="http://example.com/schema/1.2/config-3">
           ...
         </top3>

       </data>
     </rpc-reply>

For reference, section 6.4.1 (No Filter) says:

   Leaving out the filter on the <get> operation returns the entire data
   model.

     <rpc message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <get/>
     </rpc>

     <rpc-reply message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <data>
         <!-- ... entire set of data returned ... -->
       </data>
     </rpc-reply>

And the YANG module has:

      output {
        anyxml data {
          description
            "Copy of the source datastore subset that matched
             the filter criteria (if any).  An empty data container
             indicates that the request did not produce any results.";
        }
      }

So I don't see it disallowed, but it also seems counter-intuitive...

Thoughts?

Thanks,
Kent

---

From: Andy Bierman <[email-masked]>
Date: Wed, 12 Feb 2014 10:44:03 -0800

Hi,

Yes.

One reason the <data> node exists in <get> and <get-config>
replies is so it can contain multiple top-level data nodes, and
still be a valid XML document,  In the YANG mapping, the <data>
element is not added because the <rpc-reply> serves as the container.
(Note that RESTCONF with XML encoding is still broken. The draft
does not specify a container or an error yet.)

The use of a named node makes mapping to YANG possible.

Andy

On Wed, Feb 12, 2014 at 10:29 AM, Kent Watsen <[email-masked]> wrote:

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

---

From: Rohit pobbathi <[email-masked]>
Date: Thu, 13 Feb 2014 05:04:12 +0000

In my opinion, YES.
No filter query must be capable to return entire data model.
And to return entire data model, it is required to provide multiple top-level nodes in reply.

Rgds,
Rohit Pobbathi

-----Original Message-----
From: Netconf [mailto:[email-masked]] On Behalf Of Kent Watsen
Sent: 2014年2月12日 23:59
To: NetConf
Subject: [Netconf] multiple top-level nodes?

All the examples in RFC 6241 show just a single top-level node being returned.  For instance:

     <rpc message-id="101"

But is this possible?

       </data>
     </rpc-reply>

     <rpc message-id="101"

And the YANG module has:

      output {
        anyxml data {
          description

Thoughts?

Thanks,
Kent

---

From: Kent Watsen <[email-masked]>
Date: Fri, 14 Feb 2014 21:06:13 +0000

Hi Andy, Rohit,

Thanks for your replies,

It's true that, in YANG, a module statement may have any number of
container sub-statements --> a YANG module can define multiple top-level
nodes.

My question wasn't clear, but the example (below) shows each of the "top"
nodes being in a different namespaces.  Is this possible?

I don't think it is because, with no filter, <get-config> returns a
configuration defined by just one YANG module, its default/native YANG
module, and hence all the top-level nodes would be in the same namespace.

Is that right?

Thanks,
Kent

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 14 Feb 2014 22:21:38 +0100 (CET)

> nodes being in a different namespaces.  Is this possible?

Sure.  Just have multiple YANG modules, each with its own namespace,
each defining a top-level node "top".

> configuration defined by just one YANG module

With no filter, <get-config> returns all nodes from all YANG modules.
If not, how would the server know _which_ YANG module to return (if no
filter is specified)?

> its default/native YANG
> module

A server often (typically) implements more than a single YANG module.

(Yes I know Junos has a single top-level node; this would be
represented in a single YANG module...)

/martin

> , and hence all the top-level nodes would be in the same namespace.
> 
> Is that right?
> 
> Thanks,
> Kent
> 
>

---

From: Kent Watsen <[email-masked]>
Date: Sat, 15 Feb 2014 01:12:22 +0000

>If not, how would the server know _which_ YANG module to return (if no

Pulling all nodes from all modules could return lots of redundant data, as
the server provides everything in its "native" configuration and
parts-n-piences then again as to exports its data to a external format.  I
would think that the server would return just its "native" configuration
and defer exporting to other formats until explicitly asked for it.

>represented in a single YANG module...)

This surprises me.  I thought the whole point of submodules was to enable
the YANG for internal components to be assembled into a single top-level
module having a single namespace.  Why would a device not do this?

Thanks,
Kent

---

From: Andy Bierman <[email-masked]>
Date: Fri, 14 Feb 2014 17:28:32 -0800

> and defer exporting to other formats until explicitly asked for it.
There is no "native" encoding with NETCONF or YANG.
There is only valid XML.  The set of top-level YANG data nodes
are the child nodes for the <data> element returned for <get>
or <get-config>.  IMO this is straight-forward if you use YANG.
If not then, the request still means "get everything" if no filter is
present.

> module having a single namespace.  Why would a device not do this?

You can use sub-modules within the 1 YANG module that represents
the XML namespace for the data node <top>.

Andy