File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 3030from gitlab import utils # noqa
3131
3232__title__ = "python-gitlab"
33- __version__ = "2.2.0 "
33+ __version__ = "2.2.1 "
3434__author__ = "Gauvain Pocentek"
3535__email__ = "gauvainpocentek@gmail.com"
3636__license__ = "LGPL3"
Original file line number Diff line number Diff line change @@ -3774,6 +3774,24 @@ def take_ownership(self, **kwargs):
37743774 server_data = self .manager .gitlab .http_post (path , ** kwargs )
37753775 self ._update_attrs (server_data )
37763776
3777+ @cli .register_custom_action ("ProjectPipelineSchedule" )
3778+ @exc .on_http_error (exc .GitlabOwnershipError )
3779+ def play (self , ** kwargs ):
3780+ # https://docs.gitlab.com/ee/api/pipeline_schedules.html#run-a-scheduled-pipeline-immediately # noqa
3781+ """Play a pipeline schedule immediately.
3782+
3783+ Args:
3784+ **kwargs: Extra options to send to the server (e.g. sudo)
3785+
3786+ Raises:
3787+ GitlabAuthenticationError: If authentication is not correct
3788+ GitlabOwnershipError: If the request failed
3789+ """
3790+ path = "%s/%s/play" % (self .manager .path , self .get_id ())
3791+ server_data = self .manager .gitlab .http_post (path , ** kwargs )
3792+ self ._update_attrs (server_data )
3793+ return server_data
3794+
37773795
37783796class ProjectPipelineScheduleManager (CRUDMixin , RESTManager ):
37793797 _path = "/projects/%(project_id)s/pipeline_schedules"
You can’t perform that action at this time.
0 commit comments