The confirmed commit procedure in NETCONF allows an edit transaction to be automatically rolled back unless confirmed within a specific time period.
This is very useful for applying edits across multiple devices at once, in case the edit fails on one or more devices.
Confirmed Commit
The confirmed commit is an edit method that will require a confirming commit, or it will be rolled back.
RESTCONF [8040] does not officially support the confirmed commit procedure. This is supported by netconfd-pro using the following query parameters for the POST, PUT, PATCH, and DELETE methods on data resources:
- confirmed=1: indicates the edit is a confirmed commit operation
- Usage: mandatory to initiate the confirmed commit procedure
- Note: the value 1 is required because of HTTP query format; the type is not empty!
- confirm-timeout=N: where N indicates the number of seconds to wait before automatically rolling back the edit
- Usage: optional; default is 300 seconds
- persist=string:Identifies the token string that will be required to confirm the commit.
- Usage: mandatory
POST /restconf/data?confirmed=1&confirm-timeout=30&persist=abcde HTTP/1.1 Host: example.com Content-Type: application/yang-data+json { "test:uint8.1" : 42 }
Confirming Commit
The confirming commit is an operation resource (invoke the NETCONF <commit> operation).
It must not contain the 'confirmed' parameter or else it will be considered a confirmed commit by the server.
The POST method is used with the following message-body:
- persist-id=string: Identifies the token string that was used in the 'persist' parameter during the confirmed commit
POST /restconf/operations/ietf-netconf:commit HTTP/1.1 Host: example.com Content-Type: application/yang-data+json { "input" : { "persist-id" : "abcde" } }
Cancelling a Confirmed Commit
The confirmed commit will automatically timeout after the 'confirm-timeout' interval.
The confirmed commit can be rolled back using the NETCONF cancel-commit operation
POST /restconf/operations/ietf-netconf:cancel-commit { "input" : { "persist-id" : "abcde" } }