I’ve been playing with the API and using DO as a Vagrant Provider, but I can’t seem to find a way to create a droplet from Ubuntu 14.04 x64 (curl -u {api-key} https://api.digitalocean.com/v2/images doesn’t include Ubuntu 14.04 in the list of available images). I also wondered if it’s possible to reference the “application” images DO provides in their web UI via the API (e.g., create a new image from their “Docker 1.0 on Ubuntu 14.04 x64” application instead of having to build it on your own).
Anyone have an example of creating an Ubuntu 14.04 x64 droplet using Vagrant? Or otherwise using the API that might help me figure out how to make it work through Vagrant?
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!
Both images are returned by the /images API call:
{
"id":3240036,
"name":"Ubuntu 14.04 x64",
"distribution":"Ubuntu",
"slug":"ubuntu-14-04-x64",
"public":true,
"regions":[
"nyc1",
"ams1",
"sfo1",
"nyc2",
"ams2",
"sgp1",
"lon1"
],
"created_at":"2014-04-18T15:59:36Z"
}
{
"id":4970653,
"name":"Docker 1.1.1 on Ubuntu 14.04",
"distribution":"Ubuntu",
"slug":null,
"public":true,
"regions":[
"nyc1",
"ams1",
"sfo1",
"nyc2",
"ams2",
"sgp1",
"lon1"
],
"created_at":"2014-07-16T20:00:38Z"
}
At the very bottom of the response there are pagination links (it might be different for your account depending on how many snapshots you have), so just keep changing the URL until you get the image you need:
"links":{
"pages":{
"last":"https://api.digitalocean.com/v2/images?page=3",
"next":"https://api.digitalocean.com/v2/images?page=2"
}
You’re most likely going to find the Docker image in the last page as it was just updated a few seconds ago. You can also use the image’s slug instead of its ID: ubuntu-14-04-x64.
P.S.: Since you’re using curl, you can use the Authorization header instead of HTTP basic auth:
curl -H "Authorization: Bearer token" https://api.digitalocean.com/v2/images
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.