Subject: [Netconf] Requesting lists in a container via RestConf

From: NILS FISCHBECK <[email-masked]>
Date: Thu, 22 Oct 2015 07:14:09 +0000

Suppose we have in a YANG file

container jukebox {
          list artist {
            key name;
            leaf name {..}
            // other leafs
           }
           list playlist {
            key name;
            leaf name {..}
            // other leafs
           }
}

How can I request using RestConf all artists but not all playlists (because there are so many)?
More precise: If I request with a GET

/restconf/data/example-jukebox:jukebox/artist (without any specific key)

what is the result in XML and JSON and is it a valid request?

Regards
Nils

ADTRAN GmbH, Siemensallee 1, 17489 Greifswald, GERMANY
Office: +49 3834 5352 870
Cell: +49 170 632 8819
Sitz der Gesellschaft: Berlin / Registered office: Berlin
Registergericht: Berlin / Commercial registry: Amtsgericht Charlottenburg, HRB 135656 B
Geschäftsführung / Managing Directors: Michael K. Foliano, James D. Wilson, Jr., Dr. Eduard Scheiterer

---

From: Andy Bierman <[email-masked]>
Date: Sun, 1 Nov 2015 17:06:36 -0800

> /restconf/data/example-jukebox:jukebox/artist (without any specific key)

See the "fields" query parameter

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

---

From: Andy Bierman <[email-masked]>
Date: Thu, 5 Nov 2015 09:39:43 -0800

On Thu, Nov 5, 2015 at 7:06 AM, NILS FISCHBECK <[email-masked]>
wrote:

> In section 4.3 of the RestConf standard a GET example is given for /restconf/data/example-jukebox:jukebox/library/artist=Foo%20Fighters/album
>
> In this example album is a list inside the artist resource. Is this request really valid and if yes, how would an XML response look like?
>
>
>
> Currently it returns in the example one structure
>
> <album xmlns="http://example.com/ns/example-jukebox">
>
>     <name>Wasting Light</name>
>
> </album>
>
> But how would it look like for multiple albums?
>
>
>

In JSON, the server could just return an array of 'album'.
In XML, multiple albums would be invalid.
This is the reason the RESTCONF Collections draft was created.

The plan in the collections draft is to return a "collection" container in
both XML and JSON.  I know Lada does not like adding an extra
container in JSON.  I prefer for the client to parse the same structure
in either XML or JSON.

The client would send an Accept header for application/yang.collection+{xml
| json}
and the target resource needs to point at a list. Then the server will
return this
collection container.

Is the draft right in this case, was in the draft rather meant that
> album=Wasting%20Light was to be requested and requesting lists without
> using the fields query is not possible?
>
>
>

I think we should change the example to add the key for album.
I think this was the intent.

> Nils

Andy

> *From:* Andy Bierman [mailto:[email-masked]]
> *Sent:* Montag, 2. November 2015 02:07
> *To:* NILS FISCHBECK
> *Cc:* [email-masked]
> *Subject:* Re: [Netconf] Requesting lists in a container via RestConf
>
>
>
>
>
>
>
> On Thu, Oct 22, 2015 at 12:14 AM, NILS FISCHBECK <
> [email-masked]> wrote:
>

---

From: NILS FISCHBECK <[email-masked]>
Date: Thu, 5 Nov 2015 15:06:27 +0000

Is the draft right in this case, was in the draft rather meant that album=Wasting%20Light was to be requested and requesting lists without using the fields query is not possible?

Regards
Nils

From: Andy Bierman [mailto:[email-masked]]
Sent: Montag, 2. November 2015 02:07
To: NILS FISCHBECK
Cc: [email-masked]
Subject: Re: [Netconf] Requesting lists in a container via RestConf

On Thu, Oct 22, 2015 at 12:14 AM, NILS FISCHBECK <[email-masked]<mailto:[email-masked]>> wrote:
Suppose we have in a YANG file

container jukebox {
          list artist {
            key name;
            leaf name {..}
            // other leafs
           }
           list playlist {
            key name;
            leaf name {..}
            // other leafs
           }
}

Regards
Nils

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