Re: [netmod] Clarification about subtree filtering

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Mon, 28 May 2018 09:48 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 0343C126BF6 for <netmod@ietfa.amsl.com>; Mon, 28 May 2018 02:48:20 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] 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 mWJOe2RkExJC for <netmod@ietfa.amsl.com>; Mon, 28 May 2018 02:48:17 -0700 (PDT)
Received: from anna.localdomain (firewallix.jacobs-university.de [212.201.44.247]) by ietfa.amsl.com (Postfix) with ESMTP id 2FEBF12420B for <netmod@ietf.org>; Mon, 28 May 2018 02:48:16 -0700 (PDT)
Received: by anna.localdomain (Postfix, from userid 501) id 79D002188052; Mon, 28 May 2018 11:48:14 +0200 (CEST)
Date: Mon, 28 May 2018 11:48:14 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Shiva Kumar Pathori <pathori@gmail.com>
Cc: Alex Campbell <Alex.Campbell@aviatnet.com>, netmod@ietf.org
Message-ID: <20180528094814.rzovxin7q4hgshff@anna.jacobs.jacobs-university.de>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Shiva Kumar Pathori <pathori@gmail.com>, Alex Campbell <Alex.Campbell@aviatnet.com>, netmod@ietf.org
References: <CAJtYN8+WZjtjrhmGcNWTcpqFCcmwLNjT0LtRU_U8+x-EZhSwCA@mail.gmail.com> <CAJtYN8LRJ0sXLWGDagpwiRDJSjgU70V+PW8yYdz9K7FNOJnUqw@mail.gmail.com> <1527121561343.62896@Aviatnet.com> <CAJtYN8KKSGzUshaRDRds1SR7kxQyVH7T+WVErWhEbwcAZ2aFzw@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <CAJtYN8KKSGzUshaRDRds1SR7kxQyVH7T+WVErWhEbwcAZ2aFzw@mail.gmail.com>
User-Agent: NeoMutt/20180512
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/aH3gs_DRnbI7p-nbUE1SXD0mhbg>
Subject: Re: [netmod] Clarification about subtree filtering
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Mon, 28 May 2018 09:48:20 -0000

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:
> 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, <Alex.Campbell@aviatnet.com>
> wrote:
> 
> > 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 <netmod-bounces@ietf.org> on behalf of Shiva Kumar Pathori
> > <pathori@gmail.com>
> > *Sent:* Tuesday, 22 May 2018 8:38 p.m.
> > *To:* netmod@ietf.org
> > *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>
> >>>     <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
> >>
> >>
> >>
> >>

> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> 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/>