fbpx
PUThttps://api.spotinst.io/gcp/gce/group/{GROUP_ID}/detachInstances?accountId={ACCOUNT_ID}

Detach instances from your Elastigroup

URL Parameters

Parameter Type Description
GROUP_ID * String

The group ID you want to detach instances from

Example: sig-98765
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!
{
  "instancesToDetach": [
    "sin-44c02836",
    "sin-ddf71dfa"
  ],
  "shouldTerminateInstances": true,
  "shouldDecrementTargetCapacity": false,
  "drainingTimeout": 300
}

Body Attributes


Attribute Type Description
instancesToDetach * Array<String>

The names of the instances to detach from the group

shouldTerminateInstances Boolean

Indicates whether to terminate the instances or not.

Default: true
shouldDecrementTargetCapacity Boolean

Indicates whether to terminate the instances or not. Default

Default: true
shouldTerminateInstances Boolean

Indicates whether to decrement the capacity of the group, so no new instance will be launched instead of the detached one.

Default: false
drainingTimeout Integer

The draining timeout (in seconds) before terminating the instance (In case the shouldTerminateInstances is on) If no draining timeout is defined, the group’s draining timeout will be used.

Response - 200

Headers
{
  	"Content-Type" : "application/json"
}
Body
Copied!
Downloaded!
{
  "request": {
    "id": "3213e42e-455e-4901-a185-cc3eb65fac5f",
    "url": "/gcp/gce/group/sig-98765/detachInstances",
    "method": "PUT",
    "time": "2015-06-28T15:49:11.911Z"
  },
  "response": {
    "status": {
      "code": 200,
      "message": "OK"
    },
    "kind": "spotinst:gcp:gce:detachInstances"
  }
}