-
Notifications
You must be signed in to change notification settings - Fork 163
What is a REST based scripting workflow for publishing geocoding services?
There are various ways to script the creation of a service. The most popular workflow is to use ArcPy scripts and upload a Service Definition file. However a REST based option exists too. This involves 1) Authentication using an Admin credential and 2) Passing the proper JSON payload to /arcgis/admin/services/createService using a POST. Before scripting the workflow developers can test the JSON payload directly though the createService webform.
/POST /arcgis/admin/services/createService
{
"serviceName": "MyAddressLocator",
"type": "GeocodeServer",
"description": "Atlanta Locator Testing",
"capabilities": "Geocode,ReverseGeocode",
"provider": "ArcObjects",
"interceptor": "",
"clusterName": "default",
"minInstancesPerNode": 1,
"maxInstancesPerNode": 2,
"instancesPerContainer": 1,
"maxWaitTime": 60,
"maxStartupTime": 300,
"maxIdleTime": 1800,
"maxUsageTime": 600,
"loadBalancing": "ROUND_ROBIN",
"isolationLevel": "HIGH",
"configuredState": "STARTED",
"recycleInterval": 24,
"recycleStartTime": "00:00",
"keepAliveInterval": 1800,
"private": false,
"isDefault": false,
"maxUploadFileSize": 0,
"allowedUploadFileTypes": "",
"properties": {
"outputDir": "/net/SITEHOST/gisdata/arcgisserver/directories/arcgisoutput",
"virtualOutputDir": "/rest/directories/arcgisoutput",
"locator": "MyAddressLocator",
"suggestedBatchSize": "1000",
"minScale": "-1",
"textAntialiasingMode": "Force",
"antialiasingMode": "None",
"maxScale": "-1",
"maxResultSize": "500",
"locatorWorkspacePath": "/gisdata/data\\Geocoding\\Locators\\",
"maxBatchSize": "1000"
},
"extensions": [],
"datasets": []
}
Note the file pathes in the above JSON parameters were targeting an ArcGIS for Server Linux setup. The locator (.loc file) was MyAddressLocator. The locator workspace property is locatorWorkspacePath
and it represents the path to the locator found on disk here /gisdata/data/Geocoding/Locators.
Lastly, when sending this createService request using code it's important to remember that an Admin Token need to be appended to the request parameters.
ex
token=sdfsdfsdfsdfsdfasfgfdgfd
- Forums
- Web and Mobile Runtime SDKs
- AppStudio sample style guide
- Services
- Layer Services
- Geoprocessing Services
- Servers
- Data Resources
- Windows Operating System
- Enable IIS Directory Browsing
- Creating a custom WKID
- Python Help
- Sharing Between ArcGIS Online Organizations
- Resources To Learn Git
- Working-with-Fonts