pydo.droplets.list_kernels()

Description

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.

Parameters

Name Type Required Description Default Value
droplet_id integer True A unique identifier for a Droplet instance.
per_page integer False Number of items returned per page 20
page integer False Which ‘page’ of paginated results to return. 1

Request Sample

import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

resp = client.droplets.list_kernels(droplet_id=594828)

Responses

See the API spec for this endpoint to view additional detail on responses, headers, parameters, and more.

A JSON object that has a key called kernels.

Click to expand an example response.
{
  "kernels": [
    {
      "id": 7515,
      "name": "DigitalOcean GrubLoader v0.2 (20160714)",
      "version": "2016.07.13-DigitalOcean_loader_Ubuntu"
    }
  ],
  "links": {
    "pages": {
      "next": "https://api.digitalocean.com/v2/droplets/3164444/kernels?page=2&per_page=1",
      "last": "https://api.digitalocean.com/v2/droplets/3164444/kernels?page=171&per_page=1"
    }
  },
  "meta": {
    "total": 171
  }
}

Unauthorized

Click to expand an example response.
{
  "id": "unauthorized",
  "message": "Unable to authenticate you."
}

The resource was not found.

Click to expand an example response.
{
  "id": "not_found",
  "message": "The resource you requested could not be found."
}

API Rate limit exceeded

Click to expand an example response.
{
  "id": "too_many_requests",
  "message": "API Rate limit exceeded."
}

Server error.

Click to expand an example response.
{
  "id": "server_error",
  "message": "Unexpected server-side error"
}

Unexpected error

Click to expand an example response.
{
  "id": "example_error",
  "message": "some error message"
}