O'Reilly logo

JUNOS Automation Cookbook by Adam Chappell

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How to do it...

We're going to deploy a SLAX commit script which will operate after each candidate configuration is submitted and which will apply logic rules to validate whether the configuration is sensible before either allowing the configuration to continue or aborting the operation with an error message.

  1. Create a new SLAX script, commit.slax, and start with the required SLAX boilerplate for a commit script:
      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 {        /* our code goes here */      }
  1. Within the configuration braces, insert logic to validate:
    • The presence of ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required