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 it works...

The structure and layout of the op script can make it difficult to follow, partly because SLAX op scripts are an XML pipeline, but we can focus on the cut and thrust of the logic that each step is trying to achieve.

In step 1, we define the standard boilerplate required for every SLAX op script on JUNOS. In step 2 we declare interface and mode special global parameters. This tells the CLI to expect the user to try to use these keywords for parameters. In the arguments node-set, we can actually include some tokens that will populate the CLI interactive help. Finally we take the interface and split it into two parts, separated by a period (.), because we'll likely need the interface components in this way as we explore the XML ...

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