Does anyone know how to modify the Jenkins/Hudson node labels in a non-manually way? I mean, thorough an API like the CLI API that this tool offers (without restarting Jenkins/Hudson of course).

My guess is that the best option is using a Groovy script to enter into the Jenkins/Hudson guts. Executing something like:

java -jar -s HUDSON_URL:8080 groovy /path/to/groovy.groovy

Being the content of that script something like:

for (aSlave in hudson.model.Hudson.instance.slaves) {
   labels = aSlave.getAssignedLabels()
   println labels
   **aSlave.setLabel("blabla")** // this method doesn't exist, is there any other way???
}

Thanks in advance!

Victor

Edit
Report