summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorMax Wittig <max.wittig95@gmail.com>2019-06-17 17:56:38 +0200
committerGitHub <noreply@github.com>2019-06-17 17:56:38 +0200
commit4e1dd27d6400acd152be19692f3193f948422769 (patch)
tree08a3cab6460bcb26eb6bde7122b004a7a16ee59e /gitlab
parente45a6e2618db30834f732c5a7bc9f1c038c45c31 (diff)
parent76b6e1fc0f42ad00f21d284b4ca2c45d6020fd19 (diff)
downloadgitlab-4e1dd27d6400acd152be19692f3193f948422769.tar.gz
Merge pull request #767 from python-gitlab/fix/744/delete_artifacts
feature: Implement artifacts deletion
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/v4/objects.py15
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.