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

 

          Create a new Elastigroup cluster

URL Parameters

Parameter Type Description
ACCOUNT_ID String

Your Spotinst accountid associated with your token

Example: act-123abc

Body parameters


  • * String
    Elasticgroup name

CAPACITY


  • capacity.target * Integer
    The number of nodes to launch
  • capacity.minimum * String
    The lower limit number of nodes that you can scale down to
  • capacity.maximum * String
    The upper limit number of nodes that you can scale up to

STRATEGY


  • strategy.lowPriorityPercentage * Integer
    (Required if dedicatedCount is not specified) The percentage of Low Priority nodes to launch (range: 0 - 100).
  • trategy.dedicatedCount * Integer
    Number of dedicated nodes to launch in the group. All other nodes will be low priority nodes. When this parameter is set the “lowPriorityPercentage” parameter is being ignored.
  • strategy.drainingTimeout Integer
    The signals defined for this group
  • strategy.signals Array
    The name of the signal defined for the group.Valid Values: NODE_READY
  • strategy.signals.name String
    The timeout of the signal, if the timeout is passes its equal to receive a node signal. Min = 60 (seconds)
  • strategy.signals.timeout Integer
    The timeout of the signal, if the timeout is passes its equal to receive a node signal. Min = 60 (seconds)

COMPUTE


  • compute.region * String
    The region of the Elasticgroup. Possible values: westus, westus, centraleurope
  • compute.resourceGroupName * String
    The resource group that the nodes of the group will be attached to. The resource group must be in the same region as the Elasticgroup.
  • compute.product * String
    Operation system type. Possible values: Linux, Windows

VM Sizes


  • compute.vmSizes.dedicatedSizes * String
    Available VM sizes for dedicated nodes
  • compute.vmSizes.lowPrioritySizes * Array
    Available VM sizes for low priority nodes

Launch Specification


  • compute.launchSpecification.loadBalancersConfig Object
    Multai Load Balancers configurations.
  • compute.launchSpecification.loadBalancersConfig.loadBalancers Array<Object>
    List of multai load balancers.
  • compute.launchSpecification.loadBalancersConfig.loadBalancers.targetSetId String
    The target set ID of the multai load balancer.
  • compute.launchSpecification.loadBalancersConfig.loadBalancers.balancerId String
    The balancer ID of the multai load balancer.
  • compute.launchSpecification.health Object
    Health configuration of the Elastigroup.
  • compute.launchSpecification.health.healthCheckType String
    The service to use for the health check. Valid Values: MLB nodeState
  • compute.launchSpecification.health.gracePeriod Integer
    The amount of time, in seconds, after the instance has launched to starts and check its health. Default: 300 seconds
  • compute.launchSpecification.health.autoHealing Boolean
    Should Auto Healing be on or off, if set to true: unhealthy nodes will be replaced with new ones.
  • compute.launchSpecification.image * Object
    Health configuration of the Elasticgroup.
  • compute.launchSpecification.image.publisher * String
    The publisher of the image. Possible Values: Microsoft, Canonical
  • compute.launchSpecification.image.offer * String
    The offer of the image which belongs to the publisher. Possible Values: Windows Server, Ubuntu
  • compute.launchSpecification.image.sku * String
    The sku of the image, must be according to the publisher and the offer. Possible Values: 2012R2, 16.04
  • compute.launchSpecification.image.sku * String
    The sku of the image, must be according to the publisher and the offer. Possible Values: 2012R2, 16.04
  • compute.launchSpecification.image.customImage Object
    Custom image object, must be according to the publisher and the offer.
  • compute.launchSpecification.image.customImage.resourceGroupName String
    The resource group of the custom image.
  • compute.launchSpecification.image.customImage.imageName String
    The custom image name.
  • compute.launchSpecification.userData Object
    Custom data which the nodes will start with.
  • compute.launchSpecification.userData.commandLine String
    A simple bash command line for linux systems. Optional value: echo 5 > txt
  • compute.launchSpecification.resourceFiles Array<Object>
    List of files which will be copied and execute during launch.
  • compute.launchSpecification.userData.resourceFiles.resourceFileUrl * String
    The source file which will be copied to the node. Must be in a blob of a storage account in the same subscription of the Elasticgroup.
  • compute.launchSpecification.userData.resourceFiles.resourceFileTargetPath * String
    The destination path which the file will be copied to in the node os. Possible value: /etc/test
  • compute.launchSpecification.network Object
    The network configuration of the nodes in the elasticgroup.
  • compute.launchSpecification.network.virtualNetworkName * String
    The name of the virtual network which the nodes will be associated to. the VNET must be in the same subscription and region as the Elasticgroup.
  • compute.launchSpecification.network.subnetId * String
    The subnet ID of the VNET which the nodes will use.
  • compute.launchSpecification.sshPublicKey String
    The public key which will be configured to access via SSH.
  • compute.launchSpecification.nodeUsers Array<String>
    You can define a list of users (list of strings) with which you can ssh to the node, these users will be added to the newly launched nodes only in case there is a public ssh key defined in the group. in case the node users were added after nodes were already launched they will NOT be added to those nodes, this will work for new nodes. if the list is empty the default ‘spotinst’ user will be added.
  • compute.launchSpecification.dataDisks Array<Object>
    List of Data Disks that will be attached to the machine
  • compute.launchSpecification.dataDisks.diskSize * Integer
    (Required for each dataDisk) the Disk size in GB
  • compute.launchSpecification.dataDisks.index * Integer
    (Required for each dataDisk) The Disk Index, should be unique if more than one data disk is defined
  • compute.launchSpecification.dataDisks.cachingType String
    The type of Caching to be used, valid values are - none | readOnly | readWrite
  • compute.launchSpecification.dataDisks.storageAccountType String
    The Storage Account Type valid values are - Standard_LRS | Premium_LRS

