Re: [Netconf] about subtree filtering
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Netconf] about subtree filtering
Hi,
----- Original Message -----
From: Martin Bjorklund <mbj at tail-f.com>
Date: Friday, June 26, 2009 7:19 pm
Subject: Re: [Netconf] about subtree filtering
To: Washam.Fan at huaweisymantec.com
Cc: andy at netconfcentral.com, netconf at ietf.org
> WashamFan <Washam.Fan at huaweisymantec.com> wrote:
> > Well, the data model might like this:
> >
> > container users {
> > list user {
> > container basic {
> > leaf name { ...}
> > leaf type {...}
> > leaf full-name { ... }
> > }
> > leaf role { ... }
> > }
> > }
> >
> > So, the filter
> >
> > <users>
> > <user>
> > <basic>
> > <name>fred</name>
> > <type/>
> > <full-name/>
> > </basic>
> > <role/>
> > </user>
> > </users>
> >
> > will help return what I want?
>
> Assuming this is config, the data model is not quite correct - the
> list lacks a key. So if we do:
>
> container users {
> list user {
> key name;
> leaf name { ...}
> container basic {
> leaf type {...}
> leaf full-name { ... }
> }
> leaf role { ... }
> }
> }
>
> Then the filter:
>
> <users>
> <user>
> <name>fred</name>
> <basic>
> <type/>
> <full-name/>
> </basic>
> <role/>
> </user>
> </users>
>
> will return the type, full-name, and role of "fred", if they exist,
> which is what you want.
>
> However, the filter:
>
> <users>
> <user>
> <basic>
> <type/>
> <full-name>Fred Flintstone</full-name>
> </basic>
> <role/>
> </user>
> </users>
>
> will return the role of *all* users, and the type of Fred.
So, <role> is only constrained by the key, but not the
siblings. What if <role> is under a container:
container owner {
container basic {
leaf name { ... }
leaf type { ... }
leaf full-name { ... }
}
leaf role { ... }
}
When the belowing filter is applied:
<owner>
<basic>
<name>fred</name>
<type/>
<full-name/>
</basic>
<role/>
</owner>
If the current owner is fred, the name, type, full-name as well as
role (if exists) of fred would be returned, right?
If the current owner is fan, the name, type, full-name of
fan would not be returned, but would the role of fan be returned?
washam
Note: Messages sent to this list are the opinions of the senders and do not imply endorsement by the IETF.