By itself, the custom syntax in an apply-macro statement has no operational impact on the routing platform. To give meaning to your syntax, there must be a corresponding commit script that uses the syntax as data for generating related standard JUNOS statements. To write such a script, follow these steps:
You must include either the XSLT or SLAX boilerplate in all commit scripts. For detailed information about this boilerplate, see Boilerplate for Commit Scripts.
XSLT Boilerplate
<?xml version="1.0" standalone="yes"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:junos="http://xml.juniper.net/junos/*/junos"
xmlns:xnm="http://xml.juniper.net/xnm/1.1/xnm"
xmlns:jcs="http://xml.juniper.net/junos/commit-scripts/1.0">
<xsl:import href="../import/junos.xsl"/>
<xsl:template match="configuration">
<!- - ... insert your code here ... - ->
</xsl:template>
</xsl:stylesheet>
SLAX Boilerplate
version 1.0;
ns junos = "http://xml.juniper.net/junos/*/junos";
ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";
import "../import/junos.xsl";
match configuration {
/*
* Insert your code here.
*/
}
For an XSLT example, see XSLT Syntax. For a SLAX example, see SLAX Syntax.
If a platform has dual Routing Engines and you want the script to take effect on both Routing Engines, you must copy the script to the /var/db/scripts/commit directory on each Routing Engine. The commit synchronize command does not automatically copy the scripts from one Routing Engine directory into the other Routing Engine directory.
- [edit system scripts commit]
-
file filename;
- [edit system scripts commit]
-
allow-transients;
If all the commit scripts run without errors, any transient changes are loaded into the checkout configuration, but not to the candidate configuration. Any persistent changes are loaded into the candidate configuration. The commit process then continues by validating the configuration and propagating changes to the affected processes on the routing platform.