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

Apply a Detach action to a deployment.

URL Parameters

Parameter Type Description
GROUP_ID * String

The Elastigroup ID you want to deploy

Example: sig-12345
ROLL_ID * String

The deployment id you want to stop

Example: sbgd-9876
ACCOUNT_ID String

Your Spotinst accountId associated with your token

Example: act-123abc

Body Attributes


Attribute Type Description
actionType * String

Sets the action that will take place, Accepted values are: DETACH_OLD, DETACH_NEW

shouldHandleAllBatches Boolean

Indicator if the action should apply to all batches of the deployment or only the latest batch

Default: false
drainingTimeout Integer

Indicates (in seconds) the timeout to wait until instance are detached

Default: The Elastigroups draining time out
shouldDecrementTargetCapacity Boolean

Decrementing the group target capacity after detaching the instances

Default: true
Request

Headers
{
    "Content-Type": "application/json",
    "Authorization": "Bearer ${token}"
}
Body
Copied!
Downloaded!
{
  "actionType": "DETACH_NEW",
  "shouldHandleAllBatches": "true",
  "drainingTimeout": "600",
  "shouldDecrementTargetCapacity": "true"
}
Response - 200

Headers
{
    "Content-Type": "application/json"
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "9ea37b98-32f7-48ea-8ec3-14e3f396e50e",
    "url": "/aws/ec2/group/sig-1b656b92/roll/sbgd-aafb7671/action",
    "method": "POST",
    "timestamp": "2017-04-02T11:09:40.652Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:aws:ec2:group:roll:action",
    "items": [
      {
        "groupId": "sig-1b656b92",
        "rollId": "sbgd-aafb7671",
        "actionType": "DETACH_NEW",
        "detachedInstances": [
          "i-0b6974ad592f8d9ba"
        ]
      }
    ],
    "count": 1
  }
}