在使用Jenkins Docker插件时,可能由于错误而导致无法启动群集。我没有注意,目前有数千个脱机节点无法启动。
底线-是否可以批量删除Jenkin中的节点(从属),清理所有脱机节点甚至删除所有节点?重置Jenkins服务器没有帮助,而且我在Jenkins API中找不到方法。
在我开始编写Selenium脚本之类的东西之前,请感谢任何想法。
非常感谢!
该脚本的注释部分删除了节点。
它在Jenkins脚本控制台中运行
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('getDescriptor: ' + aSlave.getDescriptor()); 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 == 'NAME OF NODE TO DELETE') { // println('Shutting down node!!!!'); // aSlave.getComputer().setTemporarilyOffline(true,null); // aSlave.getComputer().doDoDelete(); //} println('\tcomputer.getLog: ' + aSlave.getComputer().getLog()); println('\tcomputer.getBuilds: ' + aSlave.getComputer().getBuilds()); }