droplet_kit
droplet_kit copied to clipboard
Document how to use image_id: vs image: for Droplet.new()
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.
To clarify, image_id did work right? You're just looking for better documentation?
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.
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
I'm guessing no slugs are created by default for snapshot / application images.
Application images should also have slugs.
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?
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.