Subject: [netconf] Question about RFC8040 data root node and depth example

From: Henning Rogge <[email-masked]>
Date: Thu, 7 May 2020 09:17:14 +0200

Hi,

while working myself through all the RFC8040 examples, two more
questions came up.

The first question is about the depth=3 example in B.3.2. If I
understand the YANG file for the example correctly, both the "artist"
and "song" entry are lists... why do they have a { } value in the
example instead of a [ ] one?

The second is about GET queries directly to the /data node, as it is
done in example B.3.3.

Is the server meant to "join" both the ietf-restconf,
ietf-yang-library and the "user" datamodel into a larger one? This is
interesting because the ietf-restconf yang model does not event
implement any container, only a grouping that could be used by other
models.

Henning Rogge

---

From: "Per Andersson (perander)" <[email-masked]>
Date: Thu, 7 May 2020 09:46:00 +0000

> Henning Rogge <[email-masked]> on Thursday, May 7, 2020 09:17:

> example instead of a [ ] one?

I would say this is an error in RFC 8040, there is no note about it
in the Errata. [0]

A similar issue is corrected in the Errata for the example in B.3.1.

[0] https://www.rfc-editor.org/errata_search.php?rfc=8040

> implement any container, only a grouping that could be used by other

Under the unified datastore (i.e. {+restconf}/data node), all top level
nodes would be found

{
  "ietf-restconf:data": {
    "ietf-yang-library:yang-library": {},
    "example-jukebox:system": {},
    "example-jukebox:jukebox": {},
    "ietf-restconf-monitoring:restconf-state": {}
}

Note that example-jukebox have two top level nodes.

--
Per

---

From: Henning Rogge <[email-masked]>
Date: Thu, 7 May 2020 13:14:40 +0200

> I would say this is an error in RFC 8040, there is no note about it

ok.

> Under the unified datastore (i.e. {+restconf}/data node), all top level

**sigh** I was worried to get this answer. My current implementation
of the "yang data model" does load one library file... not a
hierarchical series of libraries...

This makes iterating over the "unified" datastore 'interesting',
especially because of the depth/fields query parameter.

>     "ietf-restconf-monitoring:restconf-state": {}

In theory It should be possible to define the "data" YANG model and
then import/augment everything from there, right?

> Note that example-jukebox have two top level nodes.

I assume this is just your example, not the "example-jukebox" in the
RFC 8040, right?

Henning

---

From: "Per Andersson (perander)" <[email-masked]>
Date: Thu, 7 May 2020 12:30:36 +0000

> Henning Rogge <[email-masked]> on Thursday, May 7, 2020 13:14
>

The datastore resource "data" is not a model per say but a container
which should be populated with loaded models' top nodes.

Fom ietf-restconf.yang:

          container data {                                                                                         
            description                                                                                            
              "Container representing the datastore resource.                                                      
               Represents the conceptual root of all state data                                                    
               and configuration data supported by the server.                                                     
               The child nodes of this container can be any data                                                   
               resources that are defined as top-level data nodes                                                  
               from the YANG modules advertised by the server in                                                   
               the 'ietf-yang-library' module.";                                                                   
          }

See also RFC 8040 Section 3.4. Datastore Resource.

> I assume this is just your example, not the "example-jukebox" in the

Yes, the example-jukebox.yang I referenced is probably from an earlier
RFC 8040 draft. But the principle is the same.

--
Per

---

From: Henning Rogge <[email-masked]>
Date: Thu, 7 May 2020 14:41:00 +0200

> which should be populated with loaded models' top nodes.

Yes, but because of query modifiers like depth/fields it is necessary
to have a common filtering system that starts at the base datastore
resource. A GET query easily can contain data from multiple models.

It is more of an implementation problem, nothing wrong with the
specification. At the moment my code just use different hooks in the
REST server to deal with each Yang model (modules-state,
restconf-state, userdata, ect.).

Henning