AnsweredAssumed Answered

How to check if a GP service (async) has any jobs that are not completed yet?

Question asked by tereshenkov on Aug 16, 2013
Latest reply on Aug 19, 2013 by tereshenkov
Hi folks,

I am trying to find out a way to tell if a GP service has any jobs that were submitted and are not completed yet. I have noticed that one can see the status of a specific service by using the ArcGIS Server Services Directory (by using a jobid value). However, I am not interested in a specific job; my concern is only to see if there are any jobs currently started by a GP service. I need to know if a service is busy working on any job because I need to make sure that there aren't any other jobs started when running a new one. This is because the GP service writes some data which results in some locks which I want to avoid.

The current way I do that is by using Python to access the statistics page of the service:
I am using Python for server administration using the ArcGIS REST API. I have written a piece of code that uses  this page to check if there are any busy instances (which means a service is busy working on a job). If this key's value is 0 then it means the service is not working on any job and it is safe to run another one.

I consider this to be more of a workaround and looking to figure out if this information (if a GP service has any jobs running) is exposed via REST API. It seems as it doesn't, but wanted to ask others to make sure I haven't missed anything.

Thank you.