Log a Message About a Commit Operation Using the Junos XML Protocol
In a Junos XML protocol session with a device running
Junos OS, to log a comment when performing a commit operation, a client
application encloses the <log>
tag element
in <commit-configuration>
and <rpc>
tag elements:
<rpc> <commit-configuration> <log>message</log> </commit-configuration> </rpc>
The <log>
element can be combined
with other tags within the <commit-configuration>
tag element (the <at-time>
, <confirmed/>
, and <confirm-timeout>
, or <synchronize/>
tag elements) and
does not change the effect of the operation. When the <log>
tag element is emitted by itself, the associated
commit operation begins immediately.
The following example shows how to log a message as the candidate configuration is committed.
![](../../images/t1154.gif)
The commit history, which includes any commit comments,
stores an entry for each pending commit and up to 50 previous commits
for the standard configuration database. To request the history, a
client application encloses the <get-commit-information/>
tag in <rpc>
tag elements. The equivalent
operational mode CLI command is show system commit
.
<rpc> <get-commit-information/> </rpc>
The Junos XML protocol server encloses the information
in <commit-information>
and <rpc-reply>
tag elements. For information about
the child tag elements of the <commit-information>
tag element, see its entry in the Junos XML API Operational Developer Reference.
<rpc-reply xmlns:junos="URL"> <commit-information> <!-- tag elements representing the commit log --> </commit-information> </rpc-reply>
The following example shows how to request the commit log.
![](../../images/t1183.gif)