[NETCONF-536] Add support for <candidate> validation Created: 13/Apr/18  Updated: 04/May/18  Resolved: 04/May/18

Status: Resolved
Project: netconf
Component/s: netconf
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Medium
Reporter: Marek Gradzki Assignee: Marek Gradzki
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Add support for validating <candidate> datastore as defined in:

https://tools.ietf.org/html/rfc4741#section-8.6

 

Positive Response:

If the device was able to satisfy the request,
an <rpc-reply> is sent that contains an <ok> element.

Negative Response:

An <rpc-error> element is included in the <rpc-reply>
if the request cannot be completed for any reason.
A validate operation can fail for any of the following reasons:
+  Syntax errors
+  Missing parameters
+  References to undefined configuration data

Example:

<rpc message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <validate>
         <source>
           <candidate/>
         </source>
       </validate>
     </rpc>

     <rpc-reply message-id="101"
          xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
       <ok/>
     </rpc-reply>


 Comments   
Comment by Marek Gradzki [ 13/Apr/18 ]

MDSAL DOMDataBroker transaction APIs (e.g. DOMDataReadWriteTransaction) do not provide validate.

Adding it is definitely possible but values it brings to MD-SAL DOM APIs are questionable

(three phase commit protocol is available as DOMDataBrokerExtension).
 

Comment by Marek Gradzki [ 13/Apr/18 ]

In the 2P/3P commit protocol, in case of "No" votes, commit is aborted.

On the other hand, <validate> RPC can be sent multiple times by user during single transaction. E.g. user can issue <edit-config> to fix issues with the <candidate> DS, validate it again and send <commit> when DS is valid.

Therefore 2P/3P commit is not the right model for <validate> implementation.

Comment by Marek Gradzki [ 13/Apr/18 ]

Support for validating transaction is just needed for NETCONF northbound (mdsal-netconf-connector). Most probably it would not be used by other ODL components. So other alternatives are providing specialized NetconfDataBroker or introducing DOMDataBrokerExtension with support for transaction validation.

The second solution looks much cleaner, because it requires less boilerplate code.

Comment by Marek Gradzki [ 04/May/18 ]

Fluorine:

https://git.opendaylight.org/gerrit/#/c/70917/

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