How to cancel a task on a slave from a house cleaning event?

I’m trying to use house-scheduling to take workstations offline in the morning.
I’ve got the script working to change the group the slave is in, but I also want to force the task to get requeued. I can’t find any commands in the docs that might be able to achieve this, am I missing something?

Thanks!
p.

Adding/removing groups is our preferred method of signalling workstation availability as well, but after removing groups you’re more or less forced to do a worker/slave instance restart. Simply removing a group and dropping the current task will (most likely) not do the trick.

So, two birds one stone, all that. Just set your groups and force a slave/worker restart for the worker in question. It will unfortunately trigger various UI events if the worker is set to offer the user override options (delay start, etc), but overall this seems to be the best method of achieving your goal – at least as far as I’ve found.

PS: When adding groups, no restart is required. New jobs will be picked up reasonably quickly. This whole thing seems like a bit of a race condition somewhere in the worker thread, but who knows really.

Thanks for confirming that Daniel,
I was going to ask how to force the nodes to restart, as I hadn’t discovered the methods in the python api, but I’ve just come across what I need in the scripting api : “SendRemoteCommandNoWait()”.