Query Jobs

URL:
https://<root>/services/<serviceName>.<serviceType>/jobs/query
Methods:
GET
Required Capability:
Access allowed with either the "Update", "Delete", "Security and Infrastructure", or "Servers" privileges
Version Introduced:
10.6.1

Description

The query 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 Unix format.

Example
Use dark colors for code blocksCopy
1
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 value for startTime.

Example
Use dark colors for code blocksCopy
1
endTime=1566423010000

jobStatus

(Optional)

Filter's jobs by current their 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
Use dark colors for code blocksCopy
1
userName=user1

machineName

(Optional)

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

Example
Use dark colors for code blocksCopy
1
machineName=MACHINE.DOMAIN.COM

number

(Optional)

The number of jobs to display in the response.

Example
Use dark colors for code blocksCopy
1
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
Use dark colors for code blocksCopy
1
start=1

f

(Required)

The response format. The default value is html.

Values: html | json | pjson

Response properties

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

The following is a sample request URL for the query operation:

Use dark colors for code blocksCopy
1
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=pjson

JSON Response example

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
  "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"}
  ]
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.