cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1161
Views
5
Helpful
1
Replies

Dry-run of rollback through RESTCONF

tcragg1
Cisco Employee
Cisco Employee

When triggering a selective rollback of a commit through RESTCONF (POST request to /restconf/data/tailf-rollback:rollback-files/apply-rollback-file), setting a dry-run query parameter does not seem to have any effect. Is this expected behaviour because I am calling an action instead of writing changes to ConfDB? And if so, is there a way to perform a dry-run for a commit rollback through RESTCONF?  I know I can pull the rollback file with a GET request to /restconf/data/tailf-rollback:rollback-files/get-rollback-file, but I would like to be able to trigger a dry-run outformat native.

1 Reply 1

rogaglia
Cisco Employee
Cisco Employee

I believe you are facing one of the drawback from a RESTFul API vs using a transactional API such as NETCONF or JSON-RPC.

BTW, check NSO 5.4 (released this week) that improves the rollback process by providing the rollback-id as a YANG extension:

 

Rolling back configuration changes
If rollbacks have been enabled in the configuration using the rollback-id query parameter, the fixed id of
the rollback file creating during an operation is returned in the results. The below examples shows creation
of a new resource and removal of that resource using the rollback created in the first step.
Example 27. Create a new dhcp/subnet resource
POST /restconf/data/dhcp:dhcp?rollback-id=true
Content-Type: application/yang-data+xml
<subnet xmlns="http://yang-central.org/ns/example/dhcp">
<net>10.254.239.0/27</net>
</subnet>
HTTP/1.1 201 Created
Location: http://localhost:8008/restconf/data/dhcp:dhcp/subnet=10.254.239.0%2F27
<result xmlns="http://tail-f.com/ns/tailf-restconf">
<rollback>
<id>10002</id>
</rollback>
</result>
Then using the fixed id returned above as input to the apply-rollback-file action:
Example 28.
POST /restconf/data/tailf-rollback:rollback-files/apply-rollback-file
Content-Type: application/yang-data+xml
<input xmlns="http://tail-f.com/ns/rollback">
<fixed-number>10002</fixed-number>
</input>
HTTP/1.1 204 No Content