digitalocean/droplet_kit

Droplet locked property changed it's behaviour

Opened this issue · 1 comments

I've been using droplet object "locked" property to find out if I can make something with droplet, like detach volume, attach volume, etc. But since some time ago (autumn 2019 I guess) it's showing "false" value, even when it's restoring and if I try to, let's say, detach volume from it - It doesn't make it silently (but if I try to delete it - it throws error saying he can't delete such volume). I'm not struggling for locked itself, but it would be nice to have a way to check if I can or cannot do anything with a droplet. Thanks.

In case of someone will need it, got answer from DO:

I don't believe the "locked" property should apply to Droplets in the process of having an event run on them. This may have been past undocumented functionality, but the locked property is specifically for admin locks and shouldn't apply here.

Some context: we're undergoing a process to migrate our API to faster applications. This is to reduce strain on the backend by making the API more efficient as we continue to grow. The Droplet API was the first to be moved over, since it was the most system intensive endpoint. Since all functionality of this endpoint was implemented based on the documentation, a lot of bugs or undocumented functionality were removed.

Instead if you need to see if something is running on a Droplet, you'd need to use the actions endpoint (client.droplets.actions(id: 'id') in droplet_kit), check the latest action, and see if the "status" is "in-progress". This is documented here: https://developers.digitalocean.com/documentation/v2/#list-actions-for-a-droplet