Re: [netconf] Usage examples for max-depth (rfc8526)
wangzitao <wangzitao@huawei.com> Tue, 19 March 2019 03:36 UTC
Return-Path: <wangzitao@huawei.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 7FB581279A9 for <netconf@ietfa.amsl.com>; Mon, 18 Mar 2019 20:36:33 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -4.2
X-Spam-Level:
X-Spam-Status: No, score=-4.2 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
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 3NPJSj4HkiHk for <netconf@ietfa.amsl.com>; Mon, 18 Mar 2019 20:36:30 -0700 (PDT)
Received: from huawei.com (lhrrgout.huawei.com [185.176.76.210]) (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 947E11279A2 for <netconf@ietf.org>; Mon, 18 Mar 2019 20:36:30 -0700 (PDT)
Received: from lhreml702-cah.china.huawei.com (unknown [172.18.7.107]) by Forcepoint Email with ESMTP id 13EA88EBE31D9328A899; Tue, 19 Mar 2019 03:36:28 +0000 (GMT)
Received: from DGGEMM402-HUB.china.huawei.com (10.3.20.210) by lhreml702-cah.china.huawei.com (10.201.108.43) with Microsoft SMTP Server (TLS) id 14.3.408.0; Tue, 19 Mar 2019 03:36:27 +0000
Received: from DGGEMM527-MBX.china.huawei.com ([169.254.6.77]) by DGGEMM402-HUB.china.huawei.com ([10.3.20.210]) with mapi id 14.03.0415.000; Tue, 19 Mar 2019 11:36:25 +0800
From: wangzitao <wangzitao@huawei.com>
To: Balázs Lengyel <balazs.lengyel@ericsson.com>, "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: [netconf] Usage examples for max-depth (rfc8526)
Thread-Index: AdTeA8WykGakdwrtSgumgqfLSpkB8w==
Date: Tue, 19 Mar 2019 03:36:24 +0000
Message-ID: <E6BC9BBCBCACC246846FC685F9FF41EA2D973176@DGGEMM527-MBX.china.huawei.com>
Accept-Language: en-US
Content-Language: zh-CN
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-originating-ip: [10.134.142.117]
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-CFilter-Loop: Reflected
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/O996N-3Qy_7ZY9AsSD2V2IddIOk>
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: Tue, 19 Mar 2019 03:36:34 -0000
-----邮件原件----- 发件人: netconf [mailto:netconf-bounces@ietf.org] 代表 Balázs Lengyel 发送时间: 2019年3月18日 23:00 收件人: netconf@ietf.org 主题: Re: [netconf] Usage examples for max-depth (rfc8526) As a private opinion: Providing a list without keys is kind of useless. IMHO keys should always be present if the list is allowed by depth. In my view the correct answer is: Example 3: no subtree filter is provided, max-depth=3 <top xmlns="http://example.com/schema/1.2/config"> <users> <user> <name>Joe</name> </user> <user> <name>Bill</name> </user> <user> <name>Balazs</name> </user> </users> </top> So even if the key name is strictly speaking on depth=4 it should be included in a level 3 get result. [Michael]: Based on RFC8040, it will only output the <user> list level (depth 4), however, for a list without key and anther parameters, it doesn't seem to be meaningful. regards Balazs On 2019. 03. 14. 9:53, Wisotzky, Sven (Nokia - DE/Stuttgart) wrote: > 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 > -- Balazs Lengyel Ericsson Hungary Ltd. Senior Specialist Mobile: +36-70-330-7909 email: Balazs.Lengyel@ericsson.com
- [netconf] Usage examples for max-depth (rfc8526) Wisotzky, Sven (Nokia - DE/Stuttgart)
- Re: [netconf] Usage examples for max-depth (rfc85… Balázs Lengyel
- Re: [netconf] Usage examples for max-depth (rfc85… Rob Wilton (rwilton)
- Re: [netconf] Usage examples for max-depth (rfc85… wangzitao
- Re: [netconf] Usage examples for max-depth (rfc85… Wisotzky, Sven (Nokia - DE/Stuttgart)
- Re: [netconf] Usage examples for max-depth (rfc85… Wisotzky, Sven (Nokia - DE/Stuttgart)