pydo.kubernetes.get_available_upgrades()

Description

To determine whether a cluster can be upgraded, and the versions to which it can be upgraded, send a GET request to /v2/kubernetes/clusters/$K8S_CLUSTER_ID/upgrades.

Parameters

Name Type Required Description Default Value
cluster_id string True A unique ID that can be used to reference a Kubernetes cluster.

Request Sample

import os
from pydo import Client

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

resp = client.kubernetes.get_available_upgrades(cluster_id="da8fda8")

Responses

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

The response will be a JSON object with a key called available_upgrade_versions. The value of this will be an array of objects, representing the upgrade versions currently available for this cluster.

If the cluster is up-to-date (i.e. there are no upgrades currently available) available_upgrade_versions will be null.

Click to expand an example response.
{
  "available_upgrade_versions": [
    {
      "slug": "1.16.13-do.0",
      "kubernetes_version": "1.16.13",
      "supported_features": [
        "cluster-autoscaler",
        "docr-integration",
        "token-authentication"
      ]
    },
    {
      "slug": "1.16.13-do.0",
      "kubernetes_version": "1.16.13",
      "supported_features": [
        "cluster-autoscaler",
        "docr-integration",
        "token-authentication"
      ]
    }
  ]
}

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"
}