Re: [netconf] restconf collections

Martin Björklund <> Thu, 29 October 2020 16:22 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 546323A09EF for <>; Thu, 29 Oct 2020 09:22:25 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -0.102
X-Spam-Status: No, score=-0.102 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, PDS_NAKED_TO_NUMERO=1.999, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (2048-bit key) header.b=FCtNUxhb; dkim=pass (2048-bit key) header.b=Tu3z2Iel
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id r_-Tq6KVbpOe for <>; Thu, 29 Oct 2020 09:22:24 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 2AE223A09E7 for <>; Thu, 29 Oct 2020 09:22:24 -0700 (PDT)
Received: from compute4.internal (compute4.nyi.internal []) by mailout.west.internal (Postfix) with ESMTP id 498897BC; Thu, 29 Oct 2020 12:22:23 -0400 (EDT)
Received: from mailfrontend1 ([]) by compute4.internal (MEProxy); Thu, 29 Oct 2020 12:22:23 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;; h=date :message-id:to:cc:subject:from:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm3; bh= fPDCqfq4eUXn3KhsW8NRdD6KPeKkZAihDKWmRAkxfps=; b=FCtNUxhbQo/g497J WmzF14s5hQSXYHdMBSQhjPo5uIrnmTlC2cZrzvoayGyKtcHMZcndXu069l2usr84 wWV0rX83yHql63LvLt6P/W4kzR5e/rHUkXWwgBfrjfznSlaxxHXrF3gIuOenyFoc MUvLiBCKFYqc48TwiJlBA2TXYe6e5qgTTmih7zrADB3MpNg6D/dHnyintAby20Xe AFciZN3pRb6+cz3844B2F7h+oIwnrzhytAvQDu30IQpaCGF/WwHslwVVyGxMr0ff ZgGg1dO+8e4pKhe01/NUdL47ci9ZaAf1eJFISK3A8J0atdrieezrB0b+kMtGiyEf OFch0g==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=fPDCqfq4eUXn3KhsW8NRdD6KPeKkZAihDKWmRAkxf ps=; b=Tu3z2IeliF5UnN+VnLlB22JSgevkcFBr6S6nPlOxa0gOHm4GlEpE4q12T kCBRt8G2/RPN4/dRWVHEgBJSbYwNGybsDH1+8AqLaEaO73bnBCsOWn4ndUCLll9G 6bnqJSZEXaWutcAu3aTqIXgCLxFs4WW9WR56diKYhIytrF1qRu/vIj+pAYILi9l1 yZMqW/E8R8KAO3jx2bgmgy+1yMlLVnrpDO+1VQGxzcTPxI9Pqaj7GrrRuoUwBNmL UnIJ+H72FjfAiAhVrA+SCPzBptL7fZmv0RnZeiMxWE5csfjgC/vWg8n2jCzlMGe2 ctZR7y880Zzg1fI46te0ESPaTz7mA==
X-ME-Sender: <xms:PuyaX2IyyRkFgLTYY_LBKRcXyN9mQZJMiTh5NgdYn_5yaliembgNdA> <xme:PuyaX-KbPHR1RsbquT2G4diF58IK1cuAZ-TqbWQtjkrVxqx-IPt_NvziysmiNKk1T wzTTGvfBv7xYQa9Zaw>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrleefgdekjecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffkvffuhfgjfhfogggtgfesthgsre dtredtjeenucfhrhhomhepofgrrhhtihhnuceujhpnrhhklhhunhguuceomhgsjhdoihgv thhfseegieeikedrshgvqeenucggtffrrghtthgvrhhnpeehteegtdffgfegffekvdejke evleetuedutddtfffhlefgtedvveehvdeguedtudenucfkphepvdduvddrvddugedruddu rdeitdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmsghjodhivghtfhesgeeiieekrdhsvg
X-ME-Proxy: <xmx:PuyaX2vDk5k49Lo6HiLSWkgiZzwgCGYR_NQ6DlkOJx-4bExQpVX9VQ> <xmx:PuyaX7bCA1tZ3vJ_vZb6-_PYFg-v5boagZqUgRdOfxdo718rmU0kNw> <xmx:PuyaX9YvlbHkR7Fk3KZiEvMN29z72wvYS2sgq_VWCN1PMzEvZfSrpA> <xmx:PuyaX_2oD_YV0Xl8IwiY7-o0GZrCa9VBnu2iw24dcNcLIqGk800K0A>
Received: from localhost ( []) by (Postfix) with ESMTPA id 240453280064; Thu, 29 Oct 2020 12:22:22 -0400 (EDT)
Date: Thu, 29 Oct 2020 17:22:20 +0100
Message-Id: <>
From: Martin Björklund <>
In-Reply-To: <>
References: <> <>
X-Mailer: Mew version 6.8 on Emacs 26.3
Mime-Version: 1.0
Content-Type: Text/Plain; charset="utf-8"
Content-Transfer-Encoding: base64
Archived-At: <>
Subject: Re: [netconf] restconf collections
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETCONF WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Thu, 29 Oct 2020 16:22:25 -0000

Kent Watsen <> wrote:
> Hi Martin,
> > This is not a good proposal, since the result is not a valid XML
> > document.  
> How is this important?

I will be difficult to parse, since you can't just parse it with a
standard XML parser.

> 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?

Sure, from a pure media type pow; but I still think it would be a
mistake to send a concatenation of valid XML documents w/o any
separators (and adding custom separators may work, but note how the
original NETCONF XML encoding tried to do that, but failed...).

> > 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...

You're right, it is valid.  My bad.  I forgot how clever the JSON
encoding of a single list entry was ;-)

> 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.

Yes this is my concern.