Subject: [Netconf] 4741bis: replace operation

From: Andy Bierman <[email-masked]>
Date: Tue, 28 Jul 2009 16:46:47 -0700

Hi,

The differences between the replace and merge operations
within <edit-config> are not 100% clear.

1) the example <rpc-error> on pg 19 for /top/interface
   seems unrealistic.  Is anybody using <error-info>
   this way?  If not, them the example should be updated
   so it is less confusing

2) error handling
   Does replace require the nodes-to-be-replaced
   to already exist, like 'delete'?  (IMO, no)

    7.2, para 3 is clear that only the nodes present in
    the inline or url <config> are going to be affected
    in the target:

      The target configuration is not
      necessarily replaced, as with the <copy-config> message.  Instead,
      the target configuration is changed in accordance with the
      source's data and requested operations.

   The 'replace' text does not say anything about requiring
   the node to exist in the target:

        replace:  The configuration data identified by the element
            containing this attribute replaces any related configuration
            in the configuration datastore identified by the target
            parameter.  Unlike a <copy-config> operation, which replaces
            the entire target configuration, only the configuration
            actually present in the config parameter is affected.

   The confusion comes from the description for the 'data-missing' error-tag
   on page 83:

       Description: Request could not be completed because the relevant
                   data model content does not exist.  For example,
                   a 'replace' or 'delete' operation was attempted on
                   data that does not exist.

   *** I think this text on pg. 83 is wrong. ***

      s/a 'replace' or 'delete'/a 'delete'/

   The intent of replace is to zap the sub-trees that are not in the
   source, but are in the target:

   source:

     <config>
        <foo operation='replace'>
          <foo1>
            <a>1</a>
          </foo1>
        </foo>
        <goo operation='replace'>this is OK, right?</goo>
     </config>

    existing target:

      <config>
        <foo>
          <foo1>
            <a>7</a>
            <b>11</b>
          </foo1>
          <foo2/>
        </foo>
        <bar/>
      </config>

   resulting target:

     <config>
        <foo>
          <foo1>
            <a>1</a>
          </foo1>
        </foo>
        <bar/>
        <goo>this is OK, right?</goo>
     </config>

3)  default-operation='replace'

        replace:  The configuration data in the <config> parameter
            completely replaces the configuration in the target
            datastore.  This is useful for loading previously saved
            configuration data.

    It is not clear what default-operation='replace' means.
    Does the default start at <config>, so this will make
    edit-config (op=replace) just like copy-config?
    Or does it mean just zap nodes that are present in
    the source config, as usual?

    In the example above, will <bar/> be present in the result if
    the default operation is set to 'replace'?

thanks,
Andy

---

From: Martin Bjorklund <[email-masked]>
Date: Wed, 29 Jul 2009 09:49:54 +0200 (CEST)

>    this way?  If not, them the example should be updated

I agree.

>    to already exist, like 'delete'?  (IMO, no)

No it doesn't have to exist, and I agree that this should be
clarified.

>       s/a 'replace' or 'delete'/a 'delete'/

I agree.

>     edit-config (op=replace) just like copy-config?

No.

>     the source config, as usual?

Yes.  The element <config> is not part of the data, so you cannot have
the "nc:operation" attribute on this element, and thus
default-operation does not apply to the <config> element itself.

>     the default operation is set to 'replace'?

Yes.

/martin