Query Jobs

  • URL:https://server:port/arcgis/admin/services/[<folder>]/<serviceName.serviceType>/jobs/query
  • Version Introduced:10.6.1

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.

HTML request parameters

All parameters are optional except the response format.

ParameterDetails
Start Time

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

End Time

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.

Status

Use this parameter to filter jobs by current status. Press the Shift key to select multiple adjacent statuses, and press the Ctrl key to select nonadjacent statuses. The available statuses are as follows:

  • NEW
  • SUBMITTED
  • EXECUTING
  • SUCCEEDED
  • FAILED
  • CANCELLING
  • CANCELLED
  • WAITING

User

Use this parameter to filter jobs by the ArcGIS Server user who submitted the job. If the service is anonymous, this parameter will be unavailable.

Machine Name

Use this parameter to filter jobs by machine name. Only one machine name is allowed per query.

Jobs Per Page

The number of jobs to display. The response is not paginated, so only the number of jobs specified here will be shown.

f

The response format: [html | json]

JSON request parameters

All parameters are optional except the response format.

ParameterDetails
status

Use this parameter to filter jobs by current status. The available statuses are as follows:

  • esriJobNew
  • esriJobSubmitted
  • esriJobExecuting
  • esriJobSucceeded
  • esriJobFailed
  • esriJobCancelling
  • esriJobCancelled
  • esriJobWaiting

startTime

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

endTime

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 startTime.

userName

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.

machineName

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

number

The number of jobs to display in the response.

start

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.

f

The response format: [html | json]

HTML response properties

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.

HTML response example

Total Jobs: 3

  • j290c2d4e60364xx2a0c735fb9b68428a ( status : esriJobWaiting)
  • j507e8581758440xx85214fb2f138ed05 ( status : esriJobFailed)
  • jcef2dd14cda047xx8317a3641c35df2e ( status : esriJobSucceeded)

Example GET request

https://server:port/arcgis/admin/services/<serviceName.serviceType>/jobs/query?startTime=&endTime=&jobStatus=esriJobSucceeded&jobStatus=esriJobFailed&jobStatus=esriJobWaiting&userName=&machineName=&number=10&f=json

JSON response properties

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.

JSON response example

{
  "total": 3,
  "num": 10,
  "query": {
    "status": [
      "esriJobSucceeded",
      "esriJobFailed",
      "esriJobWaiting"
    ],
    "startTime": null,
    "endTime": null,
    "userName": null,
    "machineName": null
  },
  "start": 1,
  "nextStart": 11,
  "results": [
    {"j290c2d4e60364xx2a0c735fb9b68428a": "esriJobWaiting"},
    {"j507e8581758440xx85214fb2f138ed05": "esriJobFailed"},
    {"jcef2dd14cda047xx8317a3641c35df2e": "esriJobSucceeded"}
  ]
}