-
-
Save romain-dartigues/4d7e4edcb33ebd5ac988 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
echo '{' | |
for endpoint in sizes regions images ssh_keys; do | |
echo -n '"'$endpoint'": ' | |
curl -s "https://api.digitalocean.com/${endpoint}/?client_id=${DO_CLIENT_ID}&api_key=${DO_API_KEY}" | |
echo ',' | |
done | sed '$s/,$//' | |
echo '}' | |
} | python -mjson.tool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Like the original but does not require bash array and output a parsable JSON.