Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Announcement: Try the Ask AI chatbot for answers to your technical questions about Juniper products and solutions.

close
header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
Automation Scripting User Guide
Table of Contents Expand all
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

jcs:emit-comment Template

date_range 13-Feb-21

XSLT Syntax

content_copy zoom_out_map
<junos:comment>
    <xsl:text>...</xsl:text>
</junos:comment>

Description

Generate a comment in the configuration from within a commit, event, or op script. The template contains a <junos:comment> element. You never call the jcs:emit-comment template directly. Rather, you include its <junos:comment> element and the child element <xsl:text> inside a call to the jcs:emit-change template, a <change> element, or a <transient-change> element.

Usage Examples

The following example demonstrates how to call this template in a commit script:

content_copy zoom_out_map
<xsl:call-template name="jcs:emit-change">
    <xsl:with-param name="content">
        <term>
            <name>very-last</name>
            <junos:comment>
                <xsl:text>This term was added by a commit script</xsl:text>
            </junos:comment>
            <then>
                <accept/>
            </then>
        </term>
    </xsl:with-param>
</xsl:call-template>

When you issue the show firewall configuration mode command, the following output appears:

content_copy zoom_out_map
[edit]
user@host# show firewall
family inet {
    term very-last {
          /* This term was added by a commit script */
    then accept;
    }
}
footer-navigation