Change Job Priority from Python

General discussions and questions.
Post Reply
Khiladi
Posts: 34
Joined: Mon Jul 06, 2020 6:49 am

Change Job Priority from Python

Post 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
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Change Job Priority from Python

Post 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.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Khiladi
Posts: 34
Joined: Mon Jul 06, 2020 6:49 am

Re: Change Job Priority from Python

Post 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!
Post Reply