Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 

Understanding Named Templates in Junos OS Automation Scripts

 

Junos OS provides several named templates that can be used in commit, op, event, and SNMP scripts to more easily accomplish scripting tasks on devices running Junos OS. The named templates reside in import files, which are included with the standard Junos OS installation available on switches, routers, and security devices running Junos OS. Table 1 summarizes the Junos OS named templates.

For information about using named templates in automation scripts, see Using Named Templates in Junos OS Automation Scripts.

Table 1: Junos OS Named Templates

Template

Description

Supported in Python Scripts

jcs:edit-path

Generate an <edit-path> element suitable for inclusion in an <xnm:error> or <xnm:warning> element.

jcs:emit-change (XSLT/SLAX)

jcs.emit_change (Python)

Generate a persistent or transient change to the configuration.

Y

jcs:emit-comment

Emit a simple comment that indicates a change was made by a commit script.

jcs:grep

Search a file for all instances matching a specified regular expression and write the matching strings and corresponding lines to the result tree.

jcs:load-configuration

Make structured changes to the Junos OS configuration using an op script.

jcs:statement

Generate a <statement> element suitable for inclusion in an <xnm:error> or <xnm:warning> element.