ReleaseEngineering/How To/Reboot Multiple Slaves Using Slaveapi

From MozillaWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

You might find it easiest to do this by creating a text file containing the list of the slaves you want to reboot (let's call it naughty_slaves.list), set MY_LDAP_USER and MY_LDAP_PASSWORD environment variables to your LDAP credentials, making sure you are on the VPN; and then run:

cat naughty_slaves.list | \
  while read slave; do \
    curl -u "${MY_LDAP_USER}:${MY_LDAP_PASSWORD}" \
         -dfoo=bar "https://secure.pub.build.mozilla.org/slaveapi/slaves/${slave}/actions/reboot"; \
  done

This should reboot the lot in one fell swoop.

Please note, if you need to call other Slave API actions, such as "shutdown" instead of reboot, see the API docs here: http://mozilla-slaveapi.readthedocs.org/en/latest/api/#endpoints