AutoSys Workload Automation

 View Only

 Autosys REST API

M S's profile image
M S posted May 10, 2023 03:11 PM

Hello

I am using python to extract autosys run time information and generate our internal report based on predefined criteria:

Output: 
JobName|CurrentStatus|StartTime|EndTime|ExecutionTime(Calculated)|MaxRunAlarm(From Job Definition)

First Issue:
I am using job-run-info call to get the status of all the job belonging to my application (AEWS/job-run-info?filter=name=MYAPP*). However this is giving me historical run as well. I tried to put count=0 , but it does not work. Anyway to add in the filter to get the last run or I simply need to perform calculation based on runnum on my python script.

Second Issue:
What API call I can use to get the JIL parameter (Max Run Time) ? I tried to use jobs API call, but it does not list those details.

Third Issue:
Lets say if someone force ok the job. Job_run_info still gives failure status (which make sense ), however, which api will give me current job status. So if it is forced ok, I want to see it as success (similar to what I see on console).

Thanks in advance !

Jose Lopez's profile image
Jose Lopez

Hi,

have you tried to run autorep command from python? it will give last run information and with -q it will give you the job definition.
You will get rid of the third issue also

thanks
José

Michael Woods's profile image
Broadcom Employee Michael Woods

Hi,

For your first issue, if you do not use a filter it will return only the last run, so you would need to get a list of all the jobs with that prefix and then loop through them.  Which may not be a bad thing as for your third problem if you use the 'job' endpoint instead of 'job-run-info' it will give you the jobs with the prefix you supply, but also has the answer to your third issue, the current status of the job.

The second issue will depend on what release you are running.  In the 12.0 release a new endpoint 'jil' was created and when you use a GET, it will give you the autorep output for the job.  If the job is a box, it will give you all the jobs within that box, it does not have a level 0 type of parameter that I am aware of.

Regards,

Mike