Digitalocean api: Difference between revisions
From wikinotes
Line 34: | Line 34: | ||
export TOKEN=${YOUR_TOKEN} | export TOKEN=${YOUR_TOKEN} | ||
curl -X GET "https://api.digitalocean.com/v2/droplets" \ | curl -X GET "https://api.digitalocean.com/v2/droplets" \ | ||
-H "Authorization: Bearer $TOKEN" \ | |||
| jq | |||
</syntaxhighlight> | </syntaxhighlight> | ||
</blockquote><!-- Authentication --> | </blockquote><!-- Authentication --> |
Latest revision as of 03:22, 9 February 2022
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