Skip To Content
ArcGIS Developers
Dashboard

Create Service

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:

  • 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.
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 ("").

Request parameters

ParametersDetails
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 descriptionDescription
serviceName

The name of the service.

Example

"serviceName": "Test"
type

The type of the service.

description

An optional user-readable description for the service.

Example

"description": "my map service"
capabilities

The capabilities of the service. The domains of these values are specific to each service type.

Example

"capabilities": "map,query,data"

Service frameworkDescription
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

"clusterName": "default"
minInstancesPerNode

The minimum number of instances of the service to create on each node within the cluster. The default is 1.

Example

"minInstancesPerNode": 1
maxInstancesPerNode

The maximum number of instances of the service to create on each node within the cluster. The default is 2.

Example

"maxInstancesPerNode": 2
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

"maxWaitTime": 60
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

"maxStartupTime": 300
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

"maxIdleTime": 1800
maxUsageTime

The maximum amount of time (in seconds) an instance can service a request. The default is 600 seconds.

Example

"maxUsageTime": 600
recycleInterval

The maximum amount of time (in hours) an instance of the service can live. The default is 24 hours.

Example

"recycleInterval": 24
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 typeDescription
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

"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"
}

ExtensionDescription
typeName

The type of extension. See the list of supported extension types.

Example

"typeName": "KmlServer
capabilities

The capabilities for this extension type.

Example

"capabilities": "SingleImage,SeparateImages,Vectors"
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

"properties": {
  "minRefreshPeriod": "30",
  "compatibilityMode": "GoogleEarth",
  "imageSize": "1024",
  "dpi": "96",
  "endPointURL": "",
  "featureLimit": "1000000",
  "useDefaultSnippets": "false"
}

FrameworkDescription
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

"javaHeapSize": "64"

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 example

{"status": "success"}