cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1197
Views
0
Helpful
2
Replies

NSO Maapi return commit ID/ rollback ID when trans.apply()

Hi all,


can any one tell me / point me in the direction of how to get the commit_ID/Rollback ID number when applying and trans.apply() in python

 

Thanks

Regards

Yale

2 Replies 2

mvolf
Cisco Employee
Cisco Employee

The C language MAAPI contains maapi_get_rollback_id, see also man confd_lib_maapi. Most, hopefully all C functions are available to the low-level Python binding, but obviously not all of them make it to the high-level binding that you are using, so you need to resort to the low-level API like this:

>>> trans.apply()
>>> import _ncs
>>> rollback_id = _ncs.maapi.get_rollback_id(trans.maapi.msock, trans.th)
>>> rollback_id
10001
>>> 

rogaglia
Cisco Employee
Cisco Employee
Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the NSO Developer community: