- URL:https://<root>/services/createService(POST only)
- Required Capability:Default administrator role | Security and infrastructure | Update | Delete | 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.
Note:
Values set for the replicas and resources JSON objects will be used in place of the default values set for the deployment's microservices. Once set, it is recommended that, when needed, scaling properties are updated using the edit scaling operation.
Request parameters
Parameter | Details |
---|---|
serviceJson (Optional) | The JSON representation of the service. |
inputUploadId (Optional) | Caution:This parameter is currently not supported for general use. 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, formatted for readability
|
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:
Property | Details |
---|---|
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 of manual scaling
For organizations using ArcGIS Enterprise on Kubernetes 11.0 or later, autoscaling version 2 can be enabled for a service 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 represents the CPU utilization threshold for autoscaling. If the threshold is crossed, ArcGIS Enterprise on Kubernetes will scale up to the number of pods specified by the max value, and will return no lower than the default pod level (the value set for min) once utilization decreases. Example of autoscaling
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:
|
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
|
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": []
}&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
{"status": "success"}