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

The steps for the recipe are as follows:

  1. Familiarize yourself with the XML format used within JUNOS OS to represent configuration data. Generally speaking, the XML representation follows the same hierarchy as the configuration format itself. JUNOS OS itself can help you here. Issue the show configuration | display xml command in order to see a portion of the configuration expressed in XML:
      adamc@router> show configuration interfaces em0.0 | display xml       <rpc-reply xmlns:JUNOS="http://xml.juniper.net/JUNOS/                              15.1F6/JUNOS">      <configuration JUNOS:commit-seconds="3780" JUNOS:commit-         localtime="1970-01-01 01:03:00 UTC" JUNOS:commit-user="adamc">            <interfaces>                <interface>                     <name>em0</name>                        <unit>                           <name>0</name>                           <family>                               <inet>

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