1

I am looking for a way to mark a slave permanently offline in jenkins through an API and i got this

http://[jenkins_url]:8080/computer/[slave_name]/doDisconnect?offlineMessage=bye

But the slave connects again when the next time a job runs on this.

Is there a way to permanently disconnect a slave so that it does not connect automatically again unless started manually?

Thanks in advance.

noob_coder
  • 749
  • 4
  • 15
  • 35

1 Answers1

0

That seems similar to JENKINS issue 13140

To prevent reconnect after manual disconnect, don't configure Jenkins to Keep this slave online as much as possible.

Try also the Jenkins plugin "jenkins-keep-slave-disconnected-plugin".

Changing my slaves to "take this slave on-line when in demand and off-line when idle", and as suggested set

in demand delay = 0
idle delay = 1000000

That does not prevents that, when a slave is required by a job, the slave process is started.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • thanks for the answer, but is there a way to disable the slave forever, like the node should not start when required, it should only start when started manually – noob_coder Jun 15 '18 at 05:45
  • @panda Yes, I understand that: I suppose this should be managed by adding a label to the node, but I am still looking for the API call. – VonC Jun 15 '18 at 05:47