summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2017-01-21 14:13:28 +0100
committerGauvain Pocentek <gauvain@pocentek.net>2017-01-21 14:13:28 +0100
commitde0536b1cfff43c494c64930a37333529e589a94 (patch)
tree42e80876f41c75551dee1335b7b3a3848ae9008e
parentc538de75f39ecc29741b961b981e3fdf0b18d317 (diff)
downloadgitlab-de0536b1cfff43c494c64930a37333529e589a94.tar.gz
Support the scope attribute in runners.list()
-rw-r--r--docs/gl_objects/runners.py2
-rw-r--r--docs/gl_objects/runners.rst11
-rw-r--r--gitlab/objects.py1
3 files changed, 11 insertions, 3 deletions
diff --git a/docs/gl_objects/runners.py b/docs/gl_objects/runners.py
index 5092dc0..3de36df 100644
--- a/docs/gl_objects/runners.py
+++ b/docs/gl_objects/runners.py
@@ -1,6 +1,8 @@
# list
# List owned runners
runners = gl.runners.list()
+# With a filter
+runners = gl.runners.list(scope='active')
# List all runners, using a filter
runners = gl.runners.all(scope='paused')
# end list
diff --git a/docs/gl_objects/runners.rst b/docs/gl_objects/runners.rst
index 32d6719..2f7e599 100644
--- a/docs/gl_objects/runners.rst
+++ b/docs/gl_objects/runners.rst
@@ -13,9 +13,14 @@ Examples
Use the ``list()`` and ``all()`` methods to list runners.
-The ``all()`` method accepts a ``scope`` parameter to filter the list. Allowed
-values for this parameter are ``specific``, ``shared``, ``active``, ``paused``
-and ``online``.
+Both methods accept a ``scope`` parameter to filter the list. Allowed values
+for this parameter are:
+
+* ``active``
+* ``paused``
+* ``online``
+* ``specific`` (``all()`` only)
+* ``shared`` (``all()`` only)
.. note::
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 8f44ef9..b2c0c04 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -2478,6 +2478,7 @@ class Runner(GitlabObject):
_url = '/runners'
canCreate = False
optionalUpdateAttrs = ['description', 'active', 'tag_list']
+ optionalListAttrs = ['scope']
class RunnerManager(BaseManager):