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)
Changed to feature request and more into core component. Groovy plugin just provides convenient access to Jenkins classes, if any public API is missing, it should be added into Jenkins core, not implemented as some workaround in Groovy plugin.