I would like to set the number of executors on a slave node in a build step. I tried doing that with a Groovy system script, but it seems to me this is not possible, since the setNumExecutors(int) method is only implemented by jenkins.model.Jenkins, which will however only affect the master node. The method is not accessible through the 'Node', 'Slave' or 'Computer' classes, which would allow me to do that on a slave. For example, like this
Hudson.instance.getComputer("SlaveName").setNumExecutors(1)