Comments (8)
I set the per_page to PHP_INT_MAX
so we can get all the possible values with just one request otherwise which is cheaper than going page by page. the instances where pagination would break is when someone have a large amount of data but I'm not sure you can get more than a few dozens of Kb... nevertheless we would still need to implement pagination. do you have any suggestions on how to tackle it ?
from client.
That's one of the things i'm having trouble with in my packages too. :/
from client.
I'm going to take a look at how the aws sdk for php does it.
from client.
Since you're using guzzle 3, you can do the same as the aws sdk does, and use: https://github.com/guzzle/service/blob/master/Resource/ResourceIterator.php. I'm using guzzle 4 for my problem though. :/
from client.
I see it is using a static 200 now, but the actual page is not being specific, limiting users to 200 droplets. Should a page parameter be added to droplet getAll?
from client.
Does this issue apply anymore? The $per_page
and $page
variables exist for the getAll function.
from client.
The issue was rather about automatic pagination, so we could get all, and then the library would iterate over all the pages for us.
from client.
This issue appears to still be under discussion, so I thought I'd add some more info.
When querying https://api.digitalocean.com/v2/droplets
, the DigitalOcean API returns a meta
object with total
key.
Retaining this meta value at the end of the getAll()
request would make paginating the API much easier with this library and the package @GrahamCampbell developed (https://github.com/GrahamCampbell/Laravel-DigitalOcean).
If anyone has suggestions for paginating the API rather than setting a high $per_page
variable, I'm all 👂.
from client.
Related Issues (20)
- Add support for monitoring API HOT 4
- `Entity\Droplet::tags` incorrectly type-hinted as `Tag[]` HOT 2
- Api\Image::getById() accepts only int, should accept int|string HOT 2
- Ubuntu 20.04 composer install fail HOT 1
- Meta.php Entity class, what is it for? HOT 1
- PHP 7.4 requirement HOT 5
- Add support for Project Resources API HOT 2
- dropletClient->getAll return empty array HOT 2
- Project Resources API HOT 1
- "Floating IPs" have been renamed to "Reserved IPs" HOT 3
- Sizes API defaults to 20 per page and getAll doesn't page HOT 2
- Calling update() may result in data loss HOT 2
- Droplet entity missing VPC UUID property HOT 1
- Kubernetes support? HOT 2
- Uptime Checks HOT 2
- package laravel not found HOT 1
- Fetch IP address of Droplet HOT 1
- Does this library capture the HTTP response code and make that available? HOT 2
- Please remove "final" keyword from ExceptionThrower to allow extending this class. HOT 2
- No confirmation that droplet was successfully removed
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from client.