digitalocean/droplet_kit

Droplet volumes nil

Opened this issue · 3 comments

While trying to get droplet volumes like this:

client = DropletKit::Client.new(access_token: '<TOKEN>')
volumes = client.droplets.find(id: '<DROPLET_ID>').volumes

I get nil, even if droplet has attached volumes. Checked with doctl - it shows volumes fine, so I think it's not API issue.

Is the problem still occurring?

Yes it is. I found another way of getting volumes and it works well:

client = DropletKit::Client.new(access_token: '<TOKEN>')
volumes = client.volumes.all().find_all { | v | v.droplet_ids.any? { |did| did == '<DROPLET_ID>' } }.to_a