[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: nested operation attribute interoperability
>....
Also because there is no text whatsoever in the document
that declares an error condition if 'replace' is invoked
against an empty portion of the target config.
I was wrong. There is some text.
The document is rather sloppy in this area.
Here is the operation attribute definition section [p. 37]:
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.
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.
create: The configuration data identified by the element
containing this attribute is added to the configuration if
and only if the configuration data does not already exist on
the device. If the configuration data exists, an <rpc-
error> element is returned with an <error-tag> value of
data-exists.
delete: The configuration data identified by the element
containing this attribute is deleted in the configuration
datastore identified by the target parameter.
Note that only the 'create' operation defines an error condition here,
but Appendix A does say delete can cause an error. It treats
replace and delete the same wrt/ data-missing error:
Tag: data-exists
Error-type: application
Severity: error
Error-info: none
Description: Request could not be completed because the relevant
data model content already exists. For example,
a 'create' operation was attempted on data which
already exists.
Tag: data-missing
Error-type: application
Severity: error
Error-info: none
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 which does not exist.
*** IMO, the 2nd sentence above is wrong. ***
The text on pg 37 for 'replace' says:
Unlike a <copy-config> operation, which replaces
the entire target configuration, only the configuration
actually present in the config parameter is affected.
The text for copy-config on pg 43 says:
Create or replace an entire configuration datastore with the
contents of another complete configuration datastore. If the
target datastore exists, it is overwritten. Otherwise, a new one
is created, if allowed.
Given the other definitions of 'create' and 'replace', this text
is rather confusing.
---------------------
History:
The WG started out with only merge and replace.
Merge was existing CLI behavior.
Replace was delete-if-it-exists, and then re-create it.
Replace was meant to simplify CLI like:
no access-list 101
access-list 101 ....
Then some WG members decided these 2 operations were not
sufficient precisely because they did not generate errors
in these corner-cases. So we added create (only if it
does not exist) and delete (only if it exists).
I do not remember ever changing the definition of replace
to cause an error like delete. I remember the opposite.
It is supposed to work like copy-config, except just
on the specified config subset. IMO, the 2 words 'replace or'
in Appendix A are incorrect.
Allowing create under a replace might make sense though, if we want to
be liberal.
I'm happy to change this code to make it interopable.
/martin
Andy
Andy
--
to unsubscribe send a message to netconf-request@ops.ietf.org with
the word 'unsubscribe' in a single line as the message text body.
archive: <http://ops.ietf.org/lists/netconf/>