unable to client.droplets.deleteByTag
Hi, I've used this package for years and I love it. Recently, however, it appears that client.droplets.deleteByTag() doesn't work. When I put a debug statement (console.log) in client.js, in _makeRequestWithBody, I can see that it builds this object: { uri: 'https://api.digitalocean.com/v2/droplets', method: 'DELETE', headers: { Authorization: 'Bearer bla bla bla' }, body: '{"tag_name":"GH"}' }
In the DigitalOcean API docs I see: To delete Droplets by a tag (for example awesome), send a DELETE request to v2/droplets?tag_name=$TAG_NAME.
So, If I understand the DigitalOcean API correctly, I think the tag_name needs to be part of the URI, not part of the body. However, I'm not sure how to correct this. Thanks.
Interesting - maybe they changed things so that bodies in DELETEs are no longer valid. We’d need to update the params passed to makeRequestWithBody from deleteByTag.
On Mon, Mar 2, 2020 at 8:41 AM Ronald Perrella [email protected] wrote:
Hi, I've used this package for years and I love it. Recently, however, it appears that client.droplets.deleteByTag() doesn't work. When I put a debug statement (console.log) in client.js, In _makeRequestWithBody, I can see that it builds this object: { uri: 'https://api.digitalocean.com/v2/droplets', method: 'DELETE', headers: { Authorization: 'Bearer bla bla bla' }, body: '{"tag_name":"GH"}' }
If I understand the DigitalOcean API correctly, I think the tag_name needs to be part of the URI, not part of the body. However, I'm not sure how to correct this. Thanks.
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/phillbaker/digitalocean-node/issues/34?email_source=notifications&email_token=AAAXCKJA3QPFIEE26QTMGN3RFOZPXA5CNFSM4K7UQA7KYY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IRWI34Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAXCKLMRJHUQBRE6HWX4BTRFOZPXANCNFSM4K7UQA7A .
I don't call this API very often but it certainly used to work (say, a year ago?)
Sorry my bad - closed accidentally.
Do you accept PRs?
Do you accept PRs?
Yup!