Re: [netconf] restconf collections

Kent Watsen <kent+ietf@watsen.net> Tue, 29 September 2020 17:44 UTC

Return-Path: <01000174daf6ded3-0ba5564d-f1c7-4c65-90dc-d8a22f2f9395-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 DEFD73A0F4F for <netconf@ietfa.amsl.com>; Tue, 29 Sep 2020 10:44:08 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.895
X-Spam-Level:
X-Spam-Status: No, score=-1.895 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H5=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 qJm04KGHFL-u for <netconf@ietfa.amsl.com>; Tue, 29 Sep 2020 10:44:07 -0700 (PDT)
Received: from a8-96.smtp-out.amazonses.com (a8-96.smtp-out.amazonses.com [54.240.8.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 712B83A0F4E for <netconf@ietf.org>; Tue, 29 Sep 2020 10:44:07 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=224i4yxa5dv7c2xz3womw6peuasteono; d=amazonses.com; t=1601401446; h=From:Content-Type:Mime-Version:Subject:Date:References:To:In-Reply-To:Message-Id:Feedback-ID; bh=uQbIUe+Fshfng1x9nL0nbvd92LyVkRbsMfZYnB9wg3E=; b=lBUJVb19oGWik1dlMpO8SAXivnBUoc2VvfTPWlx131mA1pLDZMZA2zT74yVqHwdS Pkf6nvp6H0/mOc7CWBAMxjzy/MYJSZKca0xrLEhJWMLQ3yyEuTm4Aj1iO2L5x/kkiR+ AHlJsZeWNw3SgwRadpVLcY95evbMUv6KhjW646lg=
From: Kent Watsen <kent+ietf@watsen.net>
Content-Type: multipart/alternative; boundary="Apple-Mail=_B9D46937-84EE-457D-8649-02B4B8AF5805"
Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\))
Date: Tue, 29 Sep 2020 17:44:06 +0000
References: <B8F9A780D330094D99AF023C5877DABAADA1006E@dggeml511-mbs.china.huawei.com> <01000174cb6ea9ee-d7716c10-a691-4a97-9e99-022e4c0ef55a-000000@email.amazonses.com> <CABCOCHRzK8658NuwH4rBrmUg-T1KFWA0nZ2RJf_Kd9Q0TFka0g@mail.gmail.com> <01000174cbc7532c-81a16bed-e752-4e61-9a97-dfc95be744b5-000000@email.amazonses.com> <CABCOCHTT=vQWNY9iTUG8Dy8s7qrA0sP5rKcRgsjZkWuXG+q78Q@mail.gmail.com> <01000174d5174af9-848a769d-ef3f-49a6-b1d6-1eb8349a489f-000000@email.amazonses.com>
To: "netconf@ietf.org" <netconf@ietf.org>
In-Reply-To: <01000174d5174af9-848a769d-ef3f-49a6-b1d6-1eb8349a489f-000000@email.amazonses.com>
Message-ID: <01000174daf6ded3-0ba5564d-f1c7-4c65-90dc-d8a22f2f9395-000000@email.amazonses.com>
X-Mailer: Apple Mail (2.3608.80.23.2.2)
X-SES-Outgoing: 2020.09.29-54.240.8.96
Feedback-ID: 1.us-east-1.DKmIRZFhhsBhtmFMNikgwZUWVrODEw9qVcPhqJEI2DA=:AmazonSES
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/uWWkD2IUVCq7tJTFxTmFjBQAaYI>
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: Tue, 29 Sep 2020 17:44:09 -0000

Firstly, thank you to those that responded showing interest in working on these I-Ds.  If anyone else is interested, please send me a PM. 

Regarding solution, I want to take one more stab at a sketch here, as a last-chance for comments before the authors dive into producing the I-Ds.

Already it is assumed that there will be an RPC for NC, and query params for RC…that not what this email is about.

Here’s my proposal:

	For all lists;

		a) “limit” or “count”
		b) “offset" or “skip”
		c) “direction”  (i.e., forward/backward)

	For non “ordered-by user” lists, but only for indexable columns:

		d) “sort-by” or “ordered-by” (single column max)
		e) “where” or “filter” (compound expression of some sort)

	Note: the lowercase “or” is just for the label selected (no semantic impact).


The order of operation is “e —> a”.  That is, first the filter is applied (if any), then the sort is applied (if any), then the direction is applied (if any), then the offset/skip is applied (if any), and then the limit/count is applied (if any).

Now the tricky stuff.

	- “key” and “unique” leafs are indexed by default, assuming
	  the leaf’s base type is indexable
	- a special extension is used to index other nodes
	- other indexable nodes must be a “leaf"
	- the leaf must be “mandatory true”
	- the leaf must not be under a “list” or “choice” node
	- the leaf must have an indexable base type
		- all built-in types supported except:
			- binary
			- instance-identifier
		- unions are indexable, but assumes all values stored
		   as a “string” in the DB.
		- “string” types may be coerced into more DB-friendly types
			- “yang:date-and-time” mapped to a DB “DateTime” type

Cons:
	- smart (e.g., netmask-based) filter/sorts is unlikely supportable
		- at least not without custom (not generic) code


Comments?

K.