Re: [netconf] Question on restconf empty list reply

Schönwälder, Jürgen <J.Schoenwaelder@jacobs-university.de> Sun, 23 February 2020 11:28 UTC

Return-Path: <J.Schoenwaelder@jacobs-university.de>
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 B94EA3A0CE5 for <netconf@ietfa.amsl.com>; Sun, 23 Feb 2020 03:28:35 -0800 (PST)
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, SPF_NONE=0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=jacobsuniversity.onmicrosoft.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 GuMtxdoHNte3 for <netconf@ietfa.amsl.com>; Sun, 23 Feb 2020 03:28:34 -0800 (PST)
Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50062.outbound.protection.outlook.com [40.107.5.62]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D4BF23A0CE4 for <netconf@ietf.org>; Sun, 23 Feb 2020 03:28:33 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=je+t/K3E2cIMvsvob1zAouGe6Hoarac3kHFq3NK39VHosTB3zOaiH9ucyV4uZISkH9CuX8lLWdu543RGlraPY9tbAtyTpQVH/VJgp0l3B6lTJ2woPz6l41q+TidZrobyvkceqfdcqCqEiJ5+yJJH1Jxlsg5U/j9TKvR4Cpe5mG6ahl+98gVRwURM2mHwtcpknvlbbg2MlgjoTmyP7NdKbDCEn62qFqV2XL5EgjrXbcSN1iOFWb5izpRC1FYu/Kbs9vY2azd4kpdvvByErOtwrAv+XUXRn+Ed26Bh6NWHUm8i6+Magj9M5YQv6B+Lk0Ns+SbJCO41e1WDbye3OVNoFg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aLMKMl809of1WZoCcud2wHN5Boe8qdGaRHVptc91B4w=; b=ZqZQwuIavAtfeHEt3ciSPRJ4OS15W3i3+9txpKAqhu+Vs17RGdgs46tDsWoebTSd1eo2nr26ewz5KcAsK5/6uH4UZPyt3XeVJf//FAxflIt2eccEsQ8swUNOxRSCY0S73GXXfKKiAcektNtn1SR6/VYE76gH2ZpR9cC1x8XZImsTvUbChkZpFixxZMlOpk/JSvrRzW5ieM8qPWfB29mStfgo5kpRb1i+eJjzBDRL5gL/O1sWwioy+JfReJpg31aOj35I6FiyApLiQo1Br6FzSrs4s7nHqgJORXYWkbpYT6Ps1oq2W5/Jdo7jXLY158Jdxs8+5QySVP/5+Ca8KjT9yA==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=jacobs-university.de; dmarc=pass action=none header.from=jacobs-university.de; dkim=pass header.d=jacobs-university.de; arc=none
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jacobsuniversity.onmicrosoft.com; s=selector2-jacobsuniversity-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aLMKMl809of1WZoCcud2wHN5Boe8qdGaRHVptc91B4w=; b=jmt/WoVWRJOPMab24yHEV7ZGnAsKnJlXzzsmEsU+bKQQJYFlsaEJP7aYcmt4BJdhvOluVZEMTPwN7CpHrE+lbuGJq8uLcd+cH3lpEcoPfIhiQyts37oQTHRuPLmb5iYBC14HBtp9sOo0VfR0BFGppwe2qMZxyevGuRmQpOvkLlo=
Received: from DB6P190MB0312.EURP190.PROD.OUTLOOK.COM (10.165.140.31) by DB6P190MB0567.EURP190.PROD.OUTLOOK.COM (10.175.241.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.18; Sun, 23 Feb 2020 11:28:30 +0000
Received: from DB6P190MB0312.EURP190.PROD.OUTLOOK.COM ([fe80::2cda:e754:4835:c579]) by DB6P190MB0312.EURP190.PROD.OUTLOOK.COM ([fe80::2cda:e754:4835:c579%3]) with mapi id 15.20.2750.021; Sun, 23 Feb 2020 11:28:30 +0000
Received: from localhost (212.201.44.247) by AM0PR04CA0003.eurprd04.prod.outlook.com (2603:10a6:208:122::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2750.18 via Frontend Transport; Sun, 23 Feb 2020 11:28:29 +0000
From: "Schönwälder, Jürgen" <J.Schoenwaelder@jacobs-university.de>
To: Olof Hagsand <olof@hagsand.se>
CC: "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: [netconf] Question on restconf empty list reply
Thread-Index: AQHV6jpF6bW55g7FYkmq2k0c8YfQS6gopEmA
Date: Sun, 23 Feb 2020 11:28:30 +0000
Message-ID: <20200223112829.rjd3zf53rybmmzvc@anna.jacobs.jacobs-university.de>
References: <4bca4ca8-0d9f-d986-4521-5c808a6e8a4d@hagsand.se>
In-Reply-To: <4bca4ca8-0d9f-d986-4521-5c808a6e8a4d@hagsand.se>
Reply-To: "Schönwälder, Jürgen" <J.Schoenwaelder@jacobs-university.de>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-clientproxiedby: AM0PR04CA0003.eurprd04.prod.outlook.com (2603:10a6:208:122::16) To DB6P190MB0312.EURP190.PROD.OUTLOOK.COM (2603:10a6:6:34::31)
authentication-results: spf=none (sender IP is ) smtp.mailfrom=J.Schoenwaelder@jacobs-university.de;
x-ms-exchange-messagesentrepresentingtype: 1
x-originating-ip: [212.201.44.247]
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 80fd57a4-7a79-42b1-429a-08d7b8538216
x-ms-traffictypediagnostic: DB6P190MB0567:
x-ms-exchange-transport-forked: True
x-microsoft-antispam-prvs: <DB6P190MB05675977EBE3B4E6EE3F2197DEEF0@DB6P190MB0567.EURP190.PROD.OUTLOOK.COM>
x-ms-oob-tlc-oobclassifiers: OLM:7691;
x-forefront-prvs: 0322B4EDE1
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39850400004)(136003)(346002)(396003)(376002)(366004)(199004)(189003)(26005)(186003)(81166006)(8936002)(966005)(16526019)(81156014)(52116002)(8676002)(86362001)(6916009)(4326008)(6486002)(956004)(66476007)(66556008)(66946007)(2906002)(3450700001)(6666004)(6496006)(71200400001)(478600001)(1076003)(5660300002)(66446008)(64756008)(786003)(316002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6P190MB0567; H:DB6P190MB0312.EURP190.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1;
received-spf: None (protection.outlook.com: jacobs-university.de does not designate permitted sender hosts)
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam: BCL:0;
x-microsoft-antispam-message-info: +2YjLxvOQTi+M5iNdZJdnuniOBK2mAuvsXAV2edugkik0WquLvoe4GkCkZGqgB/R0ycLPtPFOdhg16p3Qt9XES9JzY6XocfXY95dzeuWF5/QHtrFtEKpeeXb9lWi3cyJ/1qNZy6FpUdsvUFRCYay4eQTpNuK5zpHdRPc2cVQ+ZPDcQpElel+BhLErIf0+fl6nVbZTN1dSoFa2Qwdb4o4JbuoUC0UteKXmRP88gPRF7WTRvtjuv1UysbKz+Dzli/N/NSpjDomWEBLm4rg1PoD5B9EvgXqDZKnyVa6h+A3Fv4o3wTsHx4VSq5fLWATELq/fQd36QKkUcDEbSMgECUH4Skg3tArUVWwL/Jwr58lxN3YVF1HuwBKS8YKcPsXAc+cbwc2CegpyotPFNqQA2b86QuPHGqyBpx4hvupXtP4ei8U25WfbSO3ZlwwqN3L9YsoZjZ+D1uCGn/ViJU2kelX6oz0zSzPkoe4PBvopsIMmFFTJSUuWDn3dA/RIpkoFR3L0jba3MZpwKvEUPutS4DwNA==
x-ms-exchange-antispam-messagedata: hmhsYCEHbOZUnTEyqyqolg/YSG9dfgJwaJ6DbXULLai2WrO+h+VaJuIEFgjgdCwjOi9GQLiRW5xPyAH65TF0R+z0RWWeTbd0+ZSIbCToPkW6l2Z5wsSdbTN8huPagBCPr3VQMqmkiXcGooKqe97mow==
Content-Type: text/plain; charset="iso-8859-1"
Content-ID: <215CD27108A069439795416AF11E8D96@EURP190.PROD.OUTLOOK.COM>
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: jacobs-university.de
X-MS-Exchange-CrossTenant-Network-Message-Id: 80fd57a4-7a79-42b1-429a-08d7b8538216
X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Feb 2020 11:28:30.2616 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: f78e973e-5c0b-4ab8-bbd7-9887c95a8ebd
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-CrossTenant-userprincipalname: P/SIyuWOO0quOx7k+ox5c4leQNch9E1QOmCQbXGtOCuyHXjz/xjDPkx3V5g6bmRZuSeKWAwaVdp2FWhmWsZHDz7M0pRCEkO9FTaE8mYfFkw=
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6P190MB0567
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/zualqQG4CClkMVAZPrXKLI7LoXs>
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: Sun, 23 Feb 2020 11:28:36 -0000

My reading of RFC 7951 section 5.4 is that an empty list results in an
empty JSON array. A related question is likely whether the empty list
exists or not. RFC 8040 says a 404 response indicates that the
resource does not exist (or is not accessible). So both responses may
be reasonable, depending on the existence/accessibility of the resource.

/js

On Sun, Feb 23, 2020 at 12:12:58PM +0100, Olof Hagsand 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"?
> 
> 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

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>