GP Job

Description

The GP job resource represents a job submitted using the submit job operation. It provides basic information about the job such as the job ID, status, and messages. Additionally, if the job has successfully completed, it provides information about the result parameters as well as the input parameters.

All result values can be accessed via the GP result resource. The JSON response specifies a relative URL to the result resource with a paramUrl field. Similarly, all input parameter values are accessed via the GP input resource. The JSON response specifies a relative URL to the input resource with a paramUrl field as well.

You can specify whether you want the messages to be returned or not by using returnMessages.

New at 10.1

The job resource supports a Cancel job operation. This operation can be used to cancel a job before it's completed.

Resource hierarchy

GP Job

Request parameters

Parameter

Details

f

Description: The response format. The default response format is html.

Values: html | json | kmz

returnMessages

Description: If true, the job messages are included in the response. The default is true.

Values: true | false

Example usage

When you submit a job to the ERGByChemical task as shown in the Submit Job doc's Examples section, and the output format is html(f=html), you'll be redirected to the job resource page whose URL will be similar to the following:

http://sampleserver2.arcgisonline.com/ArcGIS/rest/services/PublicSafety/EMModels/GPServer/ERGByChemical/jobs/jf082fc6d926043fda44169444963fe46

NoteNote:

jf082fc6d926043fda44169444963fe46 is an example job ID, and the job ID for your job may vary.

JSON response syntax

{"jobId" : "<jobId>","jobStatus" : "<jobStatus>","results" : {"<param1>" : {"paramUrl" : "<relativeUrlToParam1>"},"<param2>" : {"paramUrl" : "<relativeUrlToParam2>"}},"inputs" : {"<param1>" : {"paramUrl" : "<relativeUrlToParam1>"},"<param2>" : {"paramUrl" : "<relativeUrlToParam2>"}},"messages" : [{"type" : "<type1>", "description" : "<description1>"},{"type" : "<type2>", "description" : "<description2>"}]}

JSON response example

{"jobId" : "JE30155054C2C416EA3CF6C88A40B94FF","jobStatus" : "esriJobSucceeded","results" : {"Output_Long" : {"paramUrl" : "results/Output_Long"},"Output_Feature_Class" : {"paramUrl" : "results/Output_Feature_Class"}},"inputs" : {"Input_String" : {"paramUrl" : "inputs/Input_String"},"Input_Feature_Class" : {"paramUrl" : "inputs/Input_Feature_Class"}},"messages" : [{"type" : "esriJobMessageTypeInformative", "description" : "Executing (TestTask)"},{"type" : "esriJobMessageTypeInformative", "description" : "Start Time: Thu Jul 05 16:36:25 2007"},{"type" : "esriJobMessageTypeInformative", "description" : "Executing Copy Features..."},{"type" : "esriJobMessageTypeInformative", "description" : "Start Time: Thu Jul 05 16:36:25 2007"},{"type" : "esriJobMessageTypeInformative", "description" : "Executed (Copy Features) successfully."},{"type" : "esriJobMessageTypeInformative", "description" : "End Time: Thu Jul 05 16:36:26 2007 (Elapsed Time: 1.00 seconds)"},{"type" : "esriJobMessageTypeInformative", "description" : "Executed (TestTask) successfully."},{"type" : "esriJobMessageTypeInformative", "description" : "End Time: Thu Jul 05 16:36:26 2007 (Elapsed Time: 1.00 seconds)"}]}

3/3/2017