- URL:
- ArcGIS Online:https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/SetupMapArea/submitJobArcGIS Enterprise:https://<catalog-url>/Utilities/OfflinePackaging/GPServer/SetupMapArea/submitJob
- Methods:
POST
- Version Introduced:
- 10.6.1
Description
The Setup Map Area task creates packages for each service in the web map within the map area extent. The tool generates tile packages (.tpk
or .vtpk
) for export
tiled services (in other words, basemap layers) and SQ
format replica packages for sync-enabled feature services (in other words, operational layers). It adds an Area2
relationship between the map area item and created package items.
An existing package related to a map area will remain unchanged after running the task a second time as long as its corresponding layer remains in the web map and therefore a valid map layer. For example, if a web map is updated with a feature layer removed after a package is created for that layer using the GP tool, the package will be removed the next time it is executed since its corresponding layer no longer exists in the web map and thus becomes invalid.
This task is available for the map area item owner and organization administrators in ArcGIS Online and ArcGIS Enterprise.
Request parameters
Parameter | Details |
---|---|
| The supported output format is JSON. Example
|
| An access token that identifies the authenticated user and controls access to restricted resources and operations. |
| Map area item ID, created by the Create Map Area tool. |
(Optional) | A list of individual layers, specified with their service URLs, in the map to ignore. The task generates packages for all map layers by default. Example:
|
(Optional) | An array of JSON objects that contains additional export tiles-enabled tile services for which tile packages ( Example:
|
(Optional) | An array of JSON objects that contains additional sync-enabled feature services for which replicas need to be created. It can also be used to override a layer definition query in the map. Each feature service is specified with its Example:
Feature services support scheduled updates (version 10.7.1 and later). Scheduled updates allow apps to download server side changes based on a fixed schedule. This is to support download-only workflows in which you only need a copy of the data for reference even if the service supports editing. It is not intended for workflows in which clients make edits and sync. If The Example:
|
Response properties
When a job request is submitted, the service assigns a unique job identifier for the transaction. A JSON response with the job ID and job status are returned as below:
{
"jobId": "<jobID>",
"jobStatus": "esriJobSubmitted" | "esriJobWaiting" | "esriJobExecuting" | "esriJobSucceeded" | "esriJobFailed" | "esriJobTimedOut" | "esriJobCancelling" | "esriJobCancelled"
}
Check job status
After the initial request is submitted, you can use the job ID to check its status and messages periodically by calling as below:
https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/SetupMapArea/jobs/<jobID>?token=<token>&returnMessages=true&f=json
JSON response syntax during job execution
{
"jobId": "<jobId>",
"jobStatus": "<jobStatus>",
"messages": [
{
"type": "<type1>",
"description": "<description1>"
},
{
"type": "<type2>",
"description": "<description2>"
}
]
}
Retrieve results
When the status of the job is esri
upon its successful completion, you can retrieve the output results by calling as below:
https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/SetupMapArea/jobs/<jobID>/results/<outputParameter>?token=<token>&f=json
You can also retrieve the value of any input parameter by calling as below:
https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/SetupMapArea/jobs/<jobID>/inputs/<inputParameter>?token=<token>&f=json
Upon successful execution, the service returns a JSON object that contains an array of packages for the given map area using the following output parameter:
Parameter | Details |
---|---|
| A JSON object that contains properties for the output parameter name, data type, and value. The Supported values for Example:
|
Example usage
Request URL to submit the job
https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/SetupMapArea/submitJob?mapItemId=1a6c552e5cbe4249aa307df94a84c2b3
JSON Response example
{
"jobId": "jf360770cb2c44398abc5ce474bbfae88",
"jobStatus": "esriJobSubmitted"
}
Check job status
Request URL to query job status
https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/SetupMapArea/jobs/jf360770cb2c44398abc5ce474bbfae88
JSON Response
{
"jobId": "jf360770cb2c44398abc5ce474bbfae88",
"jobStatus": "esriJobExecuting",
"messages": []
}
Retrieve results
Request URL to return output map area item
https://packaging.arcgis.com/arcgis/rest/services/OfflinePackaging/GPServer/SetupMapArea/jobs/j40fb94bf101840fc90f130ab2da9553b/results/packages
JSON Response
{
"paramName": "packages",
"dataType": "GPString",
"value": [
{
"source": "https://services.arcgis.com/J423vH8fR9HV444k/arcgis/rest/services/featureService1/FeatureServer",
"error": "Sync not enabled on service featureService1"
},
{
"source": "https://services.arcgis.com/J423vH8fR9HV444k/arcgis/rest/services/featureService2/FeatureServer",
"itemId": "0da8bbef893a44a484be48732c7f018b",
"state": "new"
},
{
"source": "https://services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",
"itemId": "c8d1ae20448b487c9e28ad1e8eab13b7",
"state": "unchanged"
}
]
}