droplet_kit icon indicating copy to clipboard operation
droplet_kit copied to clipboard

Document how to use image_id: vs image: for Droplet.new()

Open hh opened this issue 10 years ago • 7 comments
trafficstars

I'm not sure where the names come from for calls to Droplet.new(name:) when I want to specify my own images.

I ended up using the image_id: in the name: parameter to accomplish what I wanted, but it was confusing.

hh avatar Mar 03 '15 17:03 hh

To clarify, image_id did work right? You're just looking for better documentation?

bobbytables avatar Mar 03 '15 17:03 bobbytables

It's the image: parameter, which get's fed from apps using the library (like test-kitchen). Knowing how name names map to image id's would be great.

hh avatar Mar 03 '15 17:03 hh

Yeah, right now the best way to see slugs is to retrieve only distribution images from /images

https://developers.digitalocean.com/documentation/v2/#list-all-distribution-images

bobbytables avatar Mar 03 '15 17:03 bobbytables

I'm guessing no slugs are created by default for snapshot / application images.

hh avatar Mar 03 '15 18:03 hh

Application images should also have slugs.

bobbytables avatar Mar 03 '15 19:03 bobbytables

How do I actually do this with DropletKit, see the image ids? What's the magic spell? I see the api documentation link, but that doesn't tell me how to actually do it with the ruby gem. I don't understand why this is so hard. Do I really need to go figure out how to do it with curl before I can figure out how to do it with the gem? What's the point then of maintaining the gem?

Would it be too hard to just add a endpoint or something that doesn't require a bunch of auth just to get this basic usage info?

VinceG3 avatar May 31 '17 03:05 VinceG3

This is the magic spell for anyone else coming across this:

client.images.all.each{|i| puts "#{i.id}: #{i.distribution} #{i.name}" }

The gem specifies that the returns are POROs but the return from the .all method doesn't give a hint as to how to get at those POROs.

VinceG3 avatar May 31 '17 13:05 VinceG3