[Contents] [Prev] [Next] [Index] [Report an Error]

Commit Scripts Overview

JUNOS commit scripts enforce custom configuration rules. Each time a new candidate configuration is committed, the active commit scripts are called and inspect the new candidate configuration. If a configuration violates your custom rules, the script can instruct the JUNOS software to perform various actions, including the following:

Additionally, you can create macros, which allow you to create custom configuration syntax that simplifies the task of configuring a routing platform. By itself, your custom syntax has no operational impact on the routing platform. A corresponding commit script macro uses your custom syntax as input data for generating standard JUNOS configuration statements that execute your intended operational impact.

To view the router's current configuration in the Extensible Markup Language (XML), using the command-line interface's (CLI's) operational mode, issue the show configuration | display xml command. To view your configuration in commit-script-style XML, issue the show configuration | display commit-scripts view command.

Commit scripts are based on the JUNOS XML application programming interface (API) and the JUNOScript API. For more information on the JUNOS XML API and the JUNOScript API, see Introduction to the JUNOS XML and JUNOScript APIs. Commit scripts can be written in either the Extensible Stylesheet Language Transformations (XSLT) or Stylesheet Language Alternative Syntax (SLAX) scripting language . Commit scripts use the XML Path Language (XPath) to locate the configuration objects to be inspected and XSLT or SLAX constructs to specify the actions to perform on the located configuration objects. The actions can change the configuration or generate messages about it. For more information on XSLT, see Understanding XSLT. For more information on SLAX, see Understanding SLAX.

This chapter discusses the following topics:


[Contents] [Prev] [Next] [Index] [Report an Error]