cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
134
Views
10
Helpful
1
Replies
Highlighted
Cisco Employee

rollback commits done using template apply

Hi All,

I'm applying a template using _ncs.maapi APIs, is there any way to rollback the applied template ?

 

with maapi.single_write_trans("admin", "system", db=ncs.RUNNING) as th:
comp_vars = dict(comp_vars)
vars = ncs.template.Variables()

vars.add("NODE", comp_vars["NODE"])
vars.add("NAME", comp_vars["NAME"])
self.log.info('Applying kicker template for XXXXX-internal-oper-data changes: ', \
service.name)
_ncs.maapi.apply_template(th.maapi.msock,th.th, 'XXXXXX-oper-data-kicker', vars, 0, '/')
1 REPLY 1
Highlighted
Cisco Employee

Hello,

 

you can have a look at the answer from @rogaglia on this thread that gives you options for NSO after 5.4 using a new API and how it was done before this API was introduced.

https://community.cisco.com/t5/nso-developer-hub-discussions/commit-and-rollback-usint-action-python-code/td-p/4143825

 

Regards,