Skip To Content
ArcGIS Developers
Dashboard

Query

  • URL:https://<jobs-url>/query
  • Version Introduced:10.9

Description

License:

The use of this resource requires an ArcGIS GIS Server Advanced license and a Production Mapping Server or Defense Mapping Server license.

The query operation retrieves the status of jobs executed by the generateProduct REST operation and returns the status, start date, last modified date, and messages for a set of jobs.

Request parameters

ParameterDetails
status

(Optional)

Retrieves all the jobs with a particular status if the status is specified and appended to the end of the URL, for example, ...jobs?status=5. The status parameter has the following values:

  • New—0
  • Submitted—1
  • Waiting—2
  • Executing—3
  • Succeeded—4
  • Failed—5
  • TimedOut—6
  • Canceling—7
  • Canceled—8
  • Deleting—9
  • Deleted—10

startDate

(Optional)

Retrieves all the jobs that started on or after the start date if the start date is specified. The date is added to the URL using the following format: MM-DD-YYYY. For example: ...jobs?startDate=09-21-2020.

endDate

(Optional)

Retrieves all the jobs that ended on or after the end date if the end date is specified. The date is added to the URL using the following format: MM-DD-YYYY. For example: ...jobs?endDate=09-21-2020.

msgLevel

(Optional)

The message level associated with the job. The values are the following:

  • info
  • warn
  • error
When constructing a query URL, the msgLevel value is added to the end of the URL, for example, ...jobs/job/<jobID>?msgLevel=info.
Note:

Regardless of the msgLevel value, any errors that a job contains are included in the messages array of the response by default.

JSON Response syntax

The following is the syntax of a response:

{
  "jobs": [
   {
    "status": <status of the job>,
    "statusCode": <status code>,
    "submissionTime": <time and date of the job submission>,
    "lastUpdatedTime": <time and date of the last job update>,
    "percentComplete": <percent of the job completed>,
    "messages": {
     <informative | error | warning>
    },
    "user": <username>,
    "jobId": <job identifier>
   },
   ...]
}

Example usage

The following URL queries the jobs REST resource by startDate and msgLevel:

https://machine.domain.com/server/rest/services/SampleService/TopographicProductionServer/jobs?f=json&startDate=09-21-2020&msgLevel=info

JSON Response example

The following is an example of a response:

{
 "jobs": [
  {
   "status": "InProgress",
   "statusCode": 3,
   "submissionTime": "2020/09/21 15:48:22",
   "lastUpdatedTime": "2020/09/21 15:48:22",
   "percentComplete": 0.052631578947368418,
   "messages": {
    "informative": [
     "Submitted.",
     "Executing..."
     "Start Time: Monday, September 21, 2020 08:45:14 AM",
     "Starting to generate product MTM50.",
     "Start Time: Monday, September 21, 2020 08:45:28 AM",
     "Executing Import Template and Extract Features",
     "Start Time: Monday, September 21, 2020 08:45:28 AM"
    ]
   },
   "user": "user1",
   "jobId": "5F9E1EE1-CB27-48E6-8B11-FEF9B9B281CA"
  },
  {
   "status": "Failed",
   "statusCode": 5,
   "submissionTime": "2020/09/21 15:49:14",
   "lastUpdatedTime": "2020/09/21 15:49:14",
   "messages": {
    "informative": [
     "Submitted.",
     "Executing..."
    ],
    "errors": [
     "ERROR 000824: The tool is not licensed.",
     "Failed."
    ]
   },
   "user": "user2",
   "jobId": "38913E2C-B655-4085-B59F-4A5B0D20224E"
  },
  {
   "status": "Pending",
   "statusCode": 2,
   "submissionTime": "2020/09/21 16:17:19",
   "lastUpdatedTime": "2020/09/21 16:17:19",
   "percentComplete": 0,
   "messages": {
    
   },
   "user": "user3",
   "jobId": "91CAF47B-A26F-4F43-ABC7-78DDC3EDBF7A"
  }
 ]
}
}

Example usage

The following URL queries the jobs REST resource by startDate and status:

https://machine.domain.com/server/rest/services/SampleService/MapServer/exts/TopographicProductionServer/jobs?f=json&startDate=09-21-2020&status=5

JSON Response example

The following is an example of a response:

{
 "jobs": [
  {
   "status": "Failed",
   "statusCode": 5,
   "submissionTime": "2020/09/21 16:29:32",
   "lastUpdatedTime": "2020/09/21 16:29:32",
   "messages": {
    "errors": [
     "ERROR 000824: The tool is not licensed.",
     "Failed."
    ]
   },
   "user": "user1",
   "jobId": "7187043F-C096-4610-9DA9-15469A71DA79"
  },
  {
   "status": "Failed",
   "statusCode": 5,
   "submissionTime": "2020/09/21 16:29:39",
   "lastUpdatedTime": "2020/09/21 16:29:39",
   "messages": {
    "errors": [
     "ERROR 000824: The tool is not licensed.",
     "Failed."
    ]
   },
   "user": "user2",
   "jobId": "4F7D692F-5BD4-4276-9B6B-88818F8B5B39"
  },
  {
   "status": "Failed",
   "statusCode": 5,
   "submissionTime": "2020/09/21 16:29:44",
   "lastUpdatedTime": "2020/09/21 16:29:44",
   "messages": {
    "errors": [
     "ERROR 000824: The tool is not licensed.",
     "Failed."
    ]
   },
   "user": "user3",
   "jobId": "36A6CA20-9095-42FF-A4C7-FE3C6AEE8988"
  }
 ]
}