10

I know we can post the following to offline a slave on Jenkins

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

but is there one for disconnecting and connecting slave?

TheTeaRex
  • 317
  • 5
  • 12
  • Not sure if this is exactly what you're looking for but you might find this [link](https://groups.google.com/forum/#!topic/jenkinsci-users/rZq1I7IsdnM) useful. – Sam Gomena Mar 09 '17 at 23:56

2 Answers2

12

I ended up had to guess the api, but at least I found it. For those who are interested, there are the api link to disconnect and reconnect a slave agent to Jenkins.

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

Reconnect: http://[jenkins_url]:8080/computer/[slave_name]/launchSlaveAgent

TheTeaRex
  • 317
  • 5
  • 12
0

This used an api token for the user.

curl -X POST https://user:token@host/computer/node_name/launchSlaveAgent
Steve Wall
  • 1,842
  • 5
  • 21
  • 50