pydo.ssh_keys.list()

Description

To list all of the keys in your account, send a GET request to /v2/account/keys. The response will be a JSON object with a key set to ssh_keys. The value of this will be an array of ssh_key objects, each of which contains the standard ssh_key attributes.

Parameters

Name Type Required Description Default Value
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.ssh_keys.list()

Responses

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

A JSON object with the key set to ssh_keys. The value is an array of ssh_key objects, each of which contains the standard ssh_key attributes.

Click to expand an example response.
{
  "ssh_keys": [
    {
      "id": 289794,
      "fingerprint": "3b:16:e4:bf:8b:00:8b:b8:59:8c:a9:d3:f0:19:fa:45",
      "public_key": "ssh-rsa ANOTHEREXAMPLEaC1yc2EAAAADAQABAAAAQQDDHr/jh2Jy4yALcK4JyWbVkPRaWmhck3IgCoeOO3z1e2dBowLh64QAM+Qb72pxekALga2oi4GvT+TlWNhzPH4V anotherexample",
      "name": "Other Public Key"
    }
  ],
  "links": {},
  "meta": {
    "total": 1
  }
}

Unauthorized

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

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