Skip to content

List history events

client.GPUDroplets.Autoscale.ListHistory(ctx, autoscalePoolID, query) (*GPUDropletAutoscaleListHistoryResponse, error)
get/v2/droplets/autoscale/{autoscale_pool_id}/history

To list all of the scaling history events of an autoscale pool, send a GET request to /v2/droplets/autoscale/$AUTOSCALE_POOL_ID/history.

The response body will be a JSON object with a key of history. This will be set to an array containing objects each representing a history event.

ParametersExpand Collapse
autoscalePoolID string
query GPUDropletAutoscaleListHistoryParams
Page param.Field[int64]optional

Which 'page' of paginated results to return.

minimum1
PerPage param.Field[int64]optional

Number of items returned per page

minimum1
maximum200
ReturnsExpand Collapse
type GPUDropletAutoscaleListHistoryResponse struct{…}

Information about the response itself.

Total int64optional

Number of objects returned by the request.

History []GPUDropletAutoscaleListHistoryResponseHistoryoptional
CreatedAt Time

The creation time of the history event in ISO8601 combined date and time format.

formatdate-time
CurrentInstanceCount int64

The current number of Droplets in the autoscale pool.

DesiredInstanceCount int64

The target number of Droplets for the autoscale pool after the scaling event.

HistoryEventID string

The unique identifier of the history event.

Reason GPUDropletAutoscaleListHistoryResponseHistoryReason

The reason for the scaling event.

Accepts one of the following:
const GPUDropletAutoscaleListHistoryResponseHistoryReasonConfigurationChange GPUDropletAutoscaleListHistoryResponseHistoryReason = "CONFIGURATION_CHANGE"
const GPUDropletAutoscaleListHistoryResponseHistoryReasonScaleUp GPUDropletAutoscaleListHistoryResponseHistoryReason = "SCALE_UP"
const GPUDropletAutoscaleListHistoryResponseHistoryReasonScaleDown GPUDropletAutoscaleListHistoryResponseHistoryReason = "SCALE_DOWN"
Status GPUDropletAutoscaleListHistoryResponseHistoryStatus

The status of the scaling event.

Accepts one of the following:
const GPUDropletAutoscaleListHistoryResponseHistoryStatusInProgress GPUDropletAutoscaleListHistoryResponseHistoryStatus = "in_progress"
const GPUDropletAutoscaleListHistoryResponseHistoryStatusSuccess GPUDropletAutoscaleListHistoryResponseHistoryStatus = "success"
const GPUDropletAutoscaleListHistoryResponseHistoryStatusError GPUDropletAutoscaleListHistoryResponseHistoryStatus = "error"
UpdatedAt Time

The last updated time of the history event in ISO8601 combined date and time format.

formatdate-time
Accepts one of the following:
List history events
package main

import (
  "context"
  "fmt"

  "github.com/stainless-sdks/-go"
  "github.com/stainless-sdks/-go/option"
)

func main() {
  client := gradient.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  response, err := client.GPUDroplets.Autoscale.ListHistory(
    context.TODO(),
    "0d3db13e-a604-4944-9827-7ec2642d32ac",
    gradient.GPUDropletAutoscaleListHistoryParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "history": [
    {
      "history_event_id": "01936530-4471-7b86-9634-32d8fcfecbc6",
      "current_instance_count": 2,
      "desired_instance_count": 2,
      "reason": "CONFIGURATION_CHANGE",
      "status": "success",
      "created_at": "2020-11-19T20:27:18Z",
      "updated_at": "2020-12-01T00:42:16Z"
    }
  ],
  "links": {
    "pages": null
  },
  "meta": {
    "total": 1
  }
}
Returns Examples
{
  "history": [
    {
      "history_event_id": "01936530-4471-7b86-9634-32d8fcfecbc6",
      "current_instance_count": 2,
      "desired_instance_count": 2,
      "reason": "CONFIGURATION_CHANGE",
      "status": "success",
      "created_at": "2020-11-19T20:27:18Z",
      "updated_at": "2020-12-01T00:42:16Z"
    }
  ],
  "links": {
    "pages": null
  },
  "meta": {
    "total": 1
  }
}