Created
February 13, 2019 00:25
-
-
Save zentavr/49046c034b1b46d7d9227572c1d4ad3e to your computer and use it in GitHub Desktop.
Drop Jenkins Slaves
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (aSlave in hudson.model.Hudson.instance.slaves) { | |
println('===================='); | |
println('Name: ' + aSlave.name); | |
println('getLabelString: ' + aSlave.getLabelString()); | |
println('getNumExectutors: ' + aSlave.getNumExecutors()); | |
println('getRemoteFS: ' + aSlave.getRemoteFS()); | |
println('getMode: ' + aSlave.getMode()); | |
println('getRootPath: ' + aSlave.getRootPath()); | |
println('getComputer: ' + aSlave.getComputer()); | |
println('\tcomputer.isAcceptingTasks: ' + aSlave.getComputer().isAcceptingTasks()); | |
println('\tcomputer.isLaunchSupported: ' + aSlave.getComputer().isLaunchSupported()); | |
println('\tcomputer.getConnectTime: ' + aSlave.getComputer().getConnectTime()); | |
println('\tcomputer.getDemandStartMilliseconds: ' + aSlave.getComputer().getDemandStartMilliseconds()); | |
println('\tcomputer.isOffline: ' + aSlave.getComputer().isOffline()); | |
println('\tcomputer.countBusy: ' + aSlave.getComputer().countBusy()); | |
if (aSlave.name.startsWith("ecs-htdev-jenkins-workers")) { | |
// println('Shutting down node!!!!'); | |
// aSlave.getComputer().setTemporarilyOffline(true,null); | |
aSlave.getComputer().doDoDelete(); | |
} else { | |
println('Leaving ' + aSlave.name) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment