By Raj
We have a working ansible script which we use to configure a droplet after it is manually provisioned.
We are now planning to ditch manual process and automate creation and destruction of do instances using a python script. This is the workflow I have in mind.
The idea is to have fully automatic creation of instances, from a python script, with all software installed and all configuration done.
My question is how to do the step 3?
Thanks
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,
Can you please clarify on what changes exactly do you need to make?
Here’s the documentation regarding the Snapshots API functionality:
https://developers.digitalocean.com/documentation/v2/#snapshots
For example if you would like to create a volume snapshot you could just use this curl request:
curl -X POST -H 'Content-Type: application/json' -H 'Authorization: Bearer b7d03a6947b217efb6f3ec3bd3504582' -d '{"name":"big-data-snapshot1475261774", "tags":["aninterestingtag"]}' "https://api.digitalocean.com/v2/volumes/82a48a18-873f-11e6-96bf-000f53315a41/snapshots"
The output that you would get should look something like this:
{
"snapshot": {
"id": "8fa70202-873f-11e6-8b68-000f533176b1",
"name": "big-data-snapshot1475261774",
"regions": [
"nyc1"
],
"created_at": "2016-09-30T18:56:14Z",
"resource_id": "82a48a18-873f-11e6-96bf-000f53315a41",
"resource_type": "volume",
"min_disk_size": 10,
"size_gigabytes": 0,
"tags": [
"aninterestingtag"
]
}
}
Hope that this helps! Bobby
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.