summaryrefslogtreecommitdiff
path: root/gitlab/v4/objects
diff options
context:
space:
mode:
authorNejc Habjan <nejc.habjan@siemens.com>2022-02-10 01:38:14 +0100
committerJohn Villalovos <john@sodarock.com>2022-02-10 10:21:30 -0800
commitc01c034169789e1d20fd27a0f39f4c3c3628a2bb (patch)
tree7ecf98df024ebf451e7c99f4adc2ae800eeab0d5 /gitlab/v4/objects
parent14b88a13914de6ee54dd2a3bd0d5960a50578064 (diff)
downloadgitlab-c01c034169789e1d20fd27a0f39f4c3c3628a2bb.tar.gz
feat(artifacts): add support for project artifacts delete API
Diffstat (limited to 'gitlab/v4/objects')
-rw-r--r--gitlab/v4/objects/artifacts.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/gitlab/v4/objects/artifacts.py b/gitlab/v4/objects/artifacts.py
index 55d762b..541e5e2 100644
--- a/gitlab/v4/objects/artifacts.py
+++ b/gitlab/v4/objects/artifacts.py
@@ -45,6 +45,23 @@ class ProjectArtifactManager(RESTManager):
**kwargs,
)
+ @exc.on_http_error(exc.GitlabDeleteError)
+ def delete(self, **kwargs: Any) -> None:
+ """Delete the project's artifacts on the server.
+
+ Args:
+ **kwargs: Extra options to send to the server (e.g. sudo)
+
+ Raises:
+ GitlabAuthenticationError: If authentication is not correct
+ GitlabDeleteError: If the server cannot perform the request
+ """
+ path = self._compute_path("/projects/{project_id}/artifacts")
+
+ if TYPE_CHECKING:
+ assert path is not None
+ self.gitlab.http_delete(path, **kwargs)
+
@cli.register_custom_action(
"ProjectArtifactManager", ("ref_name", "job"), ("job_token",)
)