Subject: Re: [netconf] [netmod] Question on Subtree Filtering Usage Example

From: Qin Wu <[email-masked]>
Date: Tue, 10 Aug 2021 07:54:34 +0000

What if <name>and<type> not configured under <users>?
My understanding is subtree filter will not care about "users" parent element is the container with presence substatement
Since subtree filter is applicable to xml file rather than YANG file.

I am not sure how the server parses subtree filter? It looks weird to look up YANG filter for scheme first and then apply subtree filter to the xml file corresponding to yang file.
Therefore if both <name>and<type> are not configured, the response I expect is return null irrespective of presence container "users".

-Qin
-----邮件原件-----
发件人: netmod [mailto:[email-masked]] 代表 maqiufang (A)
发送时间: 2021年8月6日 19:12
收件人: Juergen Schoenwaelder <[email-masked]>
抄送: [email-masked]; [email-masked]
主题: Re: [netmod] [netconf] Question on Subtree Filtering Usage Example

Hi, 
Thanks for your reply. Cross posting to NETCONF list.

Best Regards,
Qiufang Ma

-----Original Message-----
From: Jürgen Schönwälder [mailto:[email-masked]] 
Sent: Friday, August 6, 2021 6:35 PM
To: maqiufang (A) <[email-masked]>
Cc: [email-masked]
Subject: Re: [netmod] Question on Subtree Filtering Usage Example

Hi,

you may want to send your question to the netconf list since this is a protocol question and not a YANG question. (Concerning your question, please read section 6.2.4 "Selection Nodes". There is no restriction to only one selection node as far as I can tell.)

/js

On Fri, Aug 06, 2021 at 09:29:50AM +0000, maqiufang (A) wrote:
> Hi, all:
> 
> In RFC6241 section 6.4(https://datatracker.ietf.org/doc/html/rfc6241#section-6.4), several single subtree filtering examples are given.
> I am wondering whether we can select multiple elements within the <users> Subtree.
> Note that we also assume "users" parent element is the container with presence substatement.
> Here is the RPC request message with specific subtree filtering :
>      <rpc message-id="101"
>           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
>        <get-config>
>          <source>
>            <running/>
>          </source>
>          <filter type="subtree">
>            <top xmlns="http://example.com/schema/1.2/config">
>              <users>
>                <user>
>                     <name/>
>                      <type/>
>                </user>
>              </users>
>            </top>
>          </filter>
>        </get-config>
>      </rpc>
> 
> I am wondering what RPC response will look like? It will respond with null or it will respond as follows:
>      <rpc-reply message-id="101"
>           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
>        <data>
>          <top xmlns="http://example.com/schema/1.2/config">
>            <users>
>              <user>
>                <name>root</name>
>                <type>superuser</type>
>              </user>
>              <user>
>                <name>fred</name>
>                <type>admin</type>
>              </user>
>           </users>
>        </top>
>    </data>
> </rpc-reply>
> 
> 
> 
> Best Regards,
> Qiufang Ma

> _______________________________________________
> netmod mailing list
> [email-masked]
> https://www.ietf.org/mailman/listinfo/netmod

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <https://www.jacobs-university.de/>
_______________________________________________
netmod mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netmod

---

From: Jürgen Schönwälder <[email-masked]>
Date: Tue, 10 Aug 2021 10:56:37 +0200

Perhaps you can write down an instance tree to help us understand your
question. I assume your question is whether a server has to prune
empty fragments of the tree. I do not think that this is suggested by
section 6.2.5., i.e., you might get <users><user/></users> if nothing
is matching.

/js

---

From: "Fengchong (frank)" <[email-masked]>
Date: Tue, 10 Aug 2021 09:12:55 +0000

I think some expression may be added to subtree mechanism to express the presence container is also a selection-element. Because presence container is not only simply path but also has it's meaning.

For example, an attribute can be inserted to presence container to indicate this is also a selection element.
      <rpc message-id="101"
           xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <get-config>
         <source>
           <running/>
         </source>
         <filter type="subtree">
           <top xmlns="http://example.com/schema/1.2/config">
             <users selectable=true>
               <user>
                     <name/>
                      <type/>
                </user>
             </users>
            </top>
          </filter>
        </get-config>
      </rpc>

-----邮件原件-----
发件人: netconf [mailto:[email-masked]] 代表 Jürgen Sch?nw?lder
发送时间: 2021年8月10日 16:57
收件人: Qin Wu <[email-masked]>
抄送: [email-masked]
主题: Re: [netconf] [netmod] Question on Subtree Filtering Usage Example

Perhaps you can write down an instance tree to help us understand your question. I assume your question is whether a server has to prune empty fragments of the tree. I do not think that this is suggested by section 6.2.5., i.e., you might get <users><user/></users> if nothing is matching.

/js

On Tue, Aug 10, 2021 at 07:54:34AM +0000, Qin Wu wrote:
> My understanding is subtree filter will not care about "users" parent 
> element is the container with presence substatement Since subtree filter is applicable to xml file rather than YANG file.
> 
> you may want to send your question to the netconf list since this is a 
> protocol question and not a YANG question. (Concerning your question, 
> please read section 6.2.4 "Selection Nodes". There is no restriction 
> to only one selection node as far as I can tell.)
> 
> /js
> 

_______________________________________________
netconf mailing list
[email-masked]
https://www.ietf.org/mailman/listinfo/netconf

---

From: Jürgen Schönwälder <[email-masked]>
Date: Wed, 11 Aug 2021 09:13:45 +0200

While the handling of presence containers may indeed be not well
specified (which is not surprising given that NETCONF was designed
before we had YANG and presence containers), I am not sure we should
go and add data tree annotations for things that are defined in the
data model. At the end, it is an implementation issue how a server
implements data model awareness.

/js