Digitalocean api: Difference between revisions
From wikinotes
No edit summary |
|||
(One intermediate revision by the same user not shown) | |||
Line 28: | Line 28: | ||
tokens/keys: | tokens/keys: | ||
- Generate New Token | - Generate New Token | ||
</syntaxhighlight> | |||
<syntaxhighlight lang="bash"> | |||
# list all droplets | |||
export TOKEN=${YOUR_TOKEN} | |||
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