Subject: [netmod] Clarification about subtree filtering

From: Shiva Kumar Pathori <[email-masked]>
Date: Tue, 22 May 2018 14:08:35 +0530

> Hi,
> Can somebody clarify what could be the response for the <get-config>
> operation provided below.
>
> Following is the user information in the datastore that is provided in the
> RFC 6241 as example.
>
>> <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/>
>>            </top>
>>          </filter>
>>        </get-config>
>>      </rpc>
>
>
> <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>
>>           <full-name>Charlie Root</full-name>
>>           <company-info>
>>             <dept>1</dept>
>>             <id>1</id>
>>           </company-info>
>>         </user>
>>         <user>
>>           <name>fred</name>
>>           <type>admin</type>
>>           <full-name>Fred Flintstone</full-name>
>>           <company-info>
>>             <dept>2</dept>
>>             <id>2</id>
>>           </company-info>
>>         </user>
>>         <user>
>>           <name>barney</name>
>>           <type>admin</type>
>>           <full-name>Barney Rubble</full-name>
>>           <company-info>
>>             <dept>2</dept>
>>             <id>3</id>
>>           </company-info>
>>         </user>
>>       </users>
>>     </top>
>>   </data>
>> </rpc-reply>
>
>
>
> *The <get-config> operation with content-match at parent and child nodes;*
>
> <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>
>>             <type>admin</name>
>>             <company-info>
>>               <dept>1</dept>
>>             </company-info>
>>           </user>
>>         </users>
>>       </top>
>>     </filter>
>>   </get-config>
>> </rpc>
>
>
> *The equivalent XPATH expression : *
>
>> <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
>>   <get-config>
>>     <source>
>>       <running/>
>>     </source>
>>     <filter xmlns:t="http://example.com/schema/1.2/config"
>>                  type="xpath"
>>
>>  select="/t:top/t:users/t:user[t:type='admin']/t:company-info[t:dept=’1’]"/>
>>         </get-config>
>>      </rpc>
>
>
> For this what could be the response
>
> a) The response based on content-match nodes are AND-ed together
>
>> <rpc-reply message-id="101"
>> xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
>>        <data>
>>       </data>
>>      </rpc-reply>
>
> OR
>
> b)  The response based on content-match nodes treated separately
>
>> <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>fred</name>
>>           <type>admin</type>
>>           <full-name>Fred Flintstone</full-name>
>>         </user>
>>         <user>
>>           <name>barney</name>
>>           <type>admin</type>
>>           <full-name>Barney Rubble</full-name>
>>         </user>
>>       </users>
>>     </top>
>>   </data>
>> </rpc-reply>
>
>
> Regards,
> Shiva
>
>
>
>

---

From: Alex Campbell <[email-masked]>
Date: Thu, 24 May 2018 00:26:01 +0000

Hi,

Since nobody else has answered I'll have a go.

I'm not familiar with subtree filtering, but I am with XPath. Assuming your XPath translation is accurate, it will return no data (response A).

________________________________
From: netmod <[email-masked]> on behalf of Shiva Kumar Pathori <[email-masked]>
Sent: Tuesday, 22 May 2018 8:38 p.m.
To: [email-masked]
Subject: [netmod] Clarification about subtree filtering

Hi,
Can somebody clarify what could be the response for the <get-config> operation provided below.

Following is the user information in the datastore that is provided in the RFC 6241 as example.
<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/>
           </top>
         </filter>
       </get-config>
     </rpc>

<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <data>

The <get-config> operation with content-match at parent and child nodes;

The equivalent XPATH expression :
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get-config>
    <source>
      <running/>
    </source>
    <filter xmlns:t="http://example.com/schema/1.2/config"
                 type="xpath"
                 select="/t:top/t:users/t:user[t:type='admin']/t:company-info[t:dept='1']"/>
        </get-config>
     </rpc>

a) The response based on content-match nodes are AND-ed together
<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <data>
      </data>
     </rpc-reply>
OR

<rpc-reply message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">

Regards,
Shiva

---

From: Shiva Kumar Pathori <[email-masked]>
Date: Mon, 28 May 2018 14:57:19 +0530

Thanks Alex for the clarification. Can somebody please clarify about
subtree filter behaviour or provide some pointers in RFC so that I can
refer to it.

On Thu 24 May, 2018, 5:56 AM Alex Campbell, <[email-masked]>
wrote:

> I'm not familiar with subtree filtering, but I am with XPath. *Assuming
> your XPath translation is accurate*, it will return no data (response A).
>
>
> ------------------------------
> *From:* netmod <[email-masked]> on behalf of Shiva Kumar Pathori
> <[email-masked]>
> *Sent:* Tuesday, 22 May 2018 8:38 p.m.
> *To:* [email-masked]
> *Subject:* [netmod] Clarification about subtree filtering
>
>
> Hi,

---

From: Juergen Schoenwaelder <[email-masked]>
Date: Mon, 28 May 2018 11:48:14 +0200

Hi,

this is a netconf question and not a netmod question.

/js

On Mon, May 28, 2018 at 02:57:19PM +0530, Shiva Kumar Pathori wrote:
> >>>  select="/t:top/t:users/t:user[t:type='admin']/t:company-info[t:dept=???1???]"/>
> >>>         </get-config>
> >>>      </rpc>
> >>
> >>

> _______________________________________________
> 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/>

---

From: Shiva Kumar Pathori <[email-masked]>
Date: Mon, 28 May 2018 23:35:02 +0530

Hi,  I also have put the same question in netconf group.