diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-28 08:02:23 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-05-28 08:02:23 +0200 |
commit | 9c19e06dbb792308d2fcd4fff1239043981b5f61 (patch) | |
tree | 8a5482d466549514777a4dda426382a53f32198f /gitlab/v4/objects.py | |
parent | 677961624fbc5ab190e581ae89c9f0317ac3029e (diff) | |
download | gitlab-9c19e06dbb792308d2fcd4fff1239043981b5f61.tar.gz |
Add support for environment stop()
Diffstat (limited to 'gitlab/v4/objects.py')
-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 da2f6ed..6c0c84f 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1278,7 +1278,20 @@ class ProjectCommitManager(RetrieveMixin, CreateMixin, RESTManager): class ProjectEnvironment(SaveMixin, ObjectDeleteMixin, RESTObject): - pass + @cli.register_custom_action('ProjectEnvironment') + @exc.on_http_error(exc.GitlabStopError) + def stop(self, **kwargs): + """Stop the environment. + + Args: + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabStopError: If the operation failed + """ + path = '%s/%s/stop' % (self.manager.path, self.get_id()) + self.manager.gitlab.http_post(path, **kwargs) class ProjectEnvironmentManager(ListMixin, CreateMixin, UpdateMixin, |