summaryrefslogtreecommitdiff
path: root/gitlab/v4
diff options
context:
space:
mode:
authorChristopher Zorn <christopherzo@zillowgroup.com>2020-04-08 17:02:29 -0700
committerChristopher Zorn <christopherzo@zillowgroup.com>2020-04-20 16:18:04 -0700
commit07b99881dfa6efa9665245647460e99846ccd341 (patch)
tree0ad774c01fdf6045c36eea3be35cf0ab16136273 /gitlab/v4
parent7907e5a4b602d22d03d71ca51c6803f634bd8a78 (diff)
downloadgitlab-07b99881dfa6efa9665245647460e99846ccd341.tar.gz
feat: add play command to project pipeline schedules
fix: remove version from setup feat: add pipeline schedule play error exception docs: add documentation for pipeline schedule play
Diffstat (limited to 'gitlab/v4')
-rw-r--r--gitlab/v4/objects.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 756ec4f..f6c09d9 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -3775,6 +3775,24 @@ class ProjectPipelineSchedule(SaveMixin, ObjectDeleteMixin, RESTObject):
server_data = self.manager.gitlab.http_post(path, **kwargs)
self._update_attrs(server_data)
+ @cli.register_custom_action("ProjectPipelineSchedule")
+ @exc.on_http_error(exc.GitlabPipelinePlayError)
+ def play(self, **kwargs):
+ """Trigger a new scheduled pipeline, which runs immediately.
+ The next scheduled run of this pipeline is not affected.
+
+ Args:
+ **kwargs: Extra options to send to the server (e.g. sudo)
+
+ Raises:
+ GitlabAuthenticationError: If authentication is not correct
+ GitlabPipelinePlayError: If the request failed
+ """
+ path = "%s/%s/play" % (self.manager.path, self.get_id())
+ server_data = self.manager.gitlab.http_post(path, **kwargs)
+ self._update_attrs(server_data)
+ return server_data
+
class ProjectPipelineScheduleManager(CRUDMixin, RESTManager):
_path = "/projects/%(project_id)s/pipeline_schedules"