The commit history provides a persistent history of configuration changes committed in model-driven interfaces. A separate history of the last commits (default 50, up to 200) is maintained for each configuration region (bof, configure, debug, and li). Each commit is uniquely identified by a numerical sequential incrementing commit ID assigned by the system.
The user can display the commit history with the MD-CLI show system management-interface commit-history command and also in the state model, in state system management-interface configuration-region <region-name> commit-history. The saved configuration file header also displays the commit history from the last configuration save.
An optional commit comment can be entered using the MD-CLI commit comment command or the NETCONF <commit> RPC. Newline separators (\n) can be entered in the comment string to display multiple comment lines.
The following example shows the first commit made by the system when the router boots, followed by two commits by a user with the MD-CLI.
[ex:/configure]
A:admin@node-2# commit comment "Second commit with the MD-CLI."
[ex:/configure]
A:admin@node-2# commit comment "Third commit with the MD-CLI."
[ex:/configure]
A:admin@node-2# /show system management-interface commit-history
===============================================================================
Commit History
===============================================================================
Total Commits : 3
3
Committed 2022-02-01T11:01:03.8-05:00 by admin (MD-CLI) from 10.1.145.205
Comment "Third commit with the MD-CLI."
Location "cf3:\config.cfg"
2
Committed 2022-02-01T11:00:47.7-05:00 by admin (MD-CLI) from 10.1.145.205
Comment "Second commit with the MD-CLI."
Location "cf3:\config.cfg.1"
1
Committed 2022-02-01T10:56:01.3-05:00 by system (MD-CLI) from Console
Log "System booted version B-22.2.R1."
Location "Configuration is not saved to startup."
The following example shows a fourth commit made by automation using the NETCONF <commit> RPC with the <comment> augmentation:
<rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<commit>
<comment>Fourth commit with NETCONF.</comment>
</commit>
</rpc>
]]>]]>
The following example displays the commit history after the preceding activity:
[]
A:admin@node-2# show system management-interface commit-history
===============================================================================
Commit History
===============================================================================
Total Commits : 4
4
Committed 2022-02-01T11:13:38.7-05:00 by admin (NETCONF) from 10.1.236.68
Comment "Fourth commit with NETCONF."
Location "cf3:\config.cfg"
3
Committed 2022-02-01T11:01:03.8-05:00 by admin (MD-CLI) from 10.1.145.205
Comment "Third commit with the MD-CLI."
Location "cf3:\config.cfg.1"
2
Committed 2022-02-01T11:00:47.7-05:00 by admin (MD-CLI) from 10.1.145.205
Comment "Second commit with the MD-CLI."
Location "cf3:\config.cfg.2"
1
Committed 2022-02-01T10:56:01.3-05:00 by system (MD-CLI) from Console
Log "System booted version 22.2.R1."
Location "Configuration is not saved to startup."
The following usage guidelines apply to the commit history.
The commit history is supported in model-driven configuration mode only.
The system files located in the cf3:\.commit-history directory must not be edited or deleted.
Editing the BOF from the boot loader does not create a commit history entry.
Nokia recommends setting the commit history value to at least 50, which is the default value. The commit history can be disabled by setting the value to 0.
The MD-CLI environment time-format and environment time-display parameters can be used to change the time formats displayed in the output of the following commands:
the Generated and Finished lines in admin show configuration
show system management-interface commit-history
info state system management-interface <region-name> commit-history
The MD-CLI environment parameters do not change any time formats in the saved configuration file header or footer. These time formats are always written in RFC 3339 format in the Coordinated Universal Time (UTC) or local time zone according to the value of configure system time prefer-local-time.