diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2016-07-17 09:16:34 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2016-07-17 09:16:34 +0200 |
commit | 6eb11fd73840889a7ab244c516c235a2dc7e6867 (patch) | |
tree | 0be019cd62eef95ede10762bc7de97f1fd4a43be /gitlab/objects.py | |
parent | 52c8825f7db7ff9a0a24a2bda6451af747822589 (diff) | |
download | gitlab-6eb11fd73840889a7ab244c516c235a2dc7e6867.tar.gz |
Implement runners global API
Diffstat (limited to 'gitlab/objects.py')
-rw-r--r-- | gitlab/objects.py | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py index dba54f0..a760a16 100644 --- a/gitlab/objects.py +++ b/gitlab/objects.py @@ -1965,6 +1965,35 @@ class Project(GitlabObject): raise_error_from_response(r, GitlabCreateError, 201) +class Runner(GitlabObject): + _url = '/runners' + canCreate = False + optionalUpdateAttrs = ['description', 'active', 'tag_list'] + + +class RunnerManager(BaseManager): + obj_cls = Runner + + def all(self, scope=None, **kwargs): + """List all the runners. + + Args: + scope (str): The scope of runners to show, one of: specific, + shared, active, paused, online + + Returns: + list(Runner): a list of runners matching the scope. + + Raises: + GitlabConnectionError: If the server cannot be reached. + GitlabListError; If the resource cannot be found + """ + url = '/runners/all' + if scope is not None: + url += '?scope=' + scope + return self.gitlab._raw_list(url, self.obj_cls, **kwargs) + + class TeamMember(GitlabObject): _url = '/user_teams/%(team_id)s/members' canUpdate = False |