Re: [netconf] restconf collections

Robert Varga <> Wed, 30 September 2020 20:04 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id A968B3A0B65 for <>; Wed, 30 Sep 2020 13:04:17 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -2.312
X-Spam-Status: No, score=-2.312 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, NICE_REPLY_A=-0.213, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: (amavisd-new); dkim=pass (1024-bit key)
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id dEgdED3YcFIl for <>; Wed, 30 Sep 2020 13:04:15 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id E617C3A0D5F for <>; Wed, 30 Sep 2020 13:04:06 -0700 (PDT)
Received: from nitebug.nitenet.local ( []) by (Postfix) with ESMTPSA id 6753E246E17; Wed, 30 Sep 2020 22:04:04 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple;; s=mail; t=1601496244; bh=JHUwDhitF8xmC5cORV5cwlQ1WinPncQxv+gFXGHrMaQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=GZwriBHj4HWWvgtxN5a+IijJs4jX6Q2AJ17a5na5V4+YFeQ9r7ueAYBcuIoVXeGMV QVhkRa6Zn9CGs1Hpgd+PEl+0wyFOGDkiu5yNqPONcLTBKhwLb0Zie/nQEVGcXoFAK8 tuL2zQnhf1EtRxj3Vt3/umoeAryC/dh5lpqgJbng=
To: Kent Watsen <>
Cc: Qin Wu <>, Andy Bierman <>, "" <>
References: <> <> <>
From: Robert Varga <>
Message-ID: <>
Date: Wed, 30 Sep 2020 22:03:58 +0200
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0
MIME-Version: 1.0
In-Reply-To: <>
Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="c2H4R5A6Y1zZM2I6HekiCDvSj2RD5TbHT"
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: Wed, 30 Sep 2020 20:04:18 -0000

On 30/09/2020 19:33, Kent Watsen wrote:
> Hi Robert,
>> That is assuming the list in question has iteration order which is
>> stable. I do not believe this is something RFC7950 mandates on anything
>> except ordered-by=user.
> If not “ordered-by user”, then its “ordered-by system” that, as RFC 7950 says, "the server is free to sort the list entries in any reasonable order.”  This is a stable ordering, IMO.

It's been quite some time since I did lawyer-reading the RFCs, but for
the sake of argument:

- is use of hash maps for keyed lists okay, hence the sort order is the
encounter order based on the contents?
- if so, does that order remain the same even across server restarts?

I am not sure what the litmus test for 'reasonable' would look like, I
am afraid.

>> So let's say the list has 4 elements A, B, C, D.
>> 1) The first request returns items A, B, C.
>> 2) An item is inserted before C, so that the list is E, A, B, C, D.
>> 3) What does the second request return?
>> Similarly:
>> 1) The first request returns items A, B, C.
>> 2) An item is deleted before C, so that the list is B, C, D.
>> 3) What does the second request return?
>> Pagination is deceptively hard.
> Is your conjecture that the solution should enable something akin to cursors?  Would this be an advanced feature that a server might support on a list-by-list basis?   Maybe "node-tags” could be useful here too…

If the requirement is to really just have an iterator, which breaks when
the list changes, then a node-tag+offset would be sufficient. But then
you could end up in a situation where you will never traverse the list
simply because its rate of change exceeds your ability to traverse it.

The path forks quite a bit if you want something more specific, like:
"visit all elements in any order, i.e. additions do not break iteration".

If we have requirements towards that level of complexity, then yes, I
would very much prefer if there was a cursor-like resource associated
with an ongoing pagination request.

If I squint just a little bit, the first paginated request is not that
different for a (one-shot) subscription to receive notification of all
list entries. Subsequent requests are fetches from that notification
stream... which shows my reactive systems bias :)