You can use a simple configlet to allow multiple selected physical interfaces to be disabled or enabled.
Similar to the Add Lag Member configlet, this configlet supports multiple selected interfaces across multiple devices. You can also select whether to have 802.3ah LFM protocol information added when enabling an interface, or remove the associated protocol information when disabling an interface.
The configlet has been written so that you can also call it through the NBI.
NOTE: The NBI doesn’t support an array of interfaces to be processed (unless you implement a workaround), unlike with the GUI where multiple interfaces can be used.
(Although, to overcome this limitation, I’ve updated the configlet so that it will support multiple interfaces through the NBI, but by using the format ge-1/0/0;ge-1/0/1;ge-1/0/2;... . The configlet just processes the string to create an array when called through the NBI, and ignores that step when called through the GUI.)
Code Example
01 |
<? xml version = "1.0" encoding = "UTF-8" ?>< cli-configlets > |
03 |
< name >Interface Physical Deactivation</ name > |
04 |
< category >Ops</ category > |
05 |
< context >/device/interface-information/physical-interface</ context > |
06 |
< device-family >ACX/J/M/MX/T/TX/PTX/EX92xx</ device-family > |
07 |
< description >Deactivates one or multiple interfaces.</ description > |
08 |
< execution-type >Grouped</ execution-type > |
09 |
< preview-show-parameters >false</ preview-show-parameters > |
10 |
< preview-show-configuration >true</ preview-show-configuration > |
11 |
< postview-show-parameters >false</ postview-show-parameters > |
12 |
< postview-show-configuration >true</ postview-show-configuration > |
15 |
< page-number >1</ page-number > |
16 |
< cli-text >## $INTERFACE is an array when called via GUI but scalar when called via NBI |
17 |
## Convert to an array when not called via GUI |
18 |
## To support multiple interfaces via the NBI, use the format ge-1/0/0;ge-1/0/1;ge-1/0/2;... |
20 |
#set ( $INTERFACE = $INTERFACE.split(";") ) |
23 |
#foreach ( $INTF in $INTERFACE ) |
30 |
</ cli-configlet-pages > |
31 |
< cli-configlet-params > |
32 |
</ cli-configlet-params > |
35 |
< name >Interface Physical Activation</ name > |
36 |
< category >Ops</ category > |
37 |
< context >/device/interface-information/physical-interface</ context > |
38 |
< device-family >ACX/J/M/MX/T/TX/PTX/EX92xx</ device-family > |
39 |
< description >Activates one or multiple interfaces.</ description > |
40 |
< execution-type >Grouped</ execution-type > |
41 |
< preview-show-parameters >false</ preview-show-parameters > |
42 |
< preview-show-configuration >true</ preview-show-configuration > |
43 |
< postview-show-parameters >false</ postview-show-parameters > |
44 |
< postview-show-configuration >true</ postview-show-configuration > |
47 |
< page-number >1</ page-number > |
48 |
< cli-text >## $INTERFACE is an array when called via GUI but scalar when called via NBI |
49 |
## Convert to an array when not called via GUI |
50 |
## To support multiple interfaces via the NBI, use the format ge-1/0/0;ge-1/0/1;ge-1/0/2;... |
52 |
#set ( $INTERFACE = $INTERFACE.split(";") ) |
55 |
#foreach ( $INTF in $INTERFACE ) |
62 |
</ cli-configlet-pages > |
63 |
< cli-configlet-params > |
64 |
</ cli-configlet-params > |