Re: [netconf] Trouble with RFC 8040 (Restconf) fields Query Parameter

Henning Rogge <hrogge@gmail.com> Tue, 12 May 2020 12:16 UTC

Return-Path: <hrogge@gmail.com>
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 31D6E3A07D5 for <netconf@ietfa.amsl.com>; Tue, 12 May 2020 05:16:02 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.098
X-Spam-Level:
X-Spam-Status: No, score=-2.098 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, FREEMAIL_FROM=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.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 SPzSO_fXv-kG for <netconf@ietfa.amsl.com>; Tue, 12 May 2020 05:16:01 -0700 (PDT)
Received: from mail-lf1-x130.google.com (mail-lf1-x130.google.com [IPv6:2a00:1450:4864:20::130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id C7D053A07C3 for <netconf@ietf.org>; Tue, 12 May 2020 05:16:00 -0700 (PDT)
Received: by mail-lf1-x130.google.com with SMTP id h26so10364216lfg.6 for <netconf@ietf.org>; Tue, 12 May 2020 05:16:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=GuoqOa4edJMSy9MBUJ1b7HWmyOJoPMptxXpJXxjhluM=; b=k3nB573Z8j804eqwW+0KSah3IKse5ucfIQ3BGmwXA8Y7UAJegYAZ/ORvHQQXFRqfJ8 z/rjtwUhswfj6N5mEycYavYT1r6SfAJpB9QnsvuiINeBwUpbtnumMs1L7024bAPhcgVA QUezGrwIek1HBQj5b41I7l8KUVIjtdhKGCO9bwlWON2NUrS5JypvqpikRfJOMNg1TF6L VGYFGWaOeGYeT7Hr86+d8VM24WrK8V9zfOqu163OCZSYWBAqL+EkNhW8018anBzSHfTB Jgv9UECZqwlcF4XqnkT7A7sXluhRJsX44KEGON/7k/jLKbc4/LETBEMWlTTJC7e8F7aX V8UQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=GuoqOa4edJMSy9MBUJ1b7HWmyOJoPMptxXpJXxjhluM=; b=KcDcXbuZ0LBcO9vHZyrbN6aNpZnEa05OFgOaTNFuAZJQ/gBURwbLetKh9NFkazwOQV O2sIKbQB2qrDuxIgYH6xOYG3lZDD8Wv9B+yjDaOGPWHkD9kMeQnMi61r2Lld7K6+abOT BsOgTPCBbH6g5vQb9BCF7ysLv1iwVUwHzG4JwUE8uqM/znsJnWdpAIa8JeM+SGsXYe3k ao5jQY/Dw1orLdWyFg2JKvWoe6tqM0qjPXFr2M4ZalapdaRmpoPZB3qeWEg8BccHwN19 GmocJFNBbkz2l2eUTNfosqJIFajdrVCKGmsD9ohYfnOqQcqn900hZRL2g/iVqlylFlkY HkGw==
X-Gm-Message-State: AOAM531AXyBvy7dcPG8BKi6aCee+a0sRnTV+H4IF0VbD/QigE5QAJHag cNe/fv5UqCRmd9MzsEq1fGNU/uA2dMJqEtHwnlM=
X-Google-Smtp-Source: ABdhPJzUWQLi196U/PT/kiP5h7n2BWebPs51+SZkwuxLDRNsSIa7Rt1Ed9HiXE7M7jaomB0AgdAGi1HA4KKcr0+D+9g=
X-Received: by 2002:a19:8d3:: with SMTP id 202mr14353061lfi.201.1589285758716; Tue, 12 May 2020 05:15:58 -0700 (PDT)
MIME-Version: 1.0
References: <CAGnRvup-pLVYgxAx7PnbJJ1gS-GTkD6t5jGD_Ayhh7ctpPothw@mail.gmail.com> <CAGnRvuq=ESLkeyWsgiqE9sXqFwHGUef3A4QRuW=H8ompVO3C4Q@mail.gmail.com> <20200414.222236.518728457229433184.id@4668.se> <CAGnRvurVJBHbRbwtnLXQFeSrDUFSGKWhL1UUjUDjw5-Gc44ozg@mail.gmail.com> <9C6D0A8A-2BD4-4578-8CB3-6969078CE10A@gmail.com> <CAGnRvupBeUnmpTLmeNR7y3Ycb22Jkngo=kfssNFfxHndxxEfPQ@mail.gmail.com> <20BA9136-0FC6-4CAC-BF59-89FC16DB583E@gmail.com> <01000171f59ea8ae-a7319ea3-12ca-4857-9b43-3f89ef6ec35c-000000@email.amazonses.com> <CAGnRvurn163ON65dDD8eZ-706fGrNGh8jHehFfwShm29cGyDOA@mail.gmail.com> <CAGnRvuoG04aKApt8LrKZhJD6iKWyGEiDNhmjkf1q34mYBjV=9A@mail.gmail.com> <DM6PR11MB3818284F0D47F5DF846584A3DBBE0@DM6PR11MB3818.namprd11.prod.outlook.com>
In-Reply-To: <DM6PR11MB3818284F0D47F5DF846584A3DBBE0@DM6PR11MB3818.namprd11.prod.outlook.com>
From: Henning Rogge <hrogge@gmail.com>
Date: Tue, 12 May 2020 14:15:32 +0200
Message-ID: <CAGnRvuqtb4Z_gqZEXQ2Mi2XL2Pygn866f6UjTbmqMwPTnqTYBQ@mail.gmail.com>
To: "Per Andersson (perander)" <perander@cisco.com>
Cc: Kent Watsen <kent+ietf@watsen.net>, "netconf@ietf.org" <netconf@ietf.org>
Content-Type: text/plain; charset="UTF-8"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/x6ZYRKp3a7g9QU4kEr-ZrVh2dEA>
Subject: Re: [netconf] Trouble with RFC 8040 (Restconf) fields Query Parameter
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, 12 May 2020 12:16:02 -0000

On Tue, May 12, 2020 at 1:46 PM Per Andersson (perander)
<perander@cisco.com> wrote:
>
> Henning Rogge <hrogge@gmail.com> on Tuesday, May 12, 2020 12:57:
> > I noticed the following parts:
> > * "fields" and "depth" query can be combined
> > * "depth" default is unlimited
> > * "fields" can be done on the "/restconf/data" level
> > * a query to "/restconf/data" does NOT result in unlimited depth...
>
> The depth default would still be unbounded if not set explicitly.

the second/third in Example B.1.2 suggest otherwise... Client request
something from "/restconf" and only gets a tree "1 deep" (node itself
plus direct children), which would be an equivalent of "?depth=2"...

> > does this mean "depth" is always 2 for /restconf/data queries (but not
> > on sub-paths)?
> > what is about a GET to "/restconf" ?
>
> From RFC 8040
>
>     The requested data node has a depth level of "1".
>
> So, a request towards /restconf/data would yield depth level 1
> on /restconf/data, /restconf/data/node would be depth level 2,
> and so on.

Yes... "?depth=2" gives you the node itself and the direct children.

> If the request would be towards /restconf/data/node instead,
> /restconf/data/node would be depth level 1.
>
> > is the "depth" default still 2 for "/restconf/data" if there is a
> > "field" query operator?
>
> If depth and fields are combined, nodes that would be selected
> in fields (and all ancestor nodes) would have a depth value of 1.
> I.e. the path to the selected node is included even if depth is
> lower than the nodes included in fields. Otherwise the depth
> query parameter is obeyed.

Does the counting just begin when the explicit selected fields end or
does it directly jump to the depth measured from the root node?

Henning Rogge