Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Log a Message About a Commit Operation Using the Junos XML Protocol

date_range 14-Jul-21

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:

content_copy zoom_out_map
<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.

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.

content_copy zoom_out_map
<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.

content_copy zoom_out_map
<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.

external-footer-nav