[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

edit-config operation



Hi,

edit-config is not clear to me, in particular the merge operation:

"merge: The configuration data identified by the element
 containing this attribute is merged with the configuration
 at the corresponding level in the configuration datastore
 identified by the target parameter.  This is the default
 behavior."

The draft says that the element must be merged in the config but it does not explain how. Is there a clear definition of merge for XML elements ?
Also the given examples silently assume that the "name" element is a selection key. It should be explicit in the draft.

For example, let's imagine a data model where:
- the root element is "foo"
- foo must have a "name" child
- foo may have zero to two "bar" elements
- "bar" is a simpleType element

Initial config:
<foo>
 <name>bla</name>
 <bar>bar1</bar>
</foo>

Request:
<foo xc:operation='merge'>
 <name>bla</name>
 <bar>bar2</bar>
</foo>

Possible outputs:
<foo>
 <name>bla</name>
 <bar>bar2</bar>
</foo>

<foo>
 <name>bla</name>
 <bar>bar1</bar>
 <bar>bar2</bar>
</foo>

Under merge meaning is implicitely a combination of replace or create operation ?
There is no clear separation between the selecting nodes and nodes that must be updated.
Even with replace operation we have the problem since we don't know which bar must be replaced.

Anybody implementing has the same problems ?

Another thing: we are planning to implement a new edit-config with xpath, as a new capability. It will look like that:

      <edit-config>
        <target>
          <running/>
        </target>
        <config type="xpath" operation="replace" sel="/netconf/security/rbac/users/user[name='Alice']">
          <user>
             <name>Alice</name>
             <login>alicefoo</login>
             <building>a2</building>
             <room>100</room>
          </user>
        </config>
      </edit-config>

If the wg is interested to merge it to the standard xpath capability, just request more details.
We believe that edit-config should be extended with XPath in a similar way than get-config.

Sorry for the long mail.
Thanks for your help.
Vincent




begin:vcard
fn:Vincent Cridlig
n:Cridlig;Vincent
org:LORIA - INRIA Lorraine;Madynes
adr:;;;Nancy;;;France
email;internet:cridligv@loria.fr
title:PhD Student
tel;work:+33 (0)3 83 59 20 48
url:http://www.loria.fr/~cridligv
version:2.1
end:vcard