- URL:https://<services-url>/createService(POST only)
- Required Capability:Default administrator role | All authorized privileges
- Version Introduced:10.1
Description
This operation creates a new GIS service in a folder. A service is created by submitting a JSON representation of the service to this operation.
The JSON representation of a service contains the following four sections:
Note:
The JSON is submitted to the operation URL as a value of the parameter service. 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 towards the framework that hosts the GIS service. They define the life cycle and load balancing of the service.
- Service Type Properties—Properties targeted towards 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 section in the Help describes the supported properties for each service.
- Extension 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 (New at 10.7)—Specifies a heap size that will be applied to this specific service.
Caution:
At 10.9.1, when installing ArcGIS Server you will have the option to disable the ArcMap service runtime, removing Python 2.x from your deployment. If the ArcMap runtime is disabled, attempting to create a map, image, geodata, geoprocessing, or geocode service with ArcMap as the service provider (ArcObjects) will result in an error message. For more information, see the JSON Response examples section below.
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 | Description |
---|---|
serviceName | The name of the service. Example
|
type | The type of the 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 | 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 strongly 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 within the cluster. The default is 1. Example
|
maxInstancesPerNode | The maximum number of instances of the service to create on each node within the cluster. The default is 2. Example
|
maxWaitTime | The maximum amount of time (in seconds) the framework should wait to get a free instance of the service. The default is 60 seconds. Example
|
maxStartupTime | The maximum amount of time (in seconds) amount of time 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, the GIS server assumes its startup is hanging and 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 be kept alive before it will be destroyed. 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 live. The default is 24 hours. Example
|
loadBalancing | The load balancing algorithm the framework must use for using instances of a service among all the nodes within 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 | 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 | Description |
---|---|
typeName | The type of extension. See the list of supported extension types. Example
|
capabilities | The capabilities for this extension type. Example
|
enabled | A Boolean value indicating whether the extension is to be enabled on this service. Values: true | false |
properties | A bag of properties for the targeted extension type. Example
|
Framework | Description |
---|---|
javaHeapSize | This property, introduced at 10.7, 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 here will only affect this service; all other services in your machine will remain unchanged. Example
|
Example usage
Below is a sample POST request for createService, 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 at attempt is made to create a service with ArcMap as its service provider when the ArcMap runtime is disabled.
{
"status": "error",
"messages": ["This ArcMap based service cannot be started because the ArcMap Runtime Support feature is not installed. Information on how to migrate services to use the ArcGIS Pro service runtime is available in the help topic 'Migrating services to the ArcGIS Pro service runtime'."],
"code": 500
}