fbpx
PUThttps://api.spotinst.io/compute/azure/group/{GROUP_ID}?accountId={ACCOUNT_ID}

 

          Update an Elastigroup cluster

URL Parameters

Parameter Type Description
GROUP_ID * String

ID of Elastigroup to update.

Example: sig-12345
ACCOUNT_ID String

Your Spotinst accountid associated with your token

Example: act-123abc
Request

Headers
{  
   "Content-Type": "application/json",
   "Authorization": "Bearer ${token}" 
}
Body
Copied!
Downloaded!
{
  "group": {
    "name": "spotinst-group",
    "capacity": {
      "target": 2,
      "minimum": 2,
      "maximum": 10
    },
	"scaling": {
      "up": [
        {
          	"policyName": "Healthy Host Count",
        	"metricName": "Healthy Host Count",
        	"statistic": "average",
        	"threshold": 0.75,
        	"period": 60,
        	"evaluationPeriods": 3,
        	"cooldown": 300,
            "namespace": "Microsoft.Network/applicationGateways",
             	"dimensions": [
				{
					"name": "resourceName",
					"value": "TestAppGateway"
				},
				{
					"name": "resourceGroupName",
					"value": "TestResourceGroup"
				}
				],
        	"action": {
          		"type": "adjustment", 
          		"adjustment": "2"
        	},
        "operator": "gte" 
        }
      ],
      "down": [
       {
         	"policyName": "down when 20% CPU",
        	"metricName": "Percentage CPU",
        	"statistic": "average",
        	"threshold": 0.2,
        	"period": 60,
        	"evaluationPeriods": 4,
        	"cooldown": 300,
        	"action": {
          		"type": "updateCapacity", 
          		"target": 10,
              	"minimum": 8,
              	"maximum": 10
        	},
        "operator": "lte" 
       }
     ]
    },
    "strategy": {
      "lowPriorityPercentage": 100,
      "odCount": 1,
      "drainingTimeout": 300
    },
    "compute": {
      "vmSizes": {
        "odSizes": [
          "Standard_A1",
          "Standard_A2"
        ],
        "lowPrioritySizes": [
          "Standard_A1",
          "Standard_A2"
        ]
      },
      "health": {
		"autoHealing": true,
        "healthCheckType": "INSTANCE_STATE",
        "gracePeriod": 120
	  },
      "launchSpecification": {
        "loadBalancersConfig":{
          "loadBalancers":[
            {
              "type":"MULTAI_TARGET_SET",
              "balancerId":"lb-1ee2e3q",
              "targetSetId":"ts-3eq",
              "autoWeight": true
            },
            {
              "type":"APPLICATION_GATEWAY",
              "resourceGroupName":"myResourceGroup",
              "applicationGatewayName":"myappgateway47891",
              "backendPoolName": "backendpool490822"
            }
          ]
        },
		"userData": "ICMhL3Vzci9iaW4vZW52IGJhc2gKZWNobyAiV2VsY29tZSB0byBTcG90aW5zdCIA",
        "managedServiceIdentities": 
        [
          {"name": "mySI2", 
           "resourceGroupName":"myResourceGroup"}
        ], 
        "tags": [
        {
          "tagKey": "env",
          "tagValue": "staging"
        },
        {
          "tagKey": "name",
          "tagValue": "sharon"
        }]
      }
    },
      "thirdPartyIntegrations": {
        "kubernetes": {
            "clusterIdentifier": "test-cluster",
            "autoScale": {
                "isEnabled": true,
                "isAutoConfig": false,
                "cooldown": 180,
                "down":
                { 
                    "maxScaleDownPercentage": 50 
                },
                "headroom":
                { 
                    "cpuPerUnit": 2000, 
                    "memoryPerUnit": 4000, 
                    "gpuPerUnit": 1, 
                    "numOfUnits": 3 
                },
                "labels": [
                    { 
                        "key": "group", 
                        "value": "microservices" 
                    },
                    { 
                        "key": "kops.k8s.io/instancegroup", 
                        "value": "microservices" 
                    }
                ],
                "resourceLimits":
                { 
                    "maxVCpu": 5, 
                    "maxMemoryGib": 70 
                }
            }
        }
    }
  }
}
  • name * String
    Elastigroup name
  • capacity * Object
    Capacity of Elastigroup.
  • capacity.target * Integer
    Desired number of instances for Elastigroup to maintain.
  • capacity.minimum * Integer
    Minimum number of instances.
  • capacity.maximum * Integer
    Maximum number of instances.
  • scaling Object
    Scaling Policies for Elastigroup.
  • scaling.up.policyName String
    Name of scaling policy.
  • scaling.up.metricName String
    Metric to monitor by Azure metric display name
  • scaling.up.statistic String
    Statistic by which to evaluate the selected metric.

    Valid Values: AVERAGE(“average”)

  • scaling.up.threshold Float
    The value at which the scaling action is triggered.
  • scaling.up.period Integer
    Amount of time (seconds) for which the threshold must be met in order to trigger the scaling action.
    Example: 60
  • scaling.up.evaluationPeriods Integer
    Number of consecutive periods in which the threshold must be met in order to trigger the scaling action.
    Example: 5
  • scaling.up.cooldown Integer
    Time (seconds) to wait after a scaling action before resuming monitoring.
  • scaling.up.action Object
    Scaling action to take when the policy is triggered.
  • scaling.up.action.type String
    Type of scaling action to take when the scaling policy is triggered.

    Valid Values: "adjustment", "setMinTarget", "updateCapacity", "percentageAdjustment".

    Example: "setMinTarget"
  • scaling.up.action.adjustment Integer
    Value to which the action type will be adjusted.
    Required if using "numeric" or "percentageAdjustment" action types.
  • scaling.up.action.minTargetCapacity Integer
    Value to adjust the capacity to. Required if using “setMinTarget” as action type
  • scaling.up.action.target Integer
    Value to update the group target capacity to. Required if using “updateCapacity” as action type and “minimum” and “maximum” are undefined.
  • scaling.up.action.minimum Integer
    Value to update the group mimimum capacity to. Required if using “updateCapacity” as action type and “target” and“maximum” are undefined.
  • scaling.up.action.maximum Integer
    Value to update the group mimimum capacity to. Required if using “updateCapacity” as action type and “target” and “minimum” are defined.
  • scaling.up.operator String
    The operator used to evaluate the threshold against the current metric value.

    Valid Values: "gt" (Greater Than),"gte" (Greater Than or Equal), "lt" (Less Than), "lte" (Less Than or Equal)

    Example: "gte"
  • scaling.up.namespace String
    Should be one of the namespaces: Microsoft.AnalysisServices/servers
    Microsoft.ApiManagement/service
    Microsoft.Automation/automationAccounts
    Microsoft.Batch/batchAccounts
    Microsoft.Cache/redis
    Microsoft.Compute
    Microsoft.CognitiveServices/accounts
    Microsoft.ContainerInstance/containerGroups
    Microsoft.ContainerService/managedClusters
    Microsoft.CustomerInsights/hubs
    Microsoft.DataFactory/datafactories
    Microsoft.DataFactory/factories
    Microsoft.DataLakeAnalytics/accounts
    Microsoft.DataLakeStore/accounts
    Microsoft.DBforMariaDB/servers
    Microsoft.DBforMySQL/servers
    Microsoft.DBforPostgreSQL/servers
    Microsoft.Devices/IotHubs
    Microsoft.Devices/provisioningServices
    Microsoft.DocumentDB/databaseAccounts
    Microsoft.EventGrid/topics
    Microsoft.EventGrid/eventSubscriptions
    Microsoft.EventGrid/extensionTopics
    Microsoft.EventHub/namespaces
    Microsoft.EventHub/clusters
    Microsoft.HDInsight/clusters
    Microsoft.Insights/AutoscaleSettings
    Microsoft.Insights/Components
    Microsoft.KeyVault/vaults
    Microsoft.Kusto/Clusters
    Microsoft.LocationBasedServices/accounts
    Microsoft.Logic/workflows
    Microsoft.NetApp/netAppAccounts/capacityPools/Volumes
    Microsoft.NetApp/netAppAccounts/capacityPools
    Microsoft.Network/networkInterfaces
    Microsoft.Network/loadBalancers
    Microsoft.Network/dnszones
    Microsoft.Network/publicIPAddresses
    Microsoft.Network/applicationGateways
    Microsoft.Network/virtualNetworkGateways
    Microsoft.Network/expressRouteCircuits
    Microsoft.Network/expressRouteCircuits/peerings
    Microsoft.Network/connections
    Microsoft.Network/trafficManagerProfiles
    Microsoft.Network/networkWatchers/connectionMonitors
    Microsoft.Network/frontdoors
    Microsoft.NotificationHubs/Namespaces/NotificationHubs
    Microsoft.OperationalInsights/workspaces
    Microsoft.PowerBIDedicated/capacities
    Microsoft.Relay/namespaces
    Microsoft.Search/searchServices
    Microsoft.ServiceBus/namespaces
    Microsoft.SignalRService/SignalR
    Microsoft.Sql/servers/databases
    Microsoft.Sql/servers/elasticPools
    Microsoft.Sql/managedInstances
    Microsoft.Storage/storageAccounts
    Microsoft.Storage/storageAccounts/blobServices
    Microsoft.Storage/storageAccounts/fileServices
    Microsoft.Storage/storageAccounts/queueServices
    Microsoft.Storage/storageAccounts/tableServices
    Microsoft.StreamAnalytics/streamingjobs
    Microsoft.TimeSeriesInsights/environments
    Microsoft.TimeSeriesInsights/environments/eventsources
    Microsoft.Web/serverfarms
    Microsoft.Web/sites (excluding functions)
    Microsoft.Web/sites (functions)
    Microsoft.Web/sites/slots
    Microsoft.Web/hostingEnvironments/multiRolePools
    Microsoft.Web/hostingEnvironments/workerPools
    Default: Microsoft.Compute
  • scaling.up.dimensions Object
    Required if namespace is used, AND namespace != “Microsoft.Compute”
  • scaling.up.dimensions.resourceGroupName String
    Azure resource group for the scaling.up.dimensions
  • scaling.up.dimensions.resourceName String
    Azure resource the scaling.up.dimensions
  • scaling.down.policyName String
    Name of scaling policy.
  • scaling.down.metricName String
    Metric to monitor by Azure metric display name
  • scaling.down.statistic String
    Statistic by which to evaluate the selected metric.

    Valid Values: AVERAGE(“average”)

  • scaling.down.threshold Float
    The value at which the scaling action is triggered.
  • scaling.down.period Integer
    Amount of time (seconds) for which the threshold must be met in order to trigger the scaling action.
  • scaling.down.evaluationPeriods Integer
    Number of consecutive periods in which the threshold must be met in order to trigger the scaling action.
  • scaling.down.cooldown Integer
    Time (seconds) to wait after a scaling action before resuming monitoring.
  • scaling.down.action Object
    Scaling action to take when the policy is triggered.
  • scaling.down.action.type String
    Type of scaling action to take when the scaling policy is triggered.

    Valid Values: "adjustment", "setMaxTarget", "updateCapacity", "percentageAdjustment".

  • scaling.down.action.adjustment Integer
    Value to which the action type will be adjusted.
    Required if using "numeric" or "percentageAdjustment" action types.
  • scaling.down.action.maxTargetCapacity Integer
    Value to adjust the capacity to. Required if using “setMinTarget” as action type.
  • scaling.down.action.target Integer
    Desired number of instances. Required if using “updateCapacity” as action type and “minimum” and “maximum” are defined.
  • scaling.down.action.minimum Integer
    Lower limit of instances that you can scale down to. Optional, required if using “updateCapacity” as action type and “target” and “maximum” are defined.
  • scaling.down.action.maximum Integer
    Upper limit of instances that you can scale down to. Optional, required if using “updateCapacity” as action type and “target” and “minimum” are defined.
  • scaling.down.operator String
    The operator used to evaluate the threshold against the current metric value.

    Valid Values: "gt" (Greater Than),"gte" (Greater Than or Equal), "lt" (Less Than), "lte" (Less Than or Equal)

  • strategy * Object
  • strategy.lowPriorityPercentage Integer
    Percentage of Low Priority instances to maintain.

    Required if odCount isn't specified.

    Default: 100
  • strategy.odCount Integer
    Number of On-Demand instances to maintain.

    Required if lowPriorityPercentage isn't specified.

  • strategy.drainingTimeout Integer
    Time (seconds) to allow the instance be drained from incoming TCP connections and detached from MLB before terminating it during a scale down operation.
    Default: 120 seconds
  • compute * Object
  • compute.vmSizes * Array<Object>
    Sizes of On-Demand and Low-Priority instances.
  • compute.vmSizes.odSizes * Array<String>
    Available On-Demand instance . sizes.
  • compute.vmSizes.lowPrioritySizes * Array<String>
    Available Low-Priority instance sizes.
  • compute.launchSpecification.loadBalancersConfig Object
    Configure a Load Balancer.
  • compute.launchSpecification.loadBalancersConfig.loadBalancers Array<Object>
    Add a load balancer. For Azure Gateway, each Backend Pool is a separate load balancer.
  • compute.launchSpecification.loadBalancersConfig.loadBalancers.type String
    The type of load balancer.
    Valid Values: "MULTAI_TARGET_SET", "APPLICATION_GATEWAY"
  • compute.launchSpecification.loadBalancersConfig.loadBalancers.resourceGroupName String
    The Resource Group name of the Load Balancer.
  • compute.launchSpecification.loadBalancersConfig.loadBalancers.applicationGatewayName String
    Name of the Application Gateway.
    Required if Type is APPLICATION_GATEWAY.
  • compute.launchSpecification.loadBalancersConfig.loadBalancers.backendPoolName String
    Name of the Backend Pool to register the Elastigroup VMs to. Each Backend Pool is a separate load balancer.
    Required if Type is APPLICATION_GATEWAY.
  • compute.launchSpecification.loadBalancersConfig.loadBalancers.balancerId String
    Required if Type is MULTAI_TARGET_SET. Add the Multai Load Balancer's ID.
    Example: lb-1ee2e3q
  • compute.launchSpecification.loadBalancersConfig.loadBalancers.targetSetId String
    Required if Type is MULTAI_TARGET_SET. Add the Target Set to register the Elastigroup VMs to.
    Example: ts-3eq
  • compute.launchSpecification.loadBalancersConfig.loadBalancers.compute.launchSpecification.loadBalancersConfig.loadBalancers.autoWeight Boolean
    Allocate traffic based on the number of cores per VM.
    Default: False
  • compute.launchSpecification.managedServiceIdentities Array
    Add a user-assigned managed identity to the VMs in the cluster.
  • compute.launchSpecification.managedServiceIdentities.name String
    name of the managed identity
  • compute.launchSpecification.managedServiceIdentities.resourceGroupName String
    The Resource Group that the user-assigned managed identity resides in.
  • compute.launchSpecification.tags Array<Object>
    Key-Value pairs for VMs in the Elastigroup.
  • compute.launchSpecification.tags.tagKey String
    Tag Key for Vms in Elastigroup.
  • compute.launchSpecification.tags.tagValue String
    Tag Value for VMs in Elastigroup.
  • compute.launchSpecification.userdata String
    User data to make available for instances. Value should be in Base64-encoded MIME.
  • compute.health Object
    Autohealing of unhealthy VMs.
  • compute.health.autoHealing Boolean
    Enable Autohealing of unhealthy VMs.
  • compute.health.healthCheckType String
    Healthcheck to use to validate VM health. Valid Values: "INSTANCE_STATE", "MULTAI_TARGET_SET", "HCS"
  • thirdPartiesIntegration Object
    Settings for 3rd party integrations on group
  • thirdPartiesIntegration.kubernetes Object
    Define Kubernetes integration on group
  • thirdPartiesIntegration.kubernetes.autoScale Object
    K8's auto scaler configuration
  • thirdPartiesIntegration.kubernetes.autoScale.isEnabled Boolean
    Is the auto scaler enabled or not
  • thirdPartiesIntegration.kubernetes.autoScale.isAutoConfig Boolean
    Set to true if you want to use the Automated headroom feature
  • thirdPartiesIntegration.kubernetes.autoScale.cooldown Integer
    Cool down period between scaling actions
  • thirdPartiesIntegration.kubernetes.autoScale.down Object
    Auto scaler Scale down configuration
  • thirdPartiesIntegration.kubernetes.autoScale.down.maxScaleDownPercentage Integer
    Would represent the maximum % to scale-down. Number between 1-100
    Example: 50
  • thirdPartiesIntegration.kubernetes.autoScale.headroom Object
    Headroom configuration of the auto scaler
  • thirdPartiesIntegration.kubernetes.autoScale.headroom.cpuPerUnit Integer
    How much CPU to allocate for headroom unit
  • thirdPartiesIntegration.kubernetes.autoScale.headroom.memoryPerUnit Integer
    How much Memory allocate for headroom unit
  • thirdPartiesIntegration.kubernetes.autoScale.headroom.gpuPerUnit Integer
    How much GPU allocate for headroom unit
  • thirdPartiesIntegration.kubernetes.autoScale.headroom.numOfUnits Integer
    How many units to allocate for headroom unit
  • thirdPartiesIntegration.kubernetes.autoScale.labels Array<Object>
    Key/value pairs to use as constraints.
  • thirdPartiesIntegration.kubernetes.autoScale.labels.key String
    key of constraint
  • thirdPartiesIntegration.kubernetes.autoScale.labels.value String
    value of constraint
  • thirdPartiesIntegration.kubernetes.autoScale.resourceLimits Object
    Optionally set upper and lower bounds on the resource usage of the cluster.
  • thirdPartiesIntegration.kubernetes.autoScale.resourceLimits.maxVCpu Integer
    The maximum cpu in vCpu units that can be allocated to the cluster.
  • thirdPartiesIntegration.kubernetes.autoScale.resourceLimits.maxMemoryGib Integer
    The maximum memory in GiB units that can be allocated to the cluster.
