Automation
Automation

Scripting How-To: Iterating a Configuration Change Inside a for-each Loop

by Juniper Employee on ‎03-30-2016 02:24 PM - edited on ‎08-23-2017 12:01 PM by Administrator Administrator (1,967 Views)

You can write an event script  to perform a configuration change by looping through the routing instances of the router and change some attributes of the static routes. To do so, use the following script:

 

var $configuration = {

    <configuration> {

         <top-level-tag> {

                  for-each ($something) {

                         <some-other-tag> {

                                  ..

                           }

                 }

        }

    }

}

 

var $results := { call jcs:load-configuration($connection, $configuration); }

 

 

Feedback