SCALING


  • scaling.up.policyName String
    The policy name
  • scaling.up.metricName String
    The name of the metric. Default value is CPUUtilization
  • scaling.up.statistic String
    The metric statistics to return. Valid Values: average , sum , sampleCount , maximum , minimum , percentile
  • scaling.up.extendedStatistic String
    Percentile statistic. Valid values: p0.1 - p100
  • scaling.up.unit String
    The unit for the alarm’s associated metric. Valid Values: seconds , microseconds , milliseconds , bytes , kilobytes , megabytes , gigabytes , terabytes , bits , kilobits , megabits , gigabits , terabits , percent , count , bytes/second , kilobytes/second , megabytes/second , gigabytes/second , terabytes/second , bits/second , kilobits/second , megabits/second , gigabits/second , terabits/second , count/second , none
  • scaling.up.threshold Double
    The value against which the specified statistic is compared
  • scaling.up.action Object
    The action to take when scale up is needed
  • scaling.up.action.type String
    The type of the action to take when scale up is needed. Valid Values: adjustment , updateCapacity setMinTarget , percentageAdjustment
  • scaling.up.action.adjustment Integer
    The number / percentage associated with the specified adjustment type. Required if using “adjustment” or “percentageAdjustment” as action type
  • scaling.up.action.minTargetCapacity Integer
    The number with the target capacity needed. Required if using “setMinTarget” as action type
  • scaling.up.action.target Integer
    The desired number of nodes. Required if using “updateCapacity” as action type and neither “minimum” nor “maximum” are not defined.
  • scaling.up.action.minimum Integer
    The lower limit number of nodes that you can scale down to. Optional, required if using “updateCapacity” as action type and neither “target” nor “maximum” are not defined
  • scaling.up.action.maximum Integer
    The upper limit number of nodes that you can scale up to. Optional, required if using “updateCapacity” as action type and neither “target” nor “minimum” are not defined
  • scaling.up.namespace String
    The namespace for the alarm’s associated metric. Default value is AWS/EC2.
  • scaling.up.dimensions Array<Object>
    The dimensions for the alarm’s associated metric. If the user mentioned name as nodeId, there is NO value
  • scaling.up.period Integer
    The period in seconds over which the statistic is applied.
  • scaling.up.evaluationPeriods Integer
    The number of periods over which data is compared to the specified threshold.
  • scaling.up.cooldown Integer
    The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start.
  • scaling.up.operator String
    The operator to use in order to determine if the scaling policy is applicable. Valid values: gt gte lt lte
  • scaling.down.policyName String
    The policy name
  • scaling.down.metricName String
    The name of the metric. Default value is CPUUtilization
  • scaling.down.statistic String
    The metric statistics to return. Valid Values: average sum sampleCount maximum minimum
  • scaling.down.extendedStatistic String
    Percentile statistic. Valid values: p0.1 - p100
  • scaling.down.unit String
    The unit for the alarm’s associated metric. Valid Values: seconds microseconds milliseconds bytes kilobytes megabytes gigabytes terabytes bits kilobits megabits gigabits terabits percent count bytes/second kilobytes/second megabytes/second gigabytes/second terabytes/second bits/second kilobits/second megabits/second gigabits/second terabits/second count/second none
  • scaling.down.adjustment - /scaling.down.maxTargetCapacity String
    int Deprecated, use “scaling.down.action” instead.
  • scaling.down.action Object
    The action to take when scale down is needed.
  • scaling.down.action.type String
    The type of the action to take when scale down is needed. Valid Values: adjustment updateCapacity setMaxTarget percentageAdjustment
  • scaling.down.action.adjustment Integer
    The number / percentage associated with the specified adjustment type. Required if using “adjustment” or “percentageAdjustment” as action type.
  • scaling.down.action.maxTargetCapacity Integer
    The number with the target capacity needed. Required if using “setMaxTarget” as action type.
  • scaling.down.action.target Integer
    The desired number of instances. Optional, required if using “updateCapacity” as action type and neither “minimum” nor “maximum” are not defined.
  • scaling.down.action.minimum Integer
    The lower limit number of instances that you can scale down to. Optional, required if using “updateCapacity” as action type and neither “target” nor “maximum” are not defined.
  • scaling.down.action.maximum Integer
    The upper limit number of instances that you can scale up to. Optional, required if using “updateCapacity” as action type and neither “target” nor “minimum” are not defined.
  • scaling.down.threshold Double
    The value against which the specified statistic is compared.
  • scaling.down.namespace String
    The namespace for the alarm’s associated metric. Default value is AWS/EC2
  • scaling.down.dimensions Array<Object>
    The dimensions for the alarm’s associated metric. If the user mentioned name as instanceId, there is NO value
  • scaling.down.period Integer
    The period in seconds over which the statistic is applied
  • scaling.down.evaluationPeriods Integer
    The number of periods over which data is compared to the specified threshold
  • scaling.down.cooldown Integer
    The amount of time, in seconds, after a scaling activity completes before any further trigger-related scaling activities can start
  • scaling.down.operator String
    The operator to use in order to determine if the scaling policy is applicable. Valid values: gt gte lt lte

