Skip to content
URL:
https://<root>/services/createService
Methods:
POST
Version Introduced:
10.9

Access requirements

Required privileges

The Enterprise Administrator API requires privilege-based access. An administrator must be assigned a specific user privilege, or role, to access any given endpoint. Listed below are the user privileges or roles an administrator can be assigned that provides access to this endpoint. If multiple privileges are listed, only one needs to be assigned to gain access.


Tokens

This API requires token-based authentication. A token is automatically generated for administrators who sign in to the Enterprise Administrator API directory's HTML interface. Tokens generated in this way are stored for the entirety of the session.

Those accessing the API directory outside of the HTML interface will need to acquire a session token from the generateToken operation in the Enterprise Directory API. For security reasons, all POST requests made to the Enterprise Administrator API must include a token in the request body.


Learn how to generate a token

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

service

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

servicePlacementPolicy

(Optional)

Introduced at 11.2. The placement policy that specifies the node affinity and tolerations applied to the service's pods. For more information on configuring node affinity and tolerations, see Node affinity and Tolerations.

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
23
24
25
26
27
28
29
30
31
32
33
34
35
servicePlacementPolicy={
  "placementPolicy": [
    {
      "deploymentType": "MapServer",
      "deploymentId": "",
      "podPlacementPolicy": {
        "tolerations": [
          {
            "effect": "NoSchedule",
            "key": "label1",
            "operator": "Equal",
            "value": "test1"
          }
        ],
        "nodeAffinity": {
          "requiredDuringSchedulingIgnoredDuringExecution": {
            "nodeSelectorTerms": [
              {
                "matchExpressions": [
                  {
                    "key": "sampleLabel",
                    "operator": "In",
                    "values": [
                      "sampleValue"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    }
  ]
}

async

Indicates whether to process the operation in synchronous or asynchronous mode. The default value is false. When set to true, the operation returns a status URL that can be used as a request to retrieve the job status for the operation.

Values: true | false

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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
POST /<context>/admin/services/createService HTTP/1.1
Host: organization.example.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

service={
  "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"
      }
    }
  ]
}&servicePlacementPolicy={
  "placementPolicy": [
    {
      "deploymentType": "MapServer",
      "deploymentId": "",
      "podPlacementPolicy": {
        "tolerations": [
          {
            "effect": "NoSchedule",
            "key": "label1",
            "operator": "Equal",
            "value": "test1"
           }
        ],
        "nodeAffinity": {
          "requiredDuringSchedulingIgnoredDuringExecution": {
            "nodeSelectorTerms": [
              {
                "matchExpressions": [
                  {
                    "key": "sampleLabel",
                    "operator": "In",
                    "values": [
                      "sampleValue"
                    ]
                  }
                ]
              }
            ]
          }
        }
      }
    }
  ]
}async=false&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.