Difference between revisions of "Script to Delete Devices"
From Observer GigaFlow Support | VIAVI Solutions Inc.
Kevin Wilkie (Talk | contribs) |
Kevin Wilkie (Talk | contribs) |
||
Line 3: | Line 3: | ||
] | ] | ||
for(var i in devices){ | for(var i in devices){ | ||
− | + | var thisDevice = actions.getDevice(devices[i]); | |
if (thisDevice!=null){ | if (thisDevice!=null){ | ||
var c= thisDevice.getClass() | var c= thisDevice.getClass() |
Revision as of 11:10, 21 May 2021
var devices=[ "10.171.255.179","10.130.255.187","10.171.255.177","10.170.255.179","10.130.255.183" ] for(var i in devices){
var thisDevice = actions.getDevice(devices[i]); if (thisDevice!=null){ var c= thisDevice.getClass()
var m = c.getDeclaredMethod("remove") m.setAccessible(true); log.warn(m) m.invoke(thisDevice) log.warn("Removing "+devices[i]); }else{ log.warn("Not Removing "+devices[i]); } }