Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pagination of API requests #128

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Pagination of API requests #128

wants to merge 1 commit into from

Conversation

jasites
Copy link
Contributor

@jasites jasites commented Jul 19, 2024

Description

Create a wrapper around vultr_v2.api_query that handles pagination

Related Issues

Fixes #127

Checklist:

  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?
  • Have you linted your code locally prior to submission?
  • Have you successfully ran tests with your changes locally?

@resmo : I'm going to run the integration tests against my account and verify everything works there, but review / feedback is greatly appreciated, since I haven't had a chance to verify the behavior with all services yet and the different vultr_v2.query* functions.

@resmo resmo self-requested a review July 29, 2024 16:58
description:
- When receiving large numbers of resources, specify how many results should be returned per call to API.
- This does not determine how many results are returned; all resources are returned according to other filters.
- Vultr API maximum is 500.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this maximum per page?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

- Vultr API maximum is 500.
- Fallback environment variable C(VULTR_API_RESULTS_PER_PAGE).
type: int
default: 100
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we want this in the next release, so you may add the version, when it is going to be added

  default: 100
+ version_added: 1.14.0

Copy link
Collaborator

@resmo resmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good code wise

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] - Support pagination of API requests
2 participants