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

Balázs Lengyel <balazs.lengyel@ericsson.com> Mon, 18 March 2019 15:00 UTC

Return-Path: <balazs.lengyel@ericsson.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 C8448130E9A for <netconf@ietfa.amsl.com>; Mon, 18 Mar 2019 08:00:03 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.323
X-Spam-Level:
X-Spam-Status: No, score=-3.323 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FROM_EXCESS_BASE64=0.979, RCVD_IN_DNSWL_MED=-2.3, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=ericsson.com header.b=hRrnEyMX; dkim=pass (1024-bit key) header.d=ericsson.com header.b=Y1SpCrq2
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 I7ZcuMFp5RG5 for <netconf@ietfa.amsl.com>; Mon, 18 Mar 2019 08:00:01 -0700 (PDT)
Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) (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 98E951286C8 for <netconf@ietf.org>; Mon, 18 Mar 2019 08:00:00 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; d=ericsson.com; s=mailgw201801; c=relaxed/relaxed; q=dns/txt; i=@ericsson.com; t=1552921198; x=1555513198; h=From:Sender:Reply-To:Subject:Date:Message-ID:To:Cc:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JLH19Wd2R9hX+U8kbD5M1H3zBNmH7pz7K3uB8PFxa50=; b=hRrnEyMX0HYR9z+MeRML5VL0+4FCJ5Lkl5o8abLg8fpV08O7GKMNtrao9cvFbAl1 ulb8eBC/M52wXf8shcT3Nk3+1Kx8QbaQnyawgc0/L2rk/W1VN8Zw6mmlpquxv0YB n4/80wUcA4Nu7R0Tc74kgmTaopms91EVBThlKQaH8d0=;
X-AuditID: c1b4fb3a-5c9c29e00000672c-38-5c8fb26e3ce6
Received: from ESESSMB503.ericsson.se (Unknown_Domain [153.88.183.121]) by sessmg22.ericsson.net (Symantec Mail Security) with SMTP id 56.0B.26412.E62BF8C5; Mon, 18 Mar 2019 15:59:58 +0100 (CET)
Received: from ESESSMB503.ericsson.se (153.88.183.164) by ESESSMB503.ericsson.se (153.88.183.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Mon, 18 Mar 2019 15:59:51 +0100
Received: from EUR04-HE1-obe.outbound.protection.outlook.com (153.88.183.157) by ESESSMB503.ericsson.se (153.88.183.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Mon, 18 Mar 2019 15:59:51 +0100
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericsson.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=JLH19Wd2R9hX+U8kbD5M1H3zBNmH7pz7K3uB8PFxa50=; b=Y1SpCrq2XhKveWjbN01OsZkHmTstb6/hL9qDvDeOEZB02/XjnONeeFJAO3LAtdFEY8UUajoW56PO8pYTILDQrCCFc2m4QQPcrOeP2JKOX1HA/YKgQfQAYI0MzQhLMRa/qhr9RYqpg7hRXT/6HY6oxuyCUmem7ZvEaZ4mPFWwkzw=
Received: from DB7PR07MB3850.eurprd07.prod.outlook.com (52.134.99.143) by DB7PR07MB5749.eurprd07.prod.outlook.com (20.177.194.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1709.9; Mon, 18 Mar 2019 14:59:50 +0000
Received: from DB7PR07MB3850.eurprd07.prod.outlook.com ([fe80::4134:60f8:af37:d7aa]) by DB7PR07MB3850.eurprd07.prod.outlook.com ([fe80::4134:60f8:af37:d7aa%5]) with mapi id 15.20.1730.008; Mon, 18 Mar 2019 14:59:50 +0000
From: Balázs Lengyel <balazs.lengyel@ericsson.com>
To: "netconf@ietf.org" <netconf@ietf.org>
Thread-Topic: [netconf] Usage examples for max-depth (rfc8526)
Thread-Index: AQHU3Zs8C50xFm0Mhk6nZPyvEnoyNg==
Date: Mon, 18 Mar 2019 14:59:50 +0000
Message-ID: <5318827d-5aaf-71cf-203f-ed6d550b0dcd@ericsson.com>
References: <0AA9F087-D2FF-42EA-8ACA-FD44FAA57890@nokia.com>
In-Reply-To: <0AA9F087-D2FF-42EA-8ACA-FD44FAA57890@nokia.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: yes
X-MS-TNEF-Correlator:
x-originating-ip: [89.135.192.225]
user-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3
x-clientproxiedby: HE1PR05CA0247.eurprd05.prod.outlook.com (2603:10a6:3:fb::23) To DB7PR07MB3850.eurprd07.prod.outlook.com (2603:10a6:5:7::15)
x-ms-exchange-messagesentrepresentingtype: 1
x-ms-publictraffictype: Email
x-ms-office365-filtering-correlation-id: 72046e08-99bd-4f5d-a016-08d6abb25eb4
x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(2017052603328)(7153060)(49563074)(7193020); SRVR:DB7PR07MB5749;
x-ms-traffictypediagnostic: DB7PR07MB5749:
x-microsoft-antispam-prvs: <DB7PR07MB57496BC72C57EA6F9E16EA40F0470@DB7PR07MB5749.eurprd07.prod.outlook.com>
x-forefront-prvs: 098076C36C
x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(39860400002)(376002)(366004)(136003)(346002)(396003)(189003)(199004)(65806001)(8676002)(229853002)(85182001)(6486002)(8936002)(446003)(6116002)(3846002)(99936001)(5640700003)(53936002)(6436002)(6346003)(26005)(966005)(6306002)(305945005)(316002)(2906002)(7736002)(105586002)(14444005)(256004)(186003)(2351001)(6916009)(14454004)(486006)(106356001)(6512007)(85202003)(97736004)(102836004)(52116002)(76176011)(86362001)(6506007)(386003)(64126003)(53376002)(65826007)(31696002)(36756003)(71200400001)(5660300002)(71190400001)(2501003)(11346002)(81166006)(1730700003)(81156014)(2616005)(25786009)(99286004)(478600001)(6246003)(31686004)(58126008)(65956001)(66066001)(476003)(68736007); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR07MB5749; H:DB7PR07MB3850.eurprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1;
received-spf: None (protection.outlook.com: ericsson.com does not designate permitted sender hosts)
authentication-results: spf=none (sender IP is ) smtp.mailfrom=balazs.lengyel@ericsson.com;
x-ms-exchange-senderadcheck: 1
x-microsoft-antispam-message-info: zE/iHlC3z4Jmnuq+lBskblE9WaAy/nsliivYtOuVSgyLVqCtfbA+U/L5D/QNhF1UqPvZeKPzNyTvHObpr/WmFMe1NuwxwxfueoL8gmmP0YvD0yqEAgtBMyNNjhDOu0LmO490IOV9dychX9lasBambX+5BWmlBIJnHamDM2TGrisRUybZ0GkXWlmRpgDJkneNHMPoNcB5EQ3BwDODKZ88t0FqGyGhYPvIyL09LqnKpi8KVokiuuUkk4dxM9U4KeHNZIiLbZQyLfOJs3cSMf1q3nMpeu8PXSUkWipbo1vCnzwZk5NzxoCJM7pyw7hJ5Y+4S58b0tz+8ht4o9ABNAnJAdoOE5055mdgVUCYxJSpkIWhFS/SmxktzLeG9JeNRDEiH+A59Te9nUZo5+kELMAE3u+bodAL+2BRqpxGx2vRItc=
Content-Type: multipart/signed; protocol="application/pkcs7-signature"; micalg="sha-256"; boundary="------------ms070606050209000605010302"
MIME-Version: 1.0
X-MS-Exchange-CrossTenant-Network-Message-Id: 72046e08-99bd-4f5d-a016-08d6abb25eb4
X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Mar 2019 14:59:50.5711 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: 92e84ceb-fbfd-47ab-be52-080c6b87953f
X-MS-Exchange-CrossTenant-mailboxtype: HOSTED
X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR07MB5749
X-OriginatorOrg: ericsson.com
X-Brightmail-Tracker: H4sIAAAAAAAAA1WSa0hTYRjHe885246ryevSfFiGOpLI1NIyLC/rnkVWH0usHHlQU6ftLFPD MinMmSilNUd5QwzUzFQywYpJ3ioxb2SK5HSROSorMTWzdnYW1Lff83/+z/tceGlS2iOQ0bEq DaNWKePlQjFVdKwp1VtVnxexyTQmCyisHxHsQKEVFfPEURQuDopi4mOTGfXGkEhxTGvHgiCp +HBK891cUQZq3q1FdjTgLTCVXS7QIjEtxc8R9NwpRnwwi8BgLkScS4orCMjrUnAJCueTMFvX ZHPdJKB0rIHig3EENY0LIq5EiPdA1udnBMeOeD1c1k8LOF6JgyHPMCPi9RDIXLpN8ewD8406 i05bWniASefCyRKsgPlFLcnJUhwEvV/CONnO8kqm8ZF1OIRXwY8XNdZOJHaGYVMJwa/mCMbe l0KeneDjxJKAZznopoat7IRPQNfkK+v6gG8g6O69RvEmL+h+Y0I8r4G+khwbh4FxpkDEF0wg GHrSIuSGA+wJ2jpbbRzUjFXZmrlAf2cZYfMLYbGkneJPysC9+1dRPvLW/zO43uIjcTaC7/oB Qm89gAN0FZko3rQVihuMJM8boLLMTP5fzHEg6BYMQp7doSDHKOLZH8xtXxHPm6Gy9pewFImr kBPLsGxCtJ+fD6OOPc2yiSofFaOpR5avZWj8uf0xMnzY2YowjeQrJBHleRFSgTKZTU1oRWst 74zXVb9GMkqVqGLkjhLFAUtaEqVMTWPUiafU5+IZthWtpim5s2RR6hAhxdFKDRPHMEmM+m+W oO1kGSi6adlw37ri/f5XBsxDLVnhfo0XEjr3ne2f8FT+/uRe57roXJ8mqPFJJ64HHro4+vD9 09qe0G/2B73exR8xnalO81zuNzUii9LaF5W+zdYETJLtkaNubgrXueMPcqtOzng0m0XKbfrg Dt+UvQuDbbe8ps8HmtIvaUp2zQ3SpEaoU8gpNkbp60mqWeUf1RwQH2IDAAA=
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/GIKYNaCltycie_M0LYstIVPothM>
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 15:00:04 -0000

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.

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