Subject: [netmod] filter with selection nodes

From: David Reid <[email-masked]>
Date: Thu, 28 May 2009 16:53:01 -0400

Can I use a netconf subtree filter with selection nodes to select one leaf
in a list? For example, is the following legal if ifIndex is the key:

<rpc message-id="3" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
  <get>
    <filter type="subtree">
      <interfaces xmlns="http://www.snmp.org/yang/mib/IF-MIB">
        <ifTable>
          <ifEntry>
            <ifDescr/>
          </ifEntry>
        </ifTable>
      </interfaces>
    </filter>
  </get>
</rpc>

I would expect that to return all instances of ifDescr, but the yang spec
says the keys have to be encoded first in a list and I didn't include the
key.

-David Reid

---

From: Andy Bierman <[email-masked]>
Date: Thu, 28 May 2009 14:55:38 -0700

> says the keys have to be encoded first in a list and I didn't include the

This is an area that is a bit unclear in 4741.
I think it is good to always return the keys
in subtree and XPath filter results, otherwise
the manager does not know which ifEntries it
is getting.

XPath is much worse because the spec refers to
a nodeset result, and NETCONF does not have any
concept of nodes -- just XML subtrees starting from root.

> -David Reid

Andy

---

From: David Reid <[email-masked]>
Date: Thu, 28 May 2009 23:39:11 -0400

> the manager does not know which ifEntries it

My question is about the filter. Is the filter legal since it does not include
the key in the list but the yang spec says a list must always include the keys 
as the first items in the list.

-David Reid

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 29 May 2009 08:32:30 +0200 (CEST)

> the manager does not know which ifEntries it

Absolutelty agree that this is the way is ought to work.  However,
the subtree filtering algorithm in 4741 is pretty clear that siblings
nodes to a selection node is not included in the result.  In the
motivation so subtree filter it says:

  "The agent does not need to utilize any data-model-
   specific semantics during processing"

Maybe 4741bis should say that additional nodes MAY be included in the
result, but a generic client can never rely on this, so it better ask
for the keys in the filter (which isn't that difficult anyway - if the
client is prepared to read the keys from the reply, it is trivial to
include them in the request.)

/martin

---

From: Martin Bjorklund <[email-masked]>
Date: Fri, 29 May 2009 08:37:27 +0200 (CEST)

> as the first items in the list.

Yes, the filter and result is legal.  The spec says that keys are
encoded first, and then all the nodes of the list.  This doesn't mean
that all keys and all nodes always MUST be present; nodes can be
missing if you didn't select them in the filter or if you don't have
access to them.

/martin

---

From: Andy Bierman <[email-masked]>
Date: Fri, 29 May 2009 00:47:06 -0700

> as the first items in the list.

The filter element is 'anyxml', so none of the
encoding rules for lists actually apply to it.

Andy