Digitalocean api

From wikinotes
Revision as of 03:22, 9 February 2022 by Will (talk | contribs) (→‎Authentication)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

digitalocean exposes an api to manipulate their droplets/services.

Documentation

API documentation https://docs.digitalocean.com/reference/api/

API Clients

python python-digitalocean

Authentication

You'll need a token before you can do anything.

digitalocean.com:
  API:
    tokens/keys:
      - Generate New Token
# list all droplets
export TOKEN=${YOUR_TOKEN}
curl -X GET "https://api.digitalocean.com/v2/droplets" \
  -H "Authorization: Bearer $TOKEN" \
  | jq