Skip To Content
ArcGIS Developers
Dashboard

Query Jobs

Description

This operation allows you to query the current jobs for a geoprocessing service, with a range of parameters to find jobs that meet specific conditions.

Request parameters

ParameterDetails
startTime

(Required)

The earliest time to query. Time is specified in milliseconds from epoch.

Example

startTime=1566379810000
endTime

(Optional)

The most recent time to query. If unspecified, the present time will be used. If you specify a value for this parameter, you must also specify a Start Time.

Example

endTime=1566423010000
jobStatus

(Optional)

Use this parameter to filter jobs by current status.

Values: esriJobNew | esriJobSubmitted | esriJobExecuting | esriJobSucceeded | esriJobFailed | esriJobCancelling | esriJobCancelled | esriJobWaiting

userName

(Optional)

This parameter filters jobs by the ArcGIS Server user who submitted the job. If the service is anonymous, this parameter will be specified as null.

Example

userName=user1
machineName

(Optional)

This parameter filters jobs by machine name. Only one machine name is allowed per query.

Example

machineName=MACHINE.DOMAIN.COM
number

(Optional)

The number of jobs to display in the response.

Example

number=10
start

(Optional)

The order number of the job with which to begin the query results page. This is intended to be used when the total number of jobs exceeds the value you specify for the number parameter above. For example, if there are 20 total jobs meeting your criteria in the query, and you specify number as 10 and start as 11, the query response will display jobs 11 through 20.

Example

start=1
f

(Required)

The response format. The default value is html.

Values: html | json | pjson

Response properties

HTML propertyDetails
Total Jobs

The total number of jobs found by the query.

Job ID

The job ID for each job shown. Click this value to go to its Job resource page. Only the number of jobs specified for Jobs Per Page will be shown in this section.

status

The current status of each job shown.

JSON propertyDetails
total

The total number of jobs found by the query.

num

The number of jobs specified for Jobs Per Page will be shown below this.

query

The parameters specified by your query request.

start

The order number of the job with which the response begins. If you did not specify a value for this parameter in your request, this value will be 1.

nextStart

The order number of the job that will be first on the next response page if the query returns more jobs than you specified for the number parameter. This property is intended to be used as the start value in your next JSON request. When there are no additional jobs to display past the current response, this property will be -1.

results

The jobs found by the query and included on this response page. The jobID and current status of each job is given.

Example usage

Below is a sample request URL for query:

https://machine.domain.com/webadaptor/admin/services/System/CachingControllers.GPServer/jobs/query?startTime=1566379810000&endTime=1566423010000&jobStatus=esriJobSucceeded&userName=user1&machineName=MACHINE.DOMAIN.COM&number=10&&start=1&f=json

Response examples

HTML Response example

Total Jobs: 3
j290c2d4e60364xx2a0c735fb9b68428a (status : esriJobSucceeded)
j507e8581758440xx85214fb2f138ed05 (status : esriJobSucceeded)
jcef2dd14cda047xx8317a3641c35df2e (status : esriJobSucceeded)

JSON Response example

{
  "total": 3,
  "num": 10,
  "query": {
    "status": [
      "esriJobSucceeded"
    ],
    "startTime": 1566379810000,
    "endTime": 1566423010000,
    "userName": user1,
    "machineName": MACHINE.DOMAIN.COM
  },
  "start": 1,
  "nextStart": 11,
  "results": [
    {"j290c2d4e60364xx2a0c735fb9b68428a": "esriJobSucceeded"},
    {"j507e8581758440xx85214fb2f138ed05": "esriJobSucceeded"},
    {"jcef2dd14cda047xx8317a3641c35df2e": "esriJobSucceeded"}
  ]
}