Python API -- how to get job Worker name

Hi,

I can’t seem to produce the worker name from any of the Job methods. I tried get_JobListedSlaves but that didn’t seem to work. I’m assuming this would give me a list of all workers that have worked on this job, correct? Is there one that would return the most recently run worker?

Thanks!

As far as I know, only Tasks are associated with workers. As for finding the most recent one, you could probably sort them by Deadline.Jobs.Task.TaskCompletedDateTime and do some magic guesswork after that.

Assuming you’re running your script in a context where you have access to the Deadline.Jobs.Job object you’re interested in, you can get tasks like this:

Deadline.Scripting.RepositoryUtils.GetJobTasks(job, bool)

Where job is your Deadline.Jobs.Job instance, and bool is whether or not to fetch new data rather than relying on local cache.

Once you have your task list, check out Deadline.Jobs.Task.TaskSlaveName to grab the name of the worker that is/was working on the task.

Edit: reading your question again, it looks like you’re perhaps asking about the standalone API. If so, best to go ahead and ignore me