Skip to content

List Associated Resources for a Droplet

client.GPUDroplets.DestroyWithAssociatedResources.List(ctx, dropletID) (*GPUDropletDestroyWithAssociatedResourceListResponse, error)
get/v2/droplets/{droplet_id}/destroy_with_associated_resources

To list the associated billable resources that can be destroyed along with a Droplet, send a GET request to the /v2/droplets/$DROPLET_ID/destroy_with_associated_resources endpoint.

This endpoint will only return resources that you are authorized to see. For example, to see associated Reserved IPs, include the reserved_ip:read scope.

The response will be a JSON object containing snapshots, volumes, and volume_snapshots keys. Each will be set to an array of objects containing information about the associated resources.

ParametersExpand Collapse
dropletID int64
minimum1
ReturnsExpand Collapse
type GPUDropletDestroyWithAssociatedResourceListResponse struct{…}
FloatingIPs []AssociatedResourceoptional

Floating IPs that are associated with this Droplet.
Requires reserved_ip:read scope.

ID stringoptional

The unique identifier for the resource associated with the Droplet.

Cost stringoptional

The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.

Name stringoptional

The name of the resource associated with the Droplet.

ReservedIPs []AssociatedResourceoptional

Reserved IPs that are associated with this Droplet.
Requires reserved_ip:read scope.

ID stringoptional

The unique identifier for the resource associated with the Droplet.

Cost stringoptional

The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.

Name stringoptional

The name of the resource associated with the Droplet.

Snapshots []AssociatedResourceoptional

Snapshots that are associated with this Droplet.
Requires image:read scope.

ID stringoptional

The unique identifier for the resource associated with the Droplet.

Cost stringoptional

The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.

Name stringoptional

The name of the resource associated with the Droplet.

VolumeSnapshots []AssociatedResourceoptional

Volume Snapshots that are associated with this Droplet.
Requires block_storage_snapshot:read scope.

ID stringoptional

The unique identifier for the resource associated with the Droplet.

Cost stringoptional

The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.

Name stringoptional

The name of the resource associated with the Droplet.

Volumes []AssociatedResourceoptional

Volumes that are associated with this Droplet.
Requires block_storage:read scope.

ID stringoptional

The unique identifier for the resource associated with the Droplet.

Cost stringoptional

The cost of the resource in USD per month if the resource is retained after the Droplet is destroyed.

Name stringoptional

The name of the resource associated with the Droplet.

List Associated Resources for a Droplet
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"),
  )
  destroyWithAssociatedResources, err := client.GPUDroplets.DestroyWithAssociatedResources.List(context.TODO(), int64(3164444))
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", destroyWithAssociatedResources.FloatingIPs)
}
{
  "floating_ips": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ],
  "reserved_ips": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ],
  "snapshots": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ],
  "volume_snapshots": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ],
  "volumes": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ]
}
Returns Examples
{
  "floating_ips": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ],
  "reserved_ips": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ],
  "snapshots": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ],
  "volume_snapshots": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ],
  "volumes": [
    {
      "id": "61486916",
      "cost": "0.05",
      "name": "ubuntu-s-1vcpu-1gb-nyc1-01-1585758823330"
    }
  ]
}