Skip to content

List Supported Droplet Backup Policies

client.GPUDroplets.Backups.ListSupportedPolicies(ctx) (*GPUDropletBackupListSupportedPoliciesResponse, error)
get/v2/droplets/backups/supported_policies

To retrieve a list of all supported Droplet backup policies, send a GET request to /v2/droplets/backups/supported_policies.

ReturnsExpand Collapse
type GPUDropletBackupListSupportedPoliciesResponse struct{…}
SupportedPolicies []GPUDropletBackupListSupportedPoliciesResponseSupportedPolicyoptional
Name stringoptional

The name of the Droplet backup plan.

PossibleDays []stringoptional

The day of the week the backup will occur.

PossibleWindowStarts []int64optional

An array of integers representing the hours of the day that a backup can start.

RetentionPeriodDays int64optional

The number of days that a backup will be kept.

WindowLengthHours int64optional

The number of hours that a backup window is open.

List Supported Droplet Backup Policies
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.Backups.ListSupportedPolicies(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.SupportedPolicies)
}
{
  "supported_policies": [
    {
      "name": "daily",
      "possible_days": [
        "SUN",
        "MON",
        "TUE",
        "WED",
        "THU",
        "FRI",
        "SAT"
      ],
      "possible_window_starts": [
        0,
        4,
        8,
        12,
        16,
        20
      ],
      "retention_period_days": 7,
      "window_length_hours": 4
    }
  ]
}
Returns Examples
{
  "supported_policies": [
    {
      "name": "daily",
      "possible_days": [
        "SUN",
        "MON",
        "TUE",
        "WED",
        "THU",
        "FRI",
        "SAT"
      ],
      "possible_window_starts": [
        0,
        4,
        8,
        12,
        16,
        20
      ],
      "retention_period_days": 7,
      "window_length_hours": 4
    }
  ]
}