Create Service

URL:
https://<root>/services/createService
Methods:
POST
Required Capability:
Access allowed with either the "Update", "Delete", or "Security and infrastructure" privileges, or the Publisher role
Version Introduced:
10.9

Description

The createService operation creates a GIS service in a folder (either the root folder or a designated subfolder) by submitting a JSON representation of the service or by uploading a service definition.

A service's JSON representation 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 targeting the framework that hosts the GIS service. They define the life cycle and load balancing of the service.
  • Service Type Properties—Properties targeting the core service type as identified by the server administrator. Since these properties are associated with a server object, they vary across the service types.
  • Extension Properties—Properties that represent the extensions that are enabled on the service.

Scaling in ArcGIS Enterprise on Kubernetes

When creating a service, you can set manual scaling or autoscaling using the serviceScalingSpec parameter. Introduced at ArcGIS Enterprise on Kubernetes 10.9.1, autoscaling allows administrators to configure and deploy systems that respond to unexpected performance demands with minimal intervention and overhead. The ArcGIS Enterprise on Kubernetes autoscaling feature uses horizontal pod autoscaling, which, in response to an increase in resource use, deploys more pods according to the values set by the administrator.

When a specific CPU utilization threshold (averageUtilization) is crossed, ArcGIS Enterprise on Kubernetes will scale the number of pods up to the maximum (max) values set in the replicas JSON object. When utilization drops, and the additional resources are no longer needed, the system scales itself down to no lower than the minimum (min) value set in the replicas JSON object. For more information about how to set manual or autoscaling for a service, see the Service scaling properties section below.

Request parameters

ParameterDetails

serviceJson

(Optional)

The JSON representation of the service.

inputUploadId

(Optional)

The upload ID for a service definition that contains information about service properties, capabilities, and the service type.

serviceScalingSpec

(Optional)

The service scaling properties, represented as a JSON object. For information about the editable properties for the serviceScalingSpec parameter, see the Service scaling properties section below.

Example
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
serviceScalingSpec={
  "scalingSpec": [
    {
      "deploymentType": "MapServer",
      "replicas": {
        "min": 2,
        "max": 2,
        "scalingMode": "manual"
      },
      "resources": {
        "memoryMin": "1.25Gi",
        "memoryMax": "2.5Gi",
        "cpuMin": "0.225",
        "cpuMax": "3"
      }
    }
  ]
}

f

The response format. The default response format is html.

Values: html | json | pjson

Service scaling properties

The following properties can be modified for the serviceScalingSpec parameter:

PropertyDetails

replicas

The number of replicas for the service. The default value for manual scaling for min and max is 1. For manual scaling, both the min and max values must be the same.

Example
Use dark colors for code blocksCopy
1
2
3
4
5
"replicas": {
  "min": 3,
  "max": 3,
  "scalingMode": "manual"
},

For organizations using ArcGIS Enterprise 11.2 on Kubernetes or later versions, version 2 (v2) of the autoscaling feature can be enabled by passing in the JSON object below and modifying the min, max, scalingMode, and averageUtilization values.

Autoscaling can be enabled by adjusting the scalingMode value to auto. The averageUtilization value will act as the CPU utilization threshold for autoscaling. If the threshold is crossed, ArcGIS Enterprise on Kubernetes scales up to the number of pods specified by the max value, and will return to no lower than the default pod level (the value set for min) once utilization decreases.

Example
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"replicas": {
  "min": 1,
  "max": 10,
  "scalingMode": "auto",
  "autoscaling": {
    "hpaSpec": {
      "metrics": [
        {
          "resource": {
            "name": "cpu",
            "target": {
              "averageUtilization": "65",
              "type": "Utilization"
            }
          },
          "type": "Resource"
        }
      ],
      "hpaVersion": "autoscaling/v2"
    }
  }
},

Organizations using ArcGIS Enterprise on Kubernetes 10.9.1 can enable version 1 of the autoscaling feature by passing in the JSON object below and modifying the min, max, scalingMode, and targetCPUUtilizationPercentage values:

Example
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
"replicas": {
  "min": 1,
  "max": 5,
  "scalingMode": "auto",
  "autoscaling": {
    "hpaSpec": {
      "targetCPUUtilizationPercentage": 50
    },
    "hpaVersion": "autoscaling/v1"
  }
}

resources

The minimum and maximum resource allocations for the service, including the minimum memory (memoryMin) and minimum CPU (cpuMin) resources required for the service to start.

Example
Use dark colors for code blocksCopy
1
2
3
4
5
6
"resources": {
  "memoryMin": "500Mi",
  "memoryMax": "2Gi",
  "cpuMin": "0.125",
  "cpuMax": "2"
},

Example usage

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

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
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": []
}&inputUploadId=&serviceScalingSpec={
  "scalingSpec": [
    {
      "deploymentType": "MapServer",
      "replicas": {
        "min": 2,
        "max": 2,
        "scalingMode": "manual"
      },
      "resources": {
        "memoryMin": "1.25Gi",
        "memoryMax": "2.5Gi",
        "cpuMin": "0.225",
        "cpuMax": "3"
      }
    }
  ]
}&f=pjson&token=Mb0ORrkLObNO2Q8FZoUCHHzSMzZi0CbhLHNRYMqqa6URG_ojQJF3rNsJAfRB23MyCrLwSmuaHPUo4AEIrUuoH1-4Ot5xh4565FtlQahXAhK2C7Sy0oydZhBwD8KdFSnVlnLr-e9uI5ovSWZ2lGNn9SwoV2MPMzeAh_5r-q-wgwF8DTT_nhuCXJGkMRy-48jjGS2aN5FI18STHZ8RAuKxGasH90SI3C7njZzlGCUrY5m6BDhCMsdpZA14GwNX8Cis

JSON Response example

Use dark colors for code blocksCopy
1
{"status": "success"}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.