Re: [netconf] Usage examples for max-depth (rfc8526)

"Rob Wilton (rwilton)" <rwilton@cisco.com> Mon, 18 March 2019 17:58 UTC

Return-Path: <rwilton@cisco.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 34DE8129AB8 for <netconf@ietfa.amsl.com>; Mon, 18 Mar 2019 10:58:56 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.502
X-Spam-Level:
X-Spam-Status: No, score=-14.502 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 IQAM63NSJihz for <netconf@ietfa.amsl.com>; Mon, 18 Mar 2019 10:58:53 -0700 (PDT)
Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 986EB1200D8 for <netconf@ietf.org>; Mon, 18 Mar 2019 10:58:53 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4049; q=dns/txt; s=iport; t=1552931933; x=1554141533; h=from:to:subject:date:message-id:references:in-reply-to: content-transfer-encoding:mime-version; bh=IHtZMhGDP4/Ahhn9Hut2gK/KVUd2vpyX8T1EdpvjtQA=; b=nAMPZrW+sdzWeh9Scw763sX8qxc7WTeU9dLvHlOkGPifiUVAEOy2FPvv Q+PdHaeXDTLhPqbqzPRPQ1x4nDp01XpKT66eG8y0Q3YclHwjpwV767F01 9rgfwnzP3tHcCEaltNqN96JkGlrAeGOU7kc2poZ19yLZMCLD2quatpl7L k=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0AHAACZ249c/40NJK1jGQEBAQEBAQEBAQEBAQcBAQEBAQGBUwIBAQEBAQsBgWEvaIEDJwqXP4INmDGBewsBARgLhANGAoRaIjYHDQEBAwEBCQECAQJtHAyFSgEBAQQBASUTNBcEAgEIEQQBAR8QJwsdCAIEARIIgxuBdQ+rMjOKMoEvAYsvF4FAP4QjgxMLAQGBS4V3A4oKhnuTUAkCh1mJH4IjIYF8W4UUi2yLB4V4jQMCERWBKCYCL4FWcBU7gmwJhW+FFIU/QTGHNiuBAYEfAQE
X-IronPort-AV: E=Sophos;i="5.58,494,1544486400"; d="scan'208";a="526382660"
Received: from alln-core-8.cisco.com ([173.36.13.141]) by rcdn-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-SEED-SHA; 18 Mar 2019 17:58:52 +0000
Received: from XCH-RCD-010.cisco.com (xch-rcd-010.cisco.com [173.37.102.20]) by alln-core-8.cisco.com (8.15.2/8.15.2) with ESMTPS id x2IHwq8w001751 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=FAIL); Mon, 18 Mar 2019 17:58:52 GMT
Received: from xch-rcd-007.cisco.com (173.37.102.17) by XCH-RCD-010.cisco.com (173.37.102.20) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 18 Mar 2019 12:58:51 -0500
Received: from xch-rcd-007.cisco.com ([173.37.102.17]) by XCH-RCD-007.cisco.com ([173.37.102.17]) with mapi id 15.00.1473.003; Mon, 18 Mar 2019 12:58:51 -0500
From: "Rob Wilton (rwilton)" <rwilton@cisco.com>
To: "Wisotzky, Sven (Nokia - DE/Stuttgart)" <sven.wisotzky@nokia.com>, "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: Usage examples for max-depth (rfc8526)
Thread-Index: AQHU2kNT5zRVd6q0aUyVnM8yIqQf4KYRrJdg
Date: Mon, 18 Mar 2019 17:58:51 +0000
Message-ID: <073d696fedfc42838bc3eb0b92fa3b4e@XCH-RCD-007.cisco.com>
References: <0AA9F087-D2FF-42EA-8ACA-FD44FAA57890@nokia.com>
In-Reply-To: <0AA9F087-D2FF-42EA-8ACA-FD44FAA57890@nokia.com>
Accept-Language: en-GB, en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-ms-exchange-transport-fromentityheader: Hosted
x-originating-ip: [10.63.23.135]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-Outbound-SMTP-Client: 173.37.102.20, xch-rcd-010.cisco.com
X-Outbound-Node: alln-core-8.cisco.com
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/4Cm355PNVKhVdcrO9az6X8z09YI>
Subject: Re: [netconf] Usage examples for max-depth (rfc8526)
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, 18 Mar 2019 17:58:57 -0000

Hi Sven,

Yes, I think that intention is to be consistent with the RESTCONF behaviour.  Although, there might be a slight bug in the example 3 on page 129 of RFC 8040; I would expect both "artist" and "song" to be represented as empty arrays rather than empty objects.

My take is, assuming top is a top level container:

Example 1: yes

Example 2: yes, but your assumption does not necessarily hold.  Section 7.5.7 of RFC 7950 allows non-presence container to be returned even if it does not contain any children, so I don't think that you can infer anything if it is present in the output.  If the container has presence then your assumption does hold.

Example 3: yes, that is what I would expect the output to be.

Example 4.  Same answer as for 2.

In terms of the expected behaviour then I think that the result should be equivalent to the server generating the full output for the request and then removing all nodes that are deeper than the depth parameter.  Obviously a server could implement it more efficiently than this.

Thanks,
Rob


-----Original Message-----
From: netconf <netconf-bounces@ietf.org> On Behalf Of Wisotzky, Sven (Nokia - DE/Stuttgart)
Sent: 14 March 2019 08:53
To: netconf@ietf.org
Subject: [netconf] Usage examples for max-depth (rfc8526)

Unfortunately the info provided in RFC 8526 about the max-depth attribute is not very precise.
Is it fair to assume, that behavior is aligned with the RESTCONF "depth" attribute described in RFC 8040?

Let's use the following sample from chapter 3.1.1.3:
       <top xmlns="http://example.com/schema/1.2/config">
         <users>
           <user>
             <name>root</name>
             <type>superuser</type>
             <full-name>Charlie Root</full-name>
             <company-info>
               <dept>1</dept>
               <id>1</id>
             </company-info>
           </user>
           <!-- additional <user> elements appear here... -->
         </users>
       </top>

Example 1: no subtree filter is provided, max-depth=1
       <top xmlns="http://example.com/schema/1.2/config">
       </top>

Example 2: no subtree filter is provided, max-depth=2
       <top xmlns="http://example.com/schema/1.2/config">
         <users>
         </users>
       </top>
Assumption the container <users> would only be present in the result, if this container has any explicit children configuration. If there is no children config, it would not be part of the output.

Example 3: no subtree filter is provided, max-depth=3
       <top xmlns="http://example.com/schema/1.2/config">
         <users>
           <user>
           </user>
         </users>
       </top>
Somewhat interesting scenario. It provides the netconf client with a method to check, if a list contains any entries. So if the XML node <user> is contained, we would know that the list "user" has at least one entry. However, this XML output would not validate against the YANG model - because list-keys (user/name) are mandatory. In essence, that client requires to be flexible when parsing such result and cannot be restricted to YANG.

Example 4: no subtree filter is provided, max-depth=4
       <top xmlns="http://example.com/schema/1.2/config">
         <users>
           <user>
             <name>root</name>
             <type>superuser</type>
             <full-name>Charlie Root</full-name>
             <company-info>
             </company-info>
           </user>
           <!-- additional <user> elements appear here... -->
         </users>
       </top>
Similar to example 2, the container <company-info> would only be present, if this container has explicit children configuration.


Someone please to confirm, if those examples and assumptions being made are correct!

/wiso

_______________________________________________
netconf mailing list
netconf@ietf.org
https://www.ietf.org/mailman/listinfo/netconf