By yaz
Hello I am looking for a bash script that allows me to resize the droplet and start it after the operation is finished. I was able to handle the resize with API using curl in my bash script
curl -X POST -H 'Content-Type: application/json' \
-H 'Authorization: Bearer EXAMPLE947b217efb6f3ec3bdEXAMPLE' \
-d '{"type":"resize","size":"s-2vcpu-4gb"}' \
"https://api.digitalocean.com/v2/droplets/droplet_id/actions"
but seems that turning on the droplet is not done automatically after the action is finished
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello,
You can check the API Documentation for Turning ON a droplet:
https://developers.digitalocean.com/documentation/v2/#power-on-a-droplet
A curl example is the following snippet:
- curl -X POST -H "Content-Type: application/json" -H "Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582" -d '{"type":"power_on"}' "https://api.digitalocean.com/v2/droplets/3164450/actions"
Regards, Alex
Hi @yaz1979,
In my experience, you can use one of the following
Or better yet, this one:
I would suggest the latter would be a better option - Retrieve an Existing Volume Action
You can read more about them here:
* [List All Actions for a Volume-
API](https://developers.digitalocean.com/documentation/v2/#list-all-actions-for-a-volume)
* [Retrieve an Existing Volume Action - API](https://developers.digitalocean.com/documentation/v2/#retrieve-an-existing-volume-action)
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.