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

Get JUNOS Automation Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.