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 30
30
from gitlab import utils # noqa
31
31
32
32
__title__ = "python-gitlab"
33
- __version__ = "2.2.0 "
33
+ __version__ = "2.2.1 "
34
34
__author__ = "Gauvain Pocentek"
35
35
__email__ = "gauvainpocentek@gmail.com"
36
36
__license__ = "LGPL3"
Original file line number Diff line number Diff line change @@ -3774,6 +3774,24 @@ def take_ownership(self, **kwargs):
3774
3774
server_data = self .manager .gitlab .http_post (path , ** kwargs )
3775
3775
self ._update_attrs (server_data )
3776
3776
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
+
3777
3795
3778
3796
class ProjectPipelineScheduleManager (CRUDMixin , RESTManager ):
3779
3797
_path = "/projects/%(project_id)s/pipeline_schedules"
You can’t perform that action at this time.
0 commit comments