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

From: wangzitao <[email-masked]>
Date: Tue, 19 Mar 2019 03:36:24 +0000

-----邮件原件-----
发件人: netconf [mailto:[email-masked]] 代表 Balázs Lengyel
发送时间: 2019年3月18日 23:00
收件人: [email-masked]
主题: 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
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netconf
>
-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
Senior Specialist
Mobile: +36-70-330-7909              email: [email-masked]

---

From: "Wisotzky, Sven (Nokia - DE/Stuttgart)" <[email-masked]>
Date: Tue, 19 Mar 2019 05:39:36 +0000

Michael,

Actually I've got an use-case, which requires me to understand if a container or list contains data/entries - while I would like to avoid asking the complete lists as it could be gigantic. I was just wondering if max-depth is the right way of implementing my use-case. But in that case, I would actually prefer, if just a single instance of <user/> is returned. If we would return the empty <user/> element for all list entries - it would become a way to tell the client the number of list entries, which would be useful for me as well - but very inefficient.

/wiso
---

On 19.03.19, 03:36, "netconf on behalf of wangzitao" <[email-masked] on behalf of [email-masked]> wrote:

    -----邮件原件-----
    发件人: netconf [mailto:[email-masked]] 代表 Balázs Lengyel
    发送时间: 2019年3月18日 23:00
    收件人: [email-masked]
    主题: Re: [netconf] Usage examples for max-depth (rfc8526)
    
    As a private opinion:

    

    regards Balazs