fbpx
PUThttps://api.spotinst.io/aws/ec2/group/{GROUP_ID}/roll?accountId={ACCOUNT_ID}

Deploy your Elastigroup (triggers Blue/Green Deployment that replaces the existing instances in the Elastigroup)

URL Parameters

ParameterTypeDescription
GROUP_ID * String

The Elastigroup ID you want to deploy

Example: sig-12345
ACCOUNT_ID String

Your Spotinst accountId associated with your token

Example: act-123abc

Body Attributes


  • batchSizePercentage * Integer
    Indicates (in percentage) the batch size of the deployment (meaning, how many instances to replace in each batch)
  • gracePeriod * Integer
    Indicates (in seconds) the timeout to wait until instance become healthy in the ELB
  • healthCheckType String
    Define a health check type. valid values: ELB, ECS_CLUSTER_INSTANCE, TARGET_GROUP, OPSWORKS, NOMAD_NODE, MULTAI_TARGET_SET, HCS, EC2, NONE (wait the entire grace period for each batch). If no value is set the roll will use the group’s auto-healing health check.
  • strategy Object
    The roll strategy
  • strategy.action String
    The roll action to perform. valid values: REPLACE_SERVER, RESTART_SERVER
    Default: REPLACE_SERVER
  • strategy.batchMinHealthyPercentage Integer
    Indicates the threshold of minimum healthy instances in single batch. If the amount of healthy instances in single batch is under the threshold, the deployment will fail. If exists, the parameter value will be in range of 0-100. In case of null as value, the default value in the backend will be 50%. Value of param should represent the number in percentage (%) of the batch.
    Default: 50
Request

Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "batchSizePercentage": 20,
  "gracePeriod": 300,
  "healthCheckType": "EC2",
  "strategy": {
    "action": "REPLACE_SERVER",
    "batchMinHealthyPercentage":25
  }
}
Response - 200

Headers
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
    "request": {
        "id": "421c3735-db15-44c9-a659-e830eb2a08de",
        "url": "/aws/ec2/group/sig-12345/roll?accountId=act-123456",
        "method": "PUT",
        "timestamp": "2018-03-27T19:35:40.967Z"
    },
    "response": {
        "status": {
            "code": 200,
            "message": "OK"
        },
        "kind": "spotinst:aws:ec2:group:roll",
        "items": [
            {
                "id": "sbgd-3ee19606",
                "status": "STARTING",
                "currentBatch": 1,
                "numOfBatches": 1,
                "progress": {
                    "unit": "percentage",
                    "value": 0
                }
            }
        ],
        "count": 1
    }
}
Response - 400 - Roll is running, cannot start deployment

Body
Copied!
Downloaded!
{
    "request": {
        "id": "ea86585f-cebf-42e1-b6d7-b95beeacd693",
        "url": "/aws/ec2/group/oesg-4ea3f65a/deployment?spotinstAccountId=act-7461862f",
        "method": "POST",
        "timestamp": "2019-06-27T11:06:47.335Z"
    },
    "response": {
        "status": {
            "code": 400,
            "message": "Bad Request"
        },
        "errors": [
            {
                "code": "CLUSTER_ROLL_ALREADY_IN_PROGRESS",
                "message": "A Cluster roll is currently running in this group. Please wait until it completes before starting a deployment."
            }
        ],
        "count": 1
    }
}