Just doing some tests on a new Monitor script and I’d like to mark a slave as offline. Is this possible? Had a look through the docs, managed to disable selected slaves, but not mark as offline.
[code]from System.IO import *
from System import *
from Deadline.Scripting import *
def main():
selected_slaves = MonitorUtils.GetSelectedSlaveInfos()
for slave in selected_slaves:
slaveSettings = RepositoryUtils.GetSlaveSettings(slave.SlaveName, True)
# Disable the slave
slaveSettings.SlaveEnabled = False
# How to make slave offline?
[/code]
So I have looked into this and what you need to change is the slave info option slavestate from Idle to Offline, and some sample code that would potentially be a start in writing your own code that would do this is posted at github.com/ThinkboxSoftware/Dea … rideIPs.py and the keys here are:
For those running into this 11 years later (non-cloud Deadline 10.4.1.6)
from Deadline.Scripting import RepositoryUtils
from Deadline.Slaves import SlaveInfo, SlaveStatus
info: SlaveInfo = RepositoryUtils.GetSlaveInfo(slave, True)
info.SlaveStatus = SlaveStatus.Offline
RepositoryUtils.SaveSlaveInfo(info)
The official documentations for SlaveInfo (and Python stubs) doesn’t mention the SlaveStatus attribute, but instead, only the read-only SlaveState attribute.
However, the official SlaveStatusEnum does exist, so that might be a cleaner way to script the value that’s being set/used