/* * This script transiently disables all unconfigured ge and xe interfaces. */ version 1.0; ns junos = "http://xml.juniper.net/junos/*/junos"; ns xnm = "http://xml.juniper.net/xnm/1.1/xnm"; ns jcs = "http://xml.juniper.net/junos/commit-scripts/1.0"; import "../import/junos.xsl"; match configuration { /* Get the current interface list */ var $interfaces = jcs:invoke( "get-interface-information" ); /* Only ge and xe interfaces */ var $ge-interfaces = $interfaces/physical-interface[starts-with(name, "ge-") or starts-with(name, "xe-")]; var $interface-hierarchy = interfaces; /* Go through each ge interface, if it isn't within the configuration than transiently disable it */ for-each( $ge-interfaces ) { if( jcs:empty( $interface-hierarchy/interface[name == current()/name ] ) ) { { { { name; ; } } } } } }