Response - Response: 200

Body
Copied!
Downloaded!
{    
  "request": {
        "id": "d9cdd020-cea0-428c-bd72-534339d43336",
        "url": "/azure/compute/group?spotinstAccountId=act-91234h4a",
        "method": "PUT",
        "timestamp": "2018-06-20T09:42:23.934+0000"
  },
  "response": {
      "status": {
        "code": 200,
        "message": "OK"
      },
      "kind": "spotinst:azure:compute:group",
      "items": [
        {
          "Id": "sig-123123",
          "name": "spotinst-group",
          "region": "westus",
          "resourceGroupName": "name",
          "capacity": {
            "target": 2,
            "minimum": 2,
            "maximum": 10
          },
          "scaling": {
            "up": [
              {
                "policyName": "up when 30% CPU",
                "metricName": "Percentage CPU",
                "statistic": "average",
                "unit": "bytse",
                "threshold": 0.3,
                "period": 60,
                "evaluationPeriods": 5,
                "cooldown": 1,
                "action": {
                  "type": "setMinTarget",
                  "minTargetCapacity": "2"
                },
                "operator": "gte"
              }
            ]
          },
          "strategy": {
            "lowPriorityPercentage": 100,
            "onDemandCount": 1,
            "drainingTimeout": 300
          },
          "compute": {
            "vmSizes": {
              "odSizes": [
                "standard_a1",
                "standard_a2"
              ],
              "lowPrioritySizes": [
                "standard_a1",
                "standard_a2"
              ]
          	},
          "product": "Linux",
          "launchSpecification": {
              "image": {
                "marketplace": { 
                	"publisher": "Canonical",
                	"offer": "Ubuntu Server",
                	"sku": "16.04"
                },
                "custom": {
                    "resourceGroupName": "resourceGroupName",
                    "imageName": "image"
                  }
              },
              "userData": "Base64",
              "network": {
                    "virtualNetworkName": "vname",
                    "subnetName": "id",
                    "resourceGroupName": "subnetResourceGroup",
                    "assignPublicIp": true
               },
               "login": {
                      "userName": "Admin",   
                      "sshPublicKey": "IyEvYml1234OC87CnRvdWNoIHRlc3QuZmlsZQ==",
                      "password": "******"
               }
          }
		},
          "thirdPartyIntegrations": {
            "kubernetes": {
                "clusterIdentifier": "test-cluster",
                "autoScale": {
                    "isEnabled": true,
                    "isAutoConfig": false,
                    "cooldown": 180,
                    "down":
                    { 
                        "maxScaleDownPercentage": 50 
                    },
                    "headroom":
                    { 
                        "cpuPerUnit": 2000, 
                        "memoryPerUnit": 4000, 
                        "gpuPerUnit": 1, 
                        "numOfUnits": 3 
                    },
                    "labels": [
                        { 
                            "key": "group", 
                            "value": "microservices" 
                        },
                        { 
                            "key": "kops.k8s.io/instancegroup", 
                            "value": "microservices" 
                        }
                    ],
                    "resourceLimits":
                    { 
                        "maxVCpu": 5, 
                        "maxMemoryGib": 70 
                    }
                }
            }
        }
      }
      ],
  	"count": 1
	}
}