Groovy script set number of executors
<p>Please help me, I'm trying to change the number of executors on jenkins. When I'm running this code, it works:</p>

<pre><code>import jenkins.model.Jenkins
Jenkins jenkins = Jenkins.getInstance()
jenkins.setNumExecutors(4)
jenkins.save()
</code></pre>

<p>When I use the next function:</p>

<pre><code>void set_executors(int number) {

Jenkins jenkins = Jenkins.getInstance()
jenkins.setNumExecutors(number)
jenkins.save()
}
</code></pre>

<p>And running:</p>

<pre><code>java -jar jenkins-cli.jar -s http://localhost:8080 groovy /var/lib/jenkins/executor.groovy set_executors 4
</code></pre>

<p>I'm getting:</p>

<pre><code>groovy.lang.MissingMethodException: No signature of method:
Actions.set_executors() is applicable for argument types
(java.lang.String) values: [4]
Possible solutions: set_executors(int)
at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:55)
</code></pre>

<p>Please help!</p>