Comments (7)
Hi Dustin!
The documented max may not currently be enforced, but it will be in the near future. Consider the "limit" parameter a request, but the server may decide to return whatever number of results it wants.
The returned JSON result includes a "next_offset" value that tells you what is the next offset you should use to continue paging through the results.
The current python client library doesn't help much with this, but we'll be updating it to do that soon. It is probably easiest to wait for that update.
from duo_client_python.
Hi again,
Just had a quick question that is probably stupidly obvious. I noticed you just updated the 'admin.py' to include the offset and limit parameters. I was wondering if those changes will be reflected soon when I install the module in Python using the "python -m pip install duo_client" command. Right now I can get it working by manually installing the python file and creating the pyc for it.
Thank you,
Dustin
from duo_client_python.
Hi Dustin,
I may have a misunderstanding, but I believe that
python -m pip install duo_client
is pulling from https://pypi.org/project/duo_client/
We haven't updated duo_client hosted there just yet because we're waiting to get a couple more pagination pull requests in. We'll tag a release and update pypi hopefully sometime next week.
from duo_client_python.
Forgive me to adding to this topic, but when pagination is required, will the client automatically send another get_users call with the next_offset parameter, or will we need to manually call get_users each time until we no longer see next_offset in the JSON result?
from duo_client_python.
Hi!
So the way we've designed this feature is to allow you to have it both ways. If you want us to handle the pagination for you then we will. If you want to handle pagination yourself then we let you do that too.
If you want us to handle pagination on, let's say, the get_users()
call then what you'll want to do is call get_users()
with no arguments. This will automatically do all the pagination and give you the result.
If you want more fine grain control then you can pass in a limit and an offset as arguments to get_users. get_users(limit=100, offset=200)
This will only return the 100 users starting at offset 200.
Does that make sense?
from duo_client_python.
Yes, that answers my question perfectly. I would appreciate the option to make one call and have the pagination automatically taken care of, in addition to having manual control. Thank you!
from duo_client_python.
Duo Client Python 4.1.0 is released and can be imported via pip! Also the Duo API will now properly respect pagination args.
Closing out this issue now. Thanks for using Duo!
https://pypi.org/project/duo-client/4.1.0/
from duo_client_python.
Related Issues (20)
- Add Support Create Integration for SSO type HOT 5
- Update Admin cannot update the status HOT 1
- Deprecated SSL protocol in CertValidatingHTTPSConnection HOT 4
- Interators not working due to not having metadata populated HOT 5
- 403 Forbidden Access on all methods of Admin API HOT 6
- Duo: no library to generate passcodes HOT 4
- get_authentication_log - api:v2 param filter failing HOT 4
- metadata parse error in add_user_phone HOT 4
- Automatic proxy configuration HOT 2
- get_authentication_log clearing out Params HOT 3
- Add Get User by Email HOT 1
- 400 Bad Request response when trying to add a token for a yubikey HOT 1
- Duo client installed via pip is missing the get_users_by_names func HOT 3
- Getting "Received 429 Too Many Requests" for auth logs even if hitting the API in 6-7 minute intervals
- Getting 40103 on making GET REST API calls HOT 5
- Tests are failing because actual requests are being made HOT 1
- How to use duo_client_python to access an integrations secret key? HOT 2
- next_offset pagination in auth logs HOT 12
- add get auth summary endpoint to the admin object
- bad link in READ.me
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 duo_client_python.