Skip To Content
ArcGIS Developers
Dashboard

Create Service

Description

This operation creates a new GIS service in a folder (either the root or a sub-folder) 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.
  • Extension Properties—Represent the extensions that are enabled on the service.
Note:

The JSON is submitted to the operation URL as a value of the parameter serviceJson. The values of all parameters must be either JSON or double quoted strings ("").

Request parameters

ParameterDetails
serviceJson

(Required)

The JSON representation of the service being created.

f

The response format. The default response format is html.

Values: html | json | pjson

Example usage

The following is a sample POST request for the createService operation, formatted for readability:

POST /context/admin/services/createService HTTP/1.1
Host: organization.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

serviceJson={
  "serviceName": "FireWeatherWatch",
  "type": "MapServer",
  "description": "",
  "capabilities": "Map,Query,Data",
  "provider": "ArcObjects",
  "clusterName": "default",
  "minInstancesPerNode": 1,
  "maxInstancesPerNode": 1,
  "instancesPerContainer": 1,
  "maxWaitTime": 60,
  "maxStartupTime": 300,
  "maxIdleTime": 180,
  "maxUsageTime": 600,
  "loadBalancing": "ROUND_ROBIN",
  "isolationLevel": "HIGH",
  "configuredState": "STARTED",
  "recycleInterval": 24,
  "recycleStartTime": "00:00",
  "keepAliveInterval": -1,
  "private": false,
  "isDefault": false,
  "maxUploadFileSize": 0,
  "allowedUploadFileTypes": "",
  "properties": {
    "useLocalCacheDir": "true",
    "outputDir": "${arcgisoutput}",
    "cacheDir": "${arcgiscache}",
    "maxScale": "4000",
    "filePath": "/arcgis/framework/etc/data/FireWatch/FireWeatherWatch.msd",
    "maxRecordCount": "1000",
    "supportedImageReturnTypes": "MIME+URL",
    "clientCachingAllowed": "true",
    "isCached": "false",
    "virtualOutputDir": "/rest/directories/arcgisoutput",
    "maxExportTilesCount": "100000",
    "ignoreCache": "false",
    "exportTilesAllowed": "false",
    "cacheOnDemand": "false",
    "minScale": "295000000"
  },
  "extensions": [
    {
      "typeName": "WMSServer",
      "capabilities": "GetCapabilities,GetFeatureInfo,GetLegendGraphic,GetMap,GetSchemaExtension,GetStyles",
      "enabled": "true",
      "maxUploadFileSize": 0,
      "allowedUploadFileTypes": "",
      "properties": {
        "name": "FireWeatherWatch",
        "title": "WMS"
      }
    },
    {
      "typeName": "KmlServer",
      "capabilities": "SingleImage,SeparateImages,Vectors",
      "enabled": "true",
      "maxUploadFileSize": 0,
      "allowedUploadFileTypes": "",
      "properties": {
        "compatibilityMode": "GoogleEarth",
        "useDefaultSnippets": "true",
        "featureLimit": "1000000",
        "minRefreshPeriod": "30",
        "imageSize": "1024",
        "dpi": "96"
      }
    },
    {
      "typeName": "FeatureServer",
      "capabilities": "Create,Query,Update,Delete,Uploads",
      "enabled": "false",
      "maxUploadFileSize": 0,
      "allowedUploadFileTypes": "",
      "properties": {}
    }
  ],
  "frameworkProperties": {},
  "datasets": []
}&f=pjson&token=Mb0ORrkLObNO2Q8FZoUCHHzSMzZi0CbhLHNRYMqqa6URG_ojQJF3rNsJAfRB23MyCrLwSmuaHPUo4AEIrUuoH1-4Ot5xh4565FtlQahXAhK2C7Sy0oydZhBwD8KdFSnVlnLr-e9uI5ovSWZ2lGNn9SwoV2MPMzeAh_5r-q-wgwF8DTT_nhuCXJGkMRy-48jjGS2aN5FI18STHZ8RAuKxGasH90SI3C7njZzlGCUrY5m6BDhCMsdpZA14GwNX8Cis

JSON Response example

{"status": "success"}