Skip to content

Commit de0536b

Browse files
author
Gauvain Pocentek
committed
Support the scope attribute in runners.list()
1 parent c538de7 commit de0536b

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

docs/gl_objects/runners.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# list
22
# List owned runners
33
runners = gl.runners.list()
4+
# With a filter
5+
runners = gl.runners.list(scope='active')
46
# List all runners, using a filter
57
runners = gl.runners.all(scope='paused')
68
# end list

docs/gl_objects/runners.rst

+8-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,14 @@ Examples
1313

1414
Use the ``list()`` and ``all()`` methods to list runners.
1515

16-
The ``all()`` method accepts a ``scope`` parameter to filter the list. Allowed
17-
values for this parameter are ``specific``, ``shared``, ``active``, ``paused``
18-
and ``online``.
16+
Both methods accept a ``scope`` parameter to filter the list. Allowed values
17+
for this parameter are:
18+
19+
* ``active``
20+
* ``paused``
21+
* ``online``
22+
* ``specific`` (``all()`` only)
23+
* ``shared`` (``all()`` only)
1924

2025
.. note::
2126

gitlab/objects.py

+1
Original file line numberDiff line numberDiff line change
@@ -2478,6 +2478,7 @@ class Runner(GitlabObject):
24782478
_url = '/runners'
24792479
canCreate = False
24802480
optionalUpdateAttrs = ['description', 'active', 'tag_list']
2481+
optionalListAttrs = ['scope']
24812482

24822483

24832484
class RunnerManager(BaseManager):

0 commit comments

Comments
 (0)