Page 1 of 1

Change Job Priority from Python

Posted: Sat Jun 26, 2021 11:22 am
by Khiladi
Hi,

How can change the priority of a certain job using python modules like af or afcmd.
Like I can change the state of the job but couldn't find any settings like priority or hostmask.

Also, I want to clarify that I want to change the setting of the running job not while creating a job.

Thanks

Re: Change Job Priority from Python

Posted: Tue Jun 29, 2021 5:17 am
by timurhai
Hi!

You can use JSON protocol for almost anything.
Try to change something from WebGUI or AfWatch (running in terminal) and you will see what data it sends to server.

From Python you can use
https://github.com/CGRU/cgru/blob/maste ... ork.py#L21
afnetwork.sendServer
function to send JSON data.

Re: Change Job Priority from Python

Posted: Wed Jul 07, 2021 12:26 pm
by Khiladi
Hi Timur,

Yeah, I managed to achieve the same while looking at the af.Cmd
I made custom methods for all the desired operations.

Thanks!