creating a volume no longer returns a ruby object (now returns `nil`)
lkozloff opened this issue · 1 comments
Consider the following:
require 'droplet_kit'
token = 'MY-API-TOKEN'
vol = DropletKit::Volume.new(
size_gigabytes: 10,
name: 'make-a-test-volume',
region: 'ams3'
)
api = DropletKit::Client.new(access_token: token)
response = api.volumes.create(vol) #returns nil if successful... but we want it to return an object!
puts response.id
Up until ~ April 22nd 2018, the above worked and we got an object back with the id
of the created volume. Now we get nil
. (and the above code crashes)
However, running the same request against the API in curl
results in a nice response with all the info we might need.
Has something changed in the DO API that droplet_kit
can't parse the return?
Hi @lkozloff,
Thanks for flagging this for us. As you noticed in #147, this was due to the API returning a 200
on success rather than the documented 201
. This was an inadvertent change to our API that has now been reverted. We're committed to providing a stable API, I want to apologize for any inconvenience. If there ever arises a need for a breaking change, it will be communicated in advance as part of a deprecation process.
Our API changelog can be found here: https://developers.digitalocean.com/documentation/changelog/
Sorry again for the disruption to your work.