diff options
| author | Gauvain Pocentek <gauvain@pocentek.net> | 2017-11-12 07:38:28 +0100 |
|---|---|---|
| committer | Gauvain Pocentek <gauvain@pocentek.net> | 2017-11-12 07:38:28 +0100 |
| commit | 9ede6529884e850532758ae218465c1b7584c2d4 (patch) | |
| tree | 9ad4c053ac296dd478420acf6636db76ff180106 /gitlab/v4 | |
| parent | 4ee139ad5c58006da1f9af93fdd4e70592e6daa0 (diff) | |
| download | gitlab-9ede6529884e850532758ae218465c1b7584c2d4.tar.gz | |
Add support for project housekeeping
Closes #368
Diffstat (limited to 'gitlab/v4')
| -rw-r--r-- | gitlab/v4/objects.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 77a6a72..85aba12 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -2328,6 +2328,22 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): post_data = {'ref': ref, 'token': token, 'variables': variables} self.manager.gitlab.http_post(path, post_data=post_data, **kwargs) + @cli.register_custom_action('Project') + @exc.on_http_error(exc.GitlabHousekeepingError) + def housekeeping(self, **kwargs): + """Start the housekeeping task. + + Args: + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabHousekeepingError: If the server failed to perform the + request + """ + path = '/projects/%s/housekeeping' % self.get_id() + self.manager.gitlab.http_post(path, **kwargs) + # see #56 - add file attachment features @cli.register_custom_action('Project', ('filename', 'filepath')) @exc.on_http_error(exc.GitlabUploadError) |
