On 03/15/2012 03:24 AM, hiren panchasara wrote:
change-begin - mark the beginning of a set of revertible network
config changes
change-commit - commit the pending network config changes
change-rollback - rollback (revert) a set of network config changes
Hi folks,
Can someone please take some time out to explain how these commands
are supposed to work?
what is the input and output of these commands?
There is no input/output of the API except success/failure.
it seems we take snapshots of current configurations?
Correct. change-begin stores enough information that running
change-rollback can restore the network configuration to the state it
was in when change-begin was called (using the information stored by
change-begin, of course). change-commit removes the saved state.
One other detail - if the system is rebooted while a transaction is in
process (after "change-begin", but before change-commit or
change-rollback), the network config should be automatically rolled-back
to the saved state; this is done so that if the machine becomes
unreachable as a result of changes to network config, it can be rebooted
and will come back to a known-working state. On Fedora/RHEL, this is
done with an init script (actually, the init script implements most of
the functionality of all three of these APIs) - see
netcf-transaction.init.sh.
can someone shed some light, please?