GP Task
- URL:http://<gpservice-url>/<taskName>
- Operations:Execute Task, Submit Job
- Child Resources:Job
- Version Introduced:9.3
Description
The GP Task resource represents a single task in a GP service published using the ArcGIS Server. It provides basic information about the task including its name and display name. It also provides detailed information about the various input and output parameters exposed by the task.
GP Task supports the following two operations:
- submit job—Used for asynchronous tasks. Asynchronous means that your application does not wait for the task to finish execution, and the end user can continue using the application.
- execute task—Used for synchronous tasks. Synchronous means that the application waits while the tool executes on the server. Because the end user must wait, you should determine whether the wait time is acceptable for the type of application.
Request parameters
Parameter |
Details |
---|---|
f |
Description: The response format. The default response format is html. Values: html | json |
Example usage
URL for the CreateDriveTimePolygons task for ESRI_DriveTime_US on sampleserver1.
JSON response syntax
Note:
The executionType property was added to the JSON response at 9.3 SP1.
{
"name": "<taskName>",
"displayName": "<displayName>",
"description": "<description>", //Added at 10.1 SP1
"category": "<category>",
"helpUrl": "<url>",
"executionType": "<executionType>",
"parameters": [
{
"name": "<paramName1>",
"dataType": "<dataType1>",
"displayName": "<displayName1>",
"description": "<description>", //Added at 10.1 SP1
"direction": "<direction1>",
"defaultValue": {
<defaultValue1>
},
"parameterType": "<parameterType1>",
"category": "<paramCategory1>",
"choiceList": [
"choice11",
"choice12"
]
},
{
"name": "<paramName2>",
"dataType": "<GPFeatureRecordSetLayer | GPRecordSet>",
"displayName": "<displayName2>",
"description": "<description>", //Added at 10.1 SP1
"direction": "<direction2>",
"defaultValue": {
"geometryType": "<geometryType2>",
"hasZ": <true|false>, //Added at 10.1
"hasM": <true|false>, //Added at 10.1
"spatialReference": {
<spatialReference>
},
"fields": [
{
"name": "<fieldName21>",
"type": "<fieldType21>"
},
{
"name": "<fieldName22>",
"type": "<fieldType22>"
}
]
},
"parameterType": "<parameterType2>",
"category": "<paramCategory2>",
"choiceList": [
"choice21",
"choice22"
]
}
]
}
JSON response example
{"name" : "BufferPoints","displayName" : "BufferPoints","category" : "","helpUrl" : "http://flame7/arcgisoutput/BufferByVal/BufferPoints.htm","executionType": "esriExecutionTypeAsynchronous","parameters": [{ "name" : "Input_Points", "dataType" : "GPFeatureRecordSetLayer", "displayName" : "Input Points", "direction" : "esriGPParameterDirectionInput", "defaultValue" : { "geometryType" : "esriGeometryPoint", "hasZ" : true, "spatialReference" : {"wkid" : 4326}, "fields" : [ {"name" : "FID", "type" : "esriFieldTypeOID"}, {"name" : "Shape", "type" : "esriFieldTypeGeometry"}, {"name" : "Id", "type" : "esriFieldTypeInteger"} ] }, "parameterType" : "esriGPParameterTypeRequired", "category" : "", "choiceList" : []},{ "name" : "Distance", "dataType" : "GPLinearUnit", "displayName" : "Distance", "direction" : "esriGPParameterDirectionInput", "defaultValue" : { "distance" : 100.0, "units" : "esriMiles"}, "parameterType" : "esriGPParameterTypeRequired", "category" : "", "choiceList" : []},{ "name" : "Input_Points_By_Ref", "dataType" : "GPString", "displayName" : "Input Points By Ref", "direction" : "esriGPParameterDirectionInput", "defaultValue" : "fourptsinacol", "parameterType" : "esriGPParameterTypeRequired", "category" : "", "choiceList" : [ "fourptsinacol","fourptsinarow","partiallines","line_shp","partialpolys","polygon_shp" ]},{ "name" : "Output_Buffered_Points", "dataType" : "GPFeatureRecordSetLayer", "displayName" : "Output Buffered Points", "direction" : "esriGPParameterDirectionOutput", "defaultValue" : { "geometryType" : "esriGeometryPoint", "hasZ" : true, "spatialReference" : {"wkid" : 4326}, "fields" : [ {"name" : "FID", "type" : "esriFieldTypeOID"}, {"name" : "Shape", "type" : "esriFieldTypeGeometry"}, {"name" : "Id", "type" : "esriFieldTypeInteger"} {"name" : "Name", "type" : "esriFieldTypeString"} ] }, "parameterType" : "esriGPParameterTypeRequired", "category" : "", "choiceList" : []}]}