SCHEDULING


  • scheduling Object
    All definitions for using scheduling
  • scheduling.tasks Array
    All scheduled tasks for this group
  • scheduling.tasks.isEnabled Boolean
    Describes whether the task is enabled. When true the task should run when false it should not run.
  • scheduling.tasks.frequency String
    The recurrence frequency to run this task. Valid Values: hourly daily weekly. Only one of ‘frequency’ or ‘cronExpression’ should be used at a time
  • scheduling.tasks.cronExpression String
    A valid cron expression. For example : " * * * * * ".The cron is running in UTC time zone and is in Unix cron format (http://www.unix.com/man-page/linux/5/crontab/). Only one of ‘frequency’ or ‘cronExpression’ should be used at a time.
  • scheduling.tasks.taskType String
    The task type to run. Valid Values: backup_ami scale roll
  • scheduling.tasks.scaleTargetCapcity Integer
    The target capacity of the group. Should be used when choosing ‘taskType’ of ‘scale’.
  • scheduling.tasks.scaleMinCapcity Integer
    The min capacity of the group. Should be used when choosing ‘taskType’ of ‘scale’.
  • scheduling.tasks.scaleMaxCapcity Integer
    The max capacity of the group. Should be used when choosing ‘taskType’ of ‘scale’.
  • cheduling.tasks.batchSizePercentage Integer
    The percentage size of each batch in the roll. Should be used when choosing ‘taskType’ of ‘roll’.

THIRD PARTIES INTEGRATION


  • thirdPartiesIntegration Object
    All definitions for using 3rd-party Integrations
  • thirdPartiesIntegration.rancher Object
    All definitions for using Rancher Labs integration
  • thirdPartiesIntegration.rancher.masterHost String
    Rancher master url. for example: http://myRancher.com:8080/v1
  • thirdPartiesIntegration.rancher.accessKey String
    Rancher API Access Key
  • thirdPartiesIntegration.rancher.secretKey String
    Rancher API Secret Key
Request

Headers
{  
   "Content-Type": "application/json",
   "Authorization": "Bearer ${token}" 
}
Body
Copied!
Downloaded!
{
  "group": {
    "name": "spotinst-group",
    "capacity": {
      "target": 2,
      "minimum": 2,
      "maximum": 10
    },
    "strategy": {
      "lowPriorityPercentage": 100,
      "drainingTimeout": 5,
      "signals": [
        {
          "name": "NODE_READY",
          "timeout": 100
        }
      ]
    },
    "scaling": {
      "up": [
        {
          "namespace": "AZURE/NODE",
          "metricName": "CPUUtilization",
          "statistic": "average",
          "unit": "percent",
          "threshold": 90,
          "dimensions": [
            {
              "name": "nodeId",
              "value": 1
            }
          ],
          "period": 300,
          "evaluationPeriods": 1,
          "cooldown": 300,
          "action": {
            "type": "percentageAdjustment",
            "adjustment": 20,
            "minTargetCapacity": 2,
            "target": 5,
            "minimum": 5,
            "maximum": 5
          },
          "operator": "minTargetCapacity"
        }
      ],
      "down": [
        {
          "namespace": "AZURE/NODE",
          "metricName": "CPUUtilization",
          "statistic": "average",
          "unit": "percent",
          "threshold": 90,
          "dimensions": [
            {
              "name": "nodeId",
              "value": 1
            }
          ],
          "period": 300,
          "evaluationPeriods": 1,
          "cooldown": 300,
          "action": {
            "type": "percentageAdjustment",
            "adjustment": 20,
            "minTargetCapacity": 2,
            "target": 5,
            "minimum": 5,
            "maximum": 5
          },
          "operator": "minTargetCapacity"
        }
      ]
    },
    "scheduling": {
      "tasks": [
        {
          "frequency": "hourly",
          "taskType": "scale"
        },
        {
          "taskType": "roll",
          "cronExpression": "00 17 * * 3",
          "batchSizePercentage": 30
        },
        {
          "taskType": "scale",
          "cronExpression": "00 22 * * 3",
          "scaleTargetCapcity": 0,
          "scaleMinCapcity": 0,
          "scaleMaxCapcity": 3
        }
      ]
    },
    "compute": {
      "vmSizes": {
        "dedicatedSizes": [
          "Standard_A1",
          "Standard_A2"
        ],
        "lowPrioritySizes": [
          "Standard_A1",
          "Standard_A2"
        ]
      },
      "region": "westus",
      "product": "Linux",
      "resourceGroupName": "name",
      "launchSpecification": {
        "loadBalancersConfig": {
          "loadBalancers": [
            {
              "targetSetId": "MLB target set Id",
              "balancerId": "MLB balancer Id"
            }
          ]
        },
        "health": {
          "healthCheckType": "MLB",
          "autoHealing": true,
          "gracePeriod": 5
        },
        "image": {
          "publisher": "Canonical",
          "offer": "Ubuntu Server",
          "sku": "16.04",
          "customImage": {
            "imageUris": [
              "vhd_uri"
            ]
          }
        },
        "userData": {
          "commandLine": "echo 5",
          "resourceFiles": [
            {
              "resourceFileUrl": "url",
              "resourceFileTargetPath": "targetPath"
            }
          ]
        },
        "network": {
          "virtualNetworkName": "vname",
          "subnetId": "id"
        },
        "sshPublicKey": "IyEvYmluL2Jhc2gNCnRvdWNoIHRlc3QuZmlsZQ==",
        "nodeUsers": [
          "dvir",
          "ohad"
        ],
        "dataDisks": [
          {
            "cachingType": "readOnly",
            "diskSize": 100,
            "index": 1,
            "storageAccountType": "Standard_LRS"
          },
          {
            "diskSize": 150,
            "index": 2
          }
        ]
      }
    }
  }
}
Response - 200

Headers
{  
  "Content-Type": "application/json" 
}
Body
Copied!
Downloaded!
{
  "status": {
     "code": 200,
     "message": "OK"
   },

 {
   "group": {
     "id": "sig-12345"
     "name": "spotinst-group",
     "capacity": {
       "target": 2,
       "minimum": 2,
       "maximum": 10
     },
     "strategy": {
       "lowPriorityPercentage": 100,
       "drainingTimeout": 5
     },
     "scaling": {
       "up": [
         {
           "namespace": "AZURE/NODE",
           "metricName": "CPUUtilization",
           "statistic": "average",
           "unit": "percent",
           "threshold": 90,
           "dimensions": [
             {
               "name": "nodeId"
               "value" : 1
             }
           ],
           "period": 300,
           "evaluationPeriods": 1,
           "cooldown": 300,
           "action": {
             "type": "percentageAdjustment",
             "adjustment": 20,
             "minTargetCapacity": 2,
             "target": 5,
             "minimum": 5,
             "maximum": 5
           },
           "operator": "minTargetCapacity"
         }
       ],
       "down": [
         {
           "namespace": "AZURE/NODE",
           "metricName": "CPUUtilization",
           "statistic": "average",
           "unit": "percent",
           "threshold": 90,
           "dimensions": [
             {
               "name": "nodeId"
               "value" : 1
             }
           ],
           "period": 300,
           "evaluationPeriods": 1,
           "cooldown": 300,
           "action": {
             "type": "percentageAdjustment",
             "adjustment": 20,
             "minTargetCapacity": 2,
             "target": 5,
             "minimum": 5,
             "maximum": 5
           },
           "operator": "minTargetCapacity"
         }
       ]
     },
     "scheduling": {
       "tasks": [
         {
           "frequency": "hourly",
           "taskType": "scale"
         },
         {
           "taskType": "roll",
           "cronExpression": "00 17 * * 3",
           "batchSizePercentage": 30
         },
         {
           "taskType": "scale",
           "cronExpression": "00 22 * * 3",
           "scaleTargetCapcity": 0,
           "scaleMinCapcity": 0,
           "scaleMaxCapcity": 3
         }
       ]
     },
     "compute": {
       "vmSizes": {
       "dedicatedSizes": [
           "Standard_A1",
           "Standard_A2"
         ],
         "lowPrioritySizes": [
          "Standard_A1",
           "Standard_A2"
         ]
       },
       "region": "westus",
       "product": "Linux",
       "resourceGroupName": "name",
       "launchSpecification": {
         "loadBalancersConfig": {
           "loadBalancers": [
             {
               "targetSetId": "MLB target set Id",
               "balancerId": "MLB balancer Id"
             }
           ]
         },
         "health":{
             "healthCheckType": "MLB",
             "autoHealing": true,
             "gracePeriod": 5
         }

         "image": : {
         "publisher": "Canonical",
         "offer": "Ubuntu Server",
         "sku": "16.04",
             "customImage": {
                     imageUris: [
                     "vhd_uri"
                     ]                    
             }
         },
         "userData": {
         "commandLine: "echo 5"
         "resourceFiles: [
             {
                 "resourceFileUrl": "url",
                 "resourceFileTargetPath": "targetPath"
             }
         ]
         },
         "network": {
             "virtualNetworkName": "vname",
             "subnetId": "id"
         },
         "sshPublicKey": "IyEvYmluL2Jhc2gNCnRvdWNoIHRlc3QuZmlsZQ=="
       }
     }
   }
 }
}