diff options
author | Max Wittig <max.wittig@siemens.com> | 2020-05-04 08:10:49 +0200 |
---|---|---|
committer | Max Wittig <max.wittig@siemens.com> | 2020-05-16 15:12:23 +0200 |
commit | 49439916ab58b3481308df5800f9ffba8f5a8ffd (patch) | |
tree | cc9455a277227aaedd30e68b06703fd345720bbf /gitlab | |
parent | 74b3ddcd5d44c4fe6c7c0189f87852d861e807f0 (diff) | |
download | gitlab-49439916ab58b3481308df5800f9ffba8f5a8ffd.tar.gz |
feat: add group runners api
Diffstat (limited to 'gitlab')
-rw-r--r-- | gitlab/v4/objects.py | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 42b2bf4..bc45bf1 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1308,6 +1308,17 @@ class GroupProjectManager(ListMixin, RESTManager): ) +class GroupRunner(ObjectDeleteMixin, RESTObject): + pass + + +class GroupRunnerManager(NoUpdateMixin, RESTManager): + _path = "/groups/%(group_id)s/runners" + _obj_cls = GroupRunner + _from_parent_attrs = {"group_id": "id"} + _create_attrs = (("runner_id",), tuple()) + + class GroupSubgroup(RESTObject): pass @@ -1357,6 +1368,7 @@ class Group(SaveMixin, ObjectDeleteMixin, RESTObject): ("milestones", "GroupMilestoneManager"), ("notificationsettings", "GroupNotificationSettingsManager"), ("projects", "GroupProjectManager"), + ("runners", "GroupRunnerManager"), ("subgroups", "GroupSubgroupManager"), ("variables", "GroupVariableManager"), ("clusters", "GroupClusterManager"), @@ -5382,7 +5394,8 @@ class RunnerManager(CRUDMixin, RESTManager): query_data = {} if scope is not None: query_data["scope"] = scope - return self.gitlab.http_list(path, query_data, **kwargs) + obj = self.gitlab.http_list(path, query_data, **kwargs) + return [self._obj_cls(self, item) for item in obj] @cli.register_custom_action("RunnerManager", ("token",)) @exc.on_http_error(exc.GitlabVerifyError) |