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

Example: Generating a Transient Change

Using a commit script, make a transient configuration change that sets PPP encapsulation on all SONET/SDH interfaces with the IPv4 protocol family enabled:

XSLT Syntax

<?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">
        <xsl:for-each select="interfaces/interface[starts-with(name, 'so-')                           and unit/family/inet]">
            <xsl:call-template name="jcs:emit-change">
                <xsl:with-param name="tag" select="'transient-change'"/>
                <xsl:with-param name="content">
                    <encapsulation>ppp</encapsulation>
                </xsl:with-param>
            </xsl:call-template>
        </xsl:for-each>
    </xsl:template>

</xsl:stylesheet>

SLAX Syntax

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 {
    for-each (interfaces/interface[starts-with(name, 'so-') and unit/family/inet]) {
        call jcs:emit-change($tag = 'transient-change') {
            with $content = {
                <encapsulation> "ppp";
            }
        }
    }
}

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