Re: [netconf] restconf collections

Kent Watsen <kent+ietf@watsen.net> Thu, 29 October 2020 00:33 UTC

Return-Path: <0100017571c59d4d-f1032aa5-103d-4443-933e-4db30f2ef641-000000@amazonses.watsen.net>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 27AB13A03F3 for <netconf@ietfa.amsl.com>; Wed, 28 Oct 2020 17:33:01 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.898
X-Spam-Level:
X-Spam-Status: No, score=-1.898 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=amazonses.com
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tInjFW-trldb for <netconf@ietfa.amsl.com>; Wed, 28 Oct 2020 17:32:59 -0700 (PDT)
Received: from a8-88.smtp-out.amazonses.com (a8-88.smtp-out.amazonses.com [54.240.8.88]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 128D63A0039 for <netconf@ietf.org>; Wed, 28 Oct 2020 17:32:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1603931577; h=From:Content-Type:Mime-Version:Subject:Date:References:To:In-Reply-To:Message-Id:Feedback-ID; bh=qdTlQCFsaszutKQsACHrDK0Ryl2zelvK8KKIT4R3Omw=; b=RJoe5xi3R64bmvlPmbx/kA0ww8Mx3qE0BHA0gpM3QKne27nmGKWvRQu2XJ3vT1eG AAPQjpQWCFErdSyT4LfCLB1qR8hcvFUUxGOfeD0+GIgqucCX2Qo5zZfCjZWSny51RvL LUg+mUSLqi7QAS+srIKuWvOIdnU2r4/ra1lkW+Yg=
From: Kent Watsen <kent+ietf@watsen.net>
Content-Type: multipart/alternative; boundary="Apple-Mail=_B5B43C4F-44FC-436A-9134-57DF603A074C"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
Date: Thu, 29 Oct 2020 00:32:57 +0000
References: <01000174e4610ae6-d1488376-ae7e-4d95-ba7e-005fc44b9592-000000@email.amazonses.com> <20201001.165548.1275939966226069939.id@4668.se> <01000174e5ba8cc5-39edb446-48d9-4896-a6b5-dcf80f962762-000000@email.amazonses.com> <20201002.082331.2242297379846191383.id@4668.se> <01000174e96cd06f-4ecb06ac-c7ac-4233-bd5d-97d3dbc74830-000000@email.amazonses.com> <CAL73O_x_mPwB6S-=UdASFK_H9f7CkeYU270ZZHX5xf9eLM=iAQ@mail.gmail.com> <01000174e9c75096-5f451248-48e7-4add-a56b-9789cddd3e56-000000@email.amazonses.com> <CAL73O_z+zy9wN9YOoGuA1VOTKxj4FL2Jj0N+cQ8fScT04J8-UA@mail.gmail.com>
To: "netconf@ietf.org" <netconf@ietf.org>
In-Reply-To: <CAL73O_z+zy9wN9YOoGuA1VOTKxj4FL2Jj0N+cQ8fScT04J8-UA@mail.gmail.com>
Message-ID: <0100017571c59d4d-f1032aa5-103d-4443-933e-4db30f2ef641-000000@email.amazonses.com>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
X-SES-Outgoing: 2020.10.29-54.240.8.88
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/NB_xWZnOQZTIxQp5QlsylpcByWg>
Subject: Re: [netconf] restconf collections
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 29 Oct 2020 00:33:01 -0000

[Update: a spinoff team has formed and is working on two I-D’s]

One issue has come up, regarding the encoding when GET returns a list or leaf-leaf.

Generally, in RFC 8040, GET returns an instance of the targeted resource.  This continues to be possible with JSON, as the list/leaf-list is a JSON array, but no array-equivalent exists with XML.  

This is likely why Section 4.3 states "More than one element MUST NOT be returned for XML encoding”, though this statement never needed to be said, as there is no case where more than one element would be returned anyway!

This intent of this email is to discuss changing that statement in 4.3, that is, to allow more than one element to be returned for the XML encoding.

Following are what I hope the WG can agree on being valid responses:

===== JSON =====


 REQUEST

    GET /restconf/data/example-jukebox:jukebox/library/artist?where=<expr>
    Host: example.com
    Accept: application/yang-data+json


 RESPONSE-1 (list exists, but no matching content)

    HTTP/1.1 204 No Content
    Date: Thu, 26 Jan 2017 20:56:30 GMT
    Server: example-server


 RESPONSE-2 (matching content)

    HTTP/1.1 200 OK
    Date: Thu, 26 Jan 2017 20:56:30 GMT
    Server: example-server
    Content-Type: application/yang-data+json

    {
      "example-jukebox:artist”: [
        {
         “name”: "Foo Fighters”,
          “album”: {
            “name”: "One by One”,
            “year”: 2012
          }

        },
        {
          “name”: "Nick Cave and the Bad Seeds”,
          “album”: {
            “name”: "Tender Pre”,
            “year”: 1988
          }
        }
      ]
    }



===== XML =====


  REQUEST

    GET /restconf/data/example-jukebox:jukebox/library/artist?where=<expr>
    Host: example.com
    Accept: application/yang-data+xml


  RESPONSE-1 (list exists, but no matching content)

    HTTP/1.1 204 No Content
    Date: Thu, 26 Jan 2017 20:56:30 GMT
    Server: example-server


  RESPONSE-2 (matching content)

    HTTP/1.1 200 OK
    Date: Thu, 26 Jan 2017 20:56:30 GMT
    Server: example-server
    Content-Type: application/yang-data+xml

    <artist xmlns="https://example.com/ns/example-jukebox">
      <name>Foo Fighters</name>
      <album>
        <name>One by One</name>
        <year>2012</year>
      </album>
    </artist>
    <artist xmlns="https://example.com/ns/example-jukebox">
      <name>Nick Cave and the Bad Seeds</name>
      <album>
        <name>Tender Prey</name>
        <year>1988</year>
      </album>
    </artist>



Thoughts?  If no objection, we will proceed as per above.

PS: I am aware, of course, of the pseudo-parent element (“collection”) defined in in draft-ietf-netconf-restconf-collection.  The hope is to avoid needing to introduce a pseudo element, as the above seems simpler, more consistent, and without issues, other than requiring that statement in Section 4.3 to be rescinded.


K.