Closed rhartkopf closed 8 years ago
You are correct - let me see how we could implement that.
Would love to see this fixed too. Anyone using the DO dynamic inventory plugin for ansible are getting hit by this bug.
For anyone waiting for a fix who just wants to get this working, I just modified the flags in /usr/local/lib/python2.7/dist-packages/dopy/manager.py to return the max results:
29 def all_active_droplets(self):
30 json = self.request('/droplets?per_page=200')
This will be overwritten by pip at the next upgrade, so it's not a permanent solution by any means.
DigitalOcean paginates their results, returning a default of 20 and max of 200 entries. When requesting a list of my 48 droplets, only 20 are returned. I have only confirmed this with droplet requests, but I'm sure it affects others as well.
https://developers.digitalocean.com/documentation/changelog/api-v2/tweak-per-page/
Here is an example of curl requests against the API with and without the per_page option:
I'm a python novice but am doing some testing to see if I can implement this.