Skip to content

List All Available Kernels for a Droplet

client.GPUDroplets.ListKernels(ctx, dropletID, query) (*GPUDropletListKernelsResponse, error)
get/v2/droplets/{droplet_id}/kernels

To retrieve a list of all kernels available to a Droplet, send a GET request to /v2/droplets/$DROPLET_ID/kernels

The response will be a JSON object that has a key called kernels. This will be set to an array of kernel objects, each of which contain the standard kernel attributes.

ParametersExpand Collapse
dropletID int64
minimum1
query GPUDropletListKernelsParams
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 GPUDropletListKernelsResponse struct{…}

Information about the response itself.

Total int64optional

Number of objects returned by the request.

Kernels []Kerneloptional
ID int64optional

A unique number used to identify and reference a specific kernel.

Name stringoptional

The display name of the kernel. This is shown in the web UI and is generally a descriptive title for the kernel in question.

Version stringoptional

A standard kernel version string representing the version, patch, and release information.

Accepts one of the following:
List All Available Kernels 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"),
  )
  response, err := client.GPUDroplets.ListKernels(
    context.TODO(),
    int64(3164444),
    gradient.GPUDropletListKernelsParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.Meta)
}
{
  "meta": {
    "total": 1
  },
  "kernels": [
    {
      "id": 7515,
      "name": "DigitalOcean GrubLoader v0.2 (20160714)",
      "version": "2016.07.13-DigitalOcean_loader_Ubuntu"
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images?page=2",
      "next": "https://api.digitalocean.com/v2/images?page=2"
    }
  }
}
Returns Examples
{
  "meta": {
    "total": 1
  },
  "kernels": [
    {
      "id": 7515,
      "name": "DigitalOcean GrubLoader v0.2 (20160714)",
      "version": "2016.07.13-DigitalOcean_loader_Ubuntu"
    }
  ],
  "links": {
    "pages": {
      "last": "https://api.digitalocean.com/v2/images?page=2",
      "next": "https://api.digitalocean.com/v2/images?page=2"
    }
  }
}