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

While there is a lot in common between this op script and the previous recipes that we've worked with, there are also some new techniques in this recipe that require explanation. I'll call them out piece by piece.

Steps 1 and 2 are pretty regular now and form the part of most, if not all, op scripts. In step 3, we have something new, however: a SLAX template. SLAX templates are small usable components of XML and SLAX that can be called upon as required with parametric input. It can be convenient to think of templates like a function call in conventional programming languages.

A SLAX template isn't exactly like a function call however, so be careful. Note the fact that the variable namespace of the template is the same as that ...

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