- URL:https://<services-url>/createService(POST only)
- Required Capability:Default administrator role | All authorized privileges
- Version Introduced:10.1
Description
The createService operation creates a new GIS service in a folder. A service is created by submitting a JSON representation of the service to this operation.
Legacy:
At 10.9.1, when installing ArcGIS Server, you had the option to disable the ArcMap service runtime. If you did not disable the ArcMap runtime, you could create map, image, geodata, geoprocessing, and geocode services with ArcMap as their service provider (ArcObjects). Starting at ArcGIS Enterprise 11.0, the ArcMap service runtime has been removed, requiring that all services be created using the ArcGIS Pro service runtime and the ArcObjects11 provider.
The JSON representation of a service contains the following five sections:
Note:
The JSON is submitted to the operation URL as a value of the service parameter. The values of all parameters must be either JSON or double quoted strings ("").
- Service Description Properties—Common properties that are shared by all service types. Typically, they identify a specific service.
- Service Framework Properties—Properties targeted toward the framework that hosts the GIS service. They define the life cycle and load balancing of the service.
- Service Type Properties—Properties targeted toward the core service type as seen by the server administrator. Since these properties are associated with a server object, they vary across the service types. The Service Types—This section in the help describes the supported properties for each service.
- Extension Properties—These properties represent the extensions that are enabled on the service. The Extension Types section in the help describes the supported out-of-the-box extensions for each service type.
- Framework Properties—Specifies a heap size that will be applied to the specific service.
Request parameters
Parameters | Details |
---|---|
service | The JSON representation of the service being created. |
f | The response format. The default response format is html. Values: html | json | pjson |
Properties
Service description
Property | Description |
---|---|
serviceName | The name of the service. Example
|
type | The type of service. |
description | An optional user-readable description for the service. Example
|
capabilities | The capabilities of the service. The domains of these values are specific to each service type. Example
|
Service framework
Property | Description |
---|---|
clusterName | The name of the cluster to which this service will be deployed. Note:Clusters have been deprecated. The use of clusters for new deployments is discouraged and existing deployments are advised to migrate away from use of clusters as part of ongoing maintenance and upgrades. Example
|
minInstancesPerNode | The minimum number of instances of the service to create on each node in the cluster. The default is 1. Example
|
maxInstancesPerNode | The maximum number of instances of the service to create on each node in the cluster. The default is 2. Example
|
maxWaitTime | The maximum amount of time (in seconds) the framework will wait to get a free instance of the service. The default is 60 seconds. Example
|
maxStartupTime | The maximum amount of time (in seconds) that can elapse on a startup attempt. When service instances are created in the GIS server, either as a result of the server starting or in response to a request of the server by a client, the time it takes to initialize the service instance is referred to as its creation time. When the maximum startup time has passed, it is assumed the startup has stopped responding and the GIS server cancels the creation of the service instance. The default is 300 seconds. Example
|
maxIdleTime | The maximum amount of time (in seconds) an idle instance of a service will remain idle before it is stopped. The default is 1800 seconds. Example
|
maxUsageTime | The maximum amount of time (in seconds) an instance can service a request. The default is 600 seconds. Example
|
recycleInterval | The maximum amount of time (in hours) an instance of the service can run. The default is 24 hours. Example
|
loadBalancing | The load balancing algorithm the framework will use for instances of a service among all the nodes in a cluster. The default is ROUND_ROBIN. Values: ROUND_ROBIN | FAIL_OVER |
isolationLevel | The isolation level under which an instance of a service is run. The default is HIGH. Values: LOW | HIGH |
Service type
Property | Description |
---|---|
properties | A bag of properties for the targeted service type. The Service Types section in the help describes the supported properties for each service. Example
|
Extension
Property | Description |
---|---|
typeName | The type of extension. See the list of supported extension types. Example
|
capabilities | The capabilities of this extension type. Example
|
enabled | A Boolean value indicating whether the extension will be enabled on this service. Values: true | false |
properties | A bag of properties for the targeted extension type. Example
|
Framework
Property | Description |
---|---|
javaHeapSize | This property allows you to specify a heap size for this particular service, overriding the default heap size properties you can set for all services using the Edit Machine operation. Specifying a value for javaHeapSize will only affect this service; all other services in the machine will remain unchanged. Example
|
Example usage
The following is a sample POST request for the createService operation, formatted for readability:
POST /webadaptor/admin/services/createService HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []
service={
"serviceName": "Test",
"type": "MapServer",
"description": "my map service",
"capabilities": "map,query,data",
"clusterName": "default",
"minInstancesPerNode": 1,
"maxInstancesPerNode": 2,
"maxWaitTime": 60,
"maxStartupTime": 300,
"maxIdleTime": 1800,
"maxUsageTime": 600,
"recycleInterval": 24,
"loadBalancing": "ROUND_ROBIN",
"isolationLevel": "HIGH",
"properties": {
"maxBufferCount": "100",
"virtualCacheDir": "https://SERVER:6080/arcgis/server/arcgiscache",
"maxImageHeight": "2048",
"maxRecordCount": "1000",
"filePath": "\\\\machine\\data\\Corine\\CORINE6.msd",
"maxImageWidth": "2048",
"cacheOnDemand": "false",
"virtualOutputDir": "https://SERVER:6080/arcgis/server/arcgisoutput",
"outputDir": "C:\\arcgisserver\\arcgisoutput",
"supportedImageReturnTypes": "MIME+URL",
"isCached": "false",
"ignoreCache": "false",
"clientCachingAllowed": "false",
"cacheDir": "C:\\arcgisserver\\arcgiscache\\Corine"
},
"extensions": [
{
"typeName": "KmlServer",
"enabled": true,
"capabilities": "SingleImage,SeparateImages,Vectors",
"properties": {
"minRefreshPeriod": "30",
"compatibilityMode": "GoogleEarth",
"imageSize": "1024",
"dpi": "96",
"endPointURL": "",
"featureLimit": "1000000",
"useDefaultSnippets": "false"
}
},
{
"typeName": "WFSServer",
"enabled": true,
"capabilities": "",
"properties": {
"appSchemaURI": "https://grid5:6080/arcgis",
"appSchemaPrefix": "arcgis",
"enableTransactions": "false"
}
},
{
"typeName": "WCSServer",
"enabled": false,
"capabilities": "",
"properties": {}
}
],
"frameworkProperties": {
"javaHeapSize": "64"
}
}&f=json
JSON Response examples
The following is a sample success response for the createService operation, indicating that the service was created successfully:
{
"status": "success"
}
The following error response is returned when an attempt is made to create a service with ArcMap as its service provider:
{
"status": "error",
"messages": ["Failed to create the service 'SampleWorldCities10x.MapServer'. This service cannot be created because the ArcObjects provider is no longer supported. Starting at version 11.0, you must use the ArcObjects11 provider."],
"code": 500
}