diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2019-05-01 07:45:19 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2019-06-10 15:05:46 +0200 |
commit | 76b6e1fc0f42ad00f21d284b4ca2c45d6020fd19 (patch) | |
tree | 08a3cab6460bcb26eb6bde7122b004a7a16ee59e /gitlab/v4/objects.py | |
parent | e45a6e2618db30834f732c5a7bc9f1c038c45c31 (diff) | |
download | gitlab-76b6e1fc0f42ad00f21d284b4ca2c45d6020fd19.tar.gz |
feat: implement artifacts deletionfix/744/delete_artifacts
Closes #744
Diffstat (limited to 'gitlab/v4/objects.py')
-rw-r--r-- | gitlab/v4/objects.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py index 8fc7150..d15bc5d 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -1585,6 +1585,21 @@ class ProjectJob(RESTObject, RefreshMixin): self.manager.gitlab.http_post(path) @cli.register_custom_action("ProjectJob") + @exc.on_http_error(exc.GitlabCreateError) + def delete_artifacts(self, **kwargs): + """Delete artifacts of a job. + + Args: + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabDeleteError: If the request could not be performed + """ + path = "%s/%s/artifacts" % (self.manager.path, self.get_id()) + self.manager.gitlab.http_delete(path) + + @cli.register_custom_action("ProjectJob") @exc.on_http_error(exc.GitlabGetError) def artifacts(self, streamed=False, action=None, chunk_size=1024, **kwargs): """Get the job artifacts. |