Re: [netconf] restconf collections

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

Return-Path: <01000175751b1e3f-d4a84796-9f90-49eb-bbea-d3be5966f233-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 5211B3A083F for <netconf@ietfa.amsl.com>; Thu, 29 Oct 2020 09:05:15 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.896
X-Spam-Level:
X-Spam-Status: No, score=-1.896 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=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 cIqykY3wU6ee for <netconf@ietfa.amsl.com>; Thu, 29 Oct 2020 09:05:14 -0700 (PDT)
Received: from a48-110.smtp-out.amazonses.com (a48-110.smtp-out.amazonses.com [54.240.48.110]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 62E763A07BD for <netconf@ietf.org>; Thu, 29 Oct 2020 09:05:14 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1603987513; h=Content-Type:Content-Transfer-Encoding:From:Mime-Version:Subject:Date:Message-Id:References:Cc:In-Reply-To:To:Feedback-ID; bh=a6ZCE0AZ9w88Sj0lgKHy2sUTpfcC58fse5bWnakJAiY=; b=YsS4XbPU7t9bRWLVFsykDZUh2Em7v9CyoGjR86ovgNyON92s082ZqPInivq57h3U 1DdLSuOvXZ3dCurGjmaATov13g5l2CzT5kd4UlXYdtMY2aQf+z/q5ugYe/d+AKcO4na U28IYV1QgEa74H9KPwpGAjYsdJqK6KBpGvZ7ecFY=
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
From: Kent Watsen <kent+ietf@watsen.net>
Mime-Version: 1.0 (1.0)
Date: Thu, 29 Oct 2020 16:05:13 +0000
Message-ID: <01000175751b1e3f-d4a84796-9f90-49eb-bbea-d3be5966f233-000000@email.amazonses.com>
References: <20201029.085108.142889809049265936.id@4668.se>
Cc: netconf@ietf.org
In-Reply-To: <20201029.085108.142889809049265936.id@4668.se>
To: =?utf-8?Q?Martin_Bj=C3=B6rklund?= <mbj+ietf@4668.se>
X-Mailer: iPhone Mail (18A393)
X-SES-Outgoing: 2020.10.29-54.240.48.110
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/ulRhkLbeCfJh1W47G1pCCUZua4k>
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 16:05:15 -0000

Hi Martin,

> This is not a good proposal, since the result is not a valid XML
> document.  

How is this important?  It’s not an HTTP-constraint, right?  and I don’t think it is needed for message-framing either.   

I guess, as you mention below, the media-type is inappropriate (though 11.3.1 isn’t as clear as one might hope), so maybe the response is okay if only changing the media type?


> An XML document has exactly one root element.
> 
> Also, the media types used in the examples are misleading.  The
> example reply doesn't match the media type
> "application/yang-data+json" (same for xml).

How isn’t the media-type okay for JSON, for the response in the previous message?  It seems valid to me...

No dispute regarding the XML media-type.  


> I suggest you define new media types and a "collection" root
> element; or keep the media types and define "collection" in a YANG
> module as:
> 
>  anydata collection;

Noted, but first would like to understand why simply changing the media-type alone (while keeping the responses in the previous message) isn’t sufficient, for both xml and json. 

Each media-type can define its own format so, e.g., “application/yang-data+xml-list" could be used to define a list of XML documents, right?

That said, I acknowledge that having a root-element may aid xml-parsers, and thus perhaps worthwhile for that reason...just want to ensure we understand the motivations accurately.

K.