Allow using pagination#98
Merged
claudiubelu merged 7 commits intocloudbase:masterfrom May 6, 2026
Merged
Conversation
At the moment, listing endpoint instances is the only Coriolis API that supports pagination. For this reason, Coriolis clients often retrieve much more database records than needed, leading to poor performance. For this reason, we're now adding pagination to other Coriolis APIs, starting with the transfer executions. A transfer can have a large amount of executions, especially in case of cron jobs. New optional parameters: * limit - the maximum number of entries to retrieve * marker - the last seen id, will not be retrieved again The pagination will be performed on the db API side, leveraging the "utils.paginate_query" helper from oslo_db.
Python 3.9 does not support modern type hints. It's no longer supported by coriolis-core, as such we'll drop it from the python-coriolisclient pipeline.
7759d9b to
e44ee96
Compare
Member
Author
|
This implies that we'll have two sort parameters, one for the db side sort and pagination and another one for the standard client side sorting: |
claudiubelu
reviewed
May 6, 2026
claudiubelu
reviewed
May 6, 2026
| query={ | ||
| "some_filter": "some_value", | ||
| "some_other_filter": "some_other_value" | ||
| } |
Member
There was a problem hiding this comment.
nit: query should be a list, not a dict, as seen in the test below, and in the calls in the tests above. It has to be a list because the same key can be specified multiple times.
Member
Author
There was a problem hiding this comment.
urlparse.urlencode accepts both, which is why _list does the same:
def _list(self, url, response_key=None, obj_class=None, json=None,
values_key='values', query: dict | list | None = None):
test_list_with_dict_query covers dict query params, test_list_with_tuple_list_query handles lists of tuples.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
At the moment, listing endpoint instances is the only Coriolis API that supports pagination. For this reason, Coriolis clients often retrieve much more database records than needed, leading to poor performance.
We're now adding pagination to other Coriolis APIs:
New optional parameters:
sort_key- sort key, repeatable.created_atandidare used by default.sort_dir- sort direction, repeatable.ascordesc(default).marker- the last seen ID, omitted from the results.limit- the maximum number of records to retrieve.Example: