summaryrefslogtreecommitdiff
path: root/docs/api-usage.rst
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-05-15 18:20:01 +0200
committerNejc Habjan <hab.nejc@gmail.com>2021-05-15 18:21:19 +0200
commitdcf71a0290a3af14ae2f0eee70a2776eb29d9dc2 (patch)
tree16029ed5197ed207e458f66af7192a01790a7dd3 /docs/api-usage.rst
parentf35c73e50918e4d55b70323669f394e52e75cde9 (diff)
downloadgitlab-fix/all-pages-consumes-all-param.tar.gz
fix(api): add all_pages param to allow passing `all` to APIfix/all-pages-consumes-all-param
Diffstat (limited to 'docs/api-usage.rst')
-rw-r--r--docs/api-usage.rst9
1 files changed, 8 insertions, 1 deletions
diff --git a/docs/api-usage.rst b/docs/api-usage.rst
index e911664..3bf4354 100644
--- a/docs/api-usage.rst
+++ b/docs/api-usage.rst
@@ -190,6 +190,8 @@ a project (the previous example used 2 API calls):
project = gl.projects.get(1, lazy=True) # no API call
project.star() # API call
+.. _pagination:
+
Pagination
==========
@@ -205,11 +207,16 @@ listing methods support the ``page`` and ``per_page`` parameters:
The first page is page 1, not page 0.
By default GitLab does not return the complete list of items. Use the ``all``
-parameter to get all the items when using listing methods:
+parameter to get all the items when using listing methods. Alternatively, if
+the endpoint also accepts an ``all`` parameter itself, you can use the
+``all_pages`` parameter for listing methods to avoid this conflict:
.. code-block:: python
all_groups = gl.groups.list(all=True)
+ # or
+ all_groups = gl.groups.list(all_pages=True)
+
all_owned_projects = gl.projects.list(owned=True, all=True)
You can define the ``per_page`` value globally to avoid passing it to every