Blogs

Scripting How-To: Commit script boilerplate

By Erdem posted 08-07-2015 23:49

  

Overview

Commit script boilerplate recommended for SLAX 1.1 use in Junos OS Release 12.2 or later. This applies to SLAX version 1.1 and higher.

 

Feature

 

The commit script boilerplate stays largely intact. It already does the job it needs to do, so it will keep on doing it.

01
	version 1.1;
02
	 
03
	ns junos = "http://xml.juniper.net/junos/*/junos";
04
	ns xnm = "http://xml.juniper.net/xnm/1.1/xnm";
05
	ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0";
06
	 
07
	import "../import/junos.xsl";
08
	 
09
	match configuration {
10
	    /* Insert code here */
11
	}

As you can see, the only actual change is a shift in the version number from 1.0 to 1.1. The namespaces stay the same, the import statement stays the same, and the starting template remains match configuration. Because of this commonality with the SLAX 1.0 boilerplates, commit scripts that follow the 1.1 boilerplate behave in the same way as those that follow the 1.0 boilerplate:

 

  1. Initial context node is /commit-script-input/configuration.
  2. <commit-script-results> top-level element automatically encapsulates all elements your script adds to the result tree.

Note: As a reminder, this is a Junos OS Release 12.2 feature. So, if your platform is stuck on a special branch then you might be waiting a while to see this. In particular, I don't think that SRX devices will get this boilerplate improvement—or any other SLAX 1.1 enhancementuntil the end of 2013 (Junos OS Release 13.3).

 

Source

 

Original from Curtis Call blog post Oct. 12, 2012. Released to TechWiki with permission.


#commitscript
#ScriptingHow-To
#Slax
#How-To