Re: [netconf] Question on restconf empty list reply

Martin Björklund <mbj+ietf@4668.se> Mon, 24 February 2020 19:17 UTC

Return-Path: <mbj+ietf@4668.se>
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 A278C3A1177 for <netconf@ietfa.amsl.com>; Mon, 24 Feb 2020 11:17:32 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.101
X-Spam-Level:
X-Spam-Status: No, score=-0.101 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, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=no autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=4668.se header.b=MNAZftDF; dkim=pass (2048-bit key) header.d=messagingengine.com header.b=TmVbVZdQ
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 6tEmAsTHIoM8 for <netconf@ietfa.amsl.com>; Mon, 24 Feb 2020 11:17:31 -0800 (PST)
Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 504793A1175 for <netconf@ietf.org>; Mon, 24 Feb 2020 11:17:31 -0800 (PST)
Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id 8FC525CBD; Mon, 24 Feb 2020 14:17:30 -0500 (EST)
Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 24 Feb 2020 14:17:30 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=4668.se; h=date :message-id:to:cc:subject:from:in-reply-to:references :mime-version:content-type:content-transfer-encoding; s=fm1; bh= u1StXWaPUBArtOWq6xLXABKtj8DQgKXrEvZQTDGtxKw=; b=MNAZftDF+UgOikZv pxwvyaBWubUO/QdsndPBNfekuUQ/JzrKwx8P9JG6yb5M06aWhYltGTYdPiuL58WH UfWs3ws2wJzOK6OfU+EDmMYhPyoxBAc578asyVZsxN13tCHFEG9o9ISciL9si5aZ XjZlsXQnBP+Pz2S/99rLGeemIKUF1PPNaTQtnvPL4f0bzHvFCVq7ZN97AFv9DYSu Govnvet+wYSgg4WaHaF0s50Sx2n1rDkP58MzaoU9iHp4nPAVrgCj8RNVGrN4KDPK xC9vVKC8D8Zh2gyjRC4c4hOnFXmS++1AwJTO1U3WU92zgRazR7w+sXBndYP1UmZj Kafiqg==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; 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=fm2; bh=u1StXWaPUBArtOWq6xLXABKtj8DQgKXrEvZQTDGtx Kw=; b=TmVbVZdQymQdaVWxYwReOrjt4FL7DGen7XaSV4NoCjooPs5OgNDJnQ5YT MmN61jY2pPoCn5HmZ2CzmJrQAodLGd0aCSwcMFmkiaK6dpT22YFT6k4Z4NBlBx6s mKnFqG4Sp3xpd2n9xDpzOqP0x4ue4tSOPKA1prbR3B0IUZ5W4Qandj0dQ80YEvF4 oiw9uDqXT9W2V80tcIRszOkJaoGHlCtRPpnIUaY1lYwnMDM3oFZESi6gPPHwT5Kz 7NolaV6geSAsT1hAUjy0I6AU4ZpfjYj5bRCKpa1QpYMVgSFfDe1OW86/Rq4orBWw iTIeRBSFMp6GYpVXB4UrKSYYjXkiw==
X-ME-Sender: <xms:SSFUXpvPGcKmj8c-XnL-AVOO0ZMBJadTmKhW_XAz88W0a52pHC2N-w>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrledtgdduvdegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpeffkffvuffhjghfofggtgfgsehtje ertdertddvnecuhfhrohhmpeforghrthhinhcuuehjnphrkhhluhhnugcuoehmsghjodhi vghtfhesgeeiieekrdhsvgeqnecuffhomhgrihhnpehivghtfhdrohhrghenucfkphepud ehkedrudejgedrgedrgeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehm rghilhhfrhhomhepmhgsjhdoihgvthhfseegieeikedrshgv
X-ME-Proxy: <xmx:SSFUXmuci0N4k_h7RS29sQoP06ISU26_5sGSwQvjEpEL7hAZc5tfgw> <xmx:SSFUXnyoSO9we9DJ5fmZV_6Kfy_2XPGszUcnZoNzXsN6Elsx7fqf7w> <xmx:SSFUXkgunhLBDqHN4G50rSbhDYsBjDaEosU7ocJzdbzGO5At6eWgaw> <xmx:SSFUXs4lUTXdp1MQMr9tjmuRDlnhbAaLN9ilKEWwwDSecEBuuF2xGw>
Received: from localhost (unknown [158.174.4.44]) by mail.messagingengine.com (Postfix) with ESMTPA id A0E173060FCB; Mon, 24 Feb 2020 14:17:28 -0500 (EST)
Date: Mon, 24 Feb 2020 20:17:27 +0100
Message-Id: <20200224.201727.524298611078512416.id@4668.se>
To: olof@hagsand.se
Cc: netconf@ietf.org
From: Martin Björklund <mbj+ietf@4668.se>
In-Reply-To: <4bca4ca8-0d9f-d986-4521-5c808a6e8a4d@hagsand.se>
References: <4bca4ca8-0d9f-d986-4521-5c808a6e8a4d@hagsand.se>
X-Mailer: Mew version 6.8 on Emacs 25.2
Mime-Version: 1.0
Content-Type: Text/Plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/1sdyhXxvDpoHFMkQl-opesA85_0>
Subject: Re: [netconf] Question on restconf empty list reply
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: Mon, 24 Feb 2020 19:17:33 -0000

Hi,

Olof Hagsand <olof@hagsand.se> wrote:
> Hello,
> In a restconf GET request of an empty YANG list using JSON encoding,
> what is the expected reply? I.e. using a yang list "x" in module "m"
> (pseudo http):
>   GET /restconf/data/m:x
>   Accept: application/yang-data+json
> 
> Is the reply (1):
>   HTTP/1.1 200 OK
>   {
>     "m:x": []
>   }
> 
> or should it be (2)
>   "404 Not Found" status-line and error-tag value "invalid-value"?

It should be 404, even if the list contains some entries.  The reason
for this is that there is no resource for the list itself, only for
list entries.  See section 3.5 of RFC 8040.

We used to have "collections" for this use case, but it was never finished.


/martin


> 
> Apologizes that this is a basic question, and I am sure this is resolved
> properly, but we have some discussions with users on how to properly
> interpret the description of GET in RFC 8040 Section 4.3 and RFC 7951.
> 
> Regards,
> Olof Hagsand,
> Clixon maintainer
> 
> _______________________________________________
> netconf mailing list
> netconf@ietf.org
> https://www.ietf.org/mailman/listinfo/netconf