You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm requesting sth, that returns more than 100 results. eg: tc.vcs_root_api.get_roots()
This obviously returns a paginated result, as also the next_href etc is set.
From the docs it's unclear to me how to access the next pages of the result. Could you maybe give a hint what the right way would be todo this?
The text was updated successfully, but these errors were encountered:
ah, thx. in the meanwhile i did for that specific call direct http calls and use the library for the rest. but i guess with this workaround i can remove the manual calls
python-gitlab have a great solution. I have use below code and don't worry about pagination. We need realize something similar
pr = gl.projects.get(209)
piter = pr.pipelines.list(as_list=False)
for pipeline in piter:
pinfo = pr.pipelines.get(pipeline.id)
print(pinfo.created_at)
From docs python-gitlab
list() methods can also return a generator object which will handle the next calls to the API when required. This is the recommended way to iterate through a large number of items:
The generator exposes extra listing information as received from the server:
current_page: current page number (first page is 1)
prev_page: if None the current page is the first one
next_page: if None the current page is the last one
per_page: number of items per page
total_pages: total number of pages available
total: total number of items in the list
I'm requesting sth, that returns more than 100 results. eg:
tc.vcs_root_api.get_roots()
This obviously returns a paginated result, as also the
next_href
etc is set.From the docs it's unclear to me how to access the next pages of the result. Could you maybe give a hint what the right way would be todo this?
The text was updated successfully, but these errors were encountered: