[NETCONF-312] ODL always uses edit operation "replace" Created: 31/Oct/16  Updated: 14/Dec/23

Status: Confirmed
Project: netconf
Component/s: restconf-nb
Affects Version/s: None
Fix Version/s: 7.0.0

Type: Bug
Reporter: Sven Wisotzky Assignee: Ruslan Kashapov
Resolution: Unresolved Votes: 0
Labels: pick-next, pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Issue Links:
Relates
relates to NETCONF-706 Add support of new a NetconfDataTreeS... Resolved
External issue ID: 7069
Priority: Normal

 Description   

In my testing, ODL is always generating NETCONF <edit-config> requests with operation "replace". According to IETF Draft IETF NETCONF RESTCONF the following is expected:

-------------------------------------------------------+

RESTCONF NETCONF

-------------------------------------------------------+

OPTIONS none
HEAD none
GET <get-config>, <get>
POST <edit-config> (nc:operation="create")
POST invoke an RPC operation
PUT <edit-config> (nc:operation="create/replace")
PATCH <edit-config> (nc:operation="merge")
DELETE <edit-config> (nc:operation="delete")

-------------------------------------------------------+
REFERENCE https://tools.ietf.org/html/draft-ietf-netconf-restconf

As a matter of consequence ODL is currently running into issues, for vendors who have not yet implemented the "replace" operation.

Somehow I believe, this is caused by an incomplete implementation. OpenDaylight already has the "checkItemDoesNotExists()" method implemented. So it should use this information to decide about using the "create" or "replace" method based on using POST or PUT.



 Comments   
Comment by Wenbo Hu [ 23/Mar/17 ]

It also affects create operation in YANG Patch.
The problem is that "DOMDataWriteTransaction" interface only provides <put> and <merge> method.

I'm trying to fix this bug by wrapping payload of a "create" request with a implementation of NormalizedNode interface (PostNormalizedNode) in org.opendaylight.netconf.sal.restconf.impl.BrokerFacade.
And modify org.opendaylight.netconf.sal.connect.netconf.sal.tx.AbstractWriteTx#put method to check if the data is an instance of PostNormalizedNode.

Current problem is that org.opendaylight.netconf.sal.restconf.impl.BrokerFacade is in sal-rest-connector module, while org.opendaylight.netconf.sal.connect.netconf.sal.tx.AbstractWriteTx is in sal-netconf-connector module.
I'm not sure where should I put the PostNormalizedNode?

Comment by Wenbo Hu [ 24/Mar/17 ]

I made a fix for this:
https://git.opendaylight.org/gerrit/#/c/53764/

Comment by Tomas Cere [ 10/Oct/17 ]

The above patch had no movement for 4months, so back in queue

Comment by Robert Varga [ 14/Dec/23 ]

So NETCONF-773 provides the isolation for this, so  the way these work is under control of NetconfRestconfStrategy.

I think we have a duplicate of this somewhere.

Generated at Wed Feb 07 20:14:41 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.