summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
authorEric Sabouraud <esabouraud@users.noreply.github.com>2018-02-28 15:53:25 +0100
committerEric Sabouraud <esabouraud@users.noreply.github.com>2018-02-28 15:53:25 +0100
commit5fdd06e1ee57e42a746aefcb96d819c0ed7835bf (patch)
tree91bbd3c7b6345daba38ea0ffc44248e3cd9793dd /gitlab
parent9a30266d197c45b00bafd4cea2aa4ca30637046b (diff)
downloadgitlab-5fdd06e1ee57e42a746aefcb96d819c0ed7835bf.tar.gz
Add support for unsharing projects to v4 API
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/v4/objects.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/gitlab/v4/objects.py b/gitlab/v4/objects.py
index 69c3185..16564e4 100644
--- a/gitlab/v4/objects.py
+++ b/gitlab/v4/objects.py
@@ -2672,6 +2672,22 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject):
'expires_at': expires_at}
self.manager.gitlab.http_post(path, post_data=data, **kwargs)
+ @cli.register_custom_action('Project', ('group_id', ))
+ @exc.on_http_error(exc.GitlabDeleteError)
+ def unshare(self, group_id, **kwargs):
+ """Delete a shared project link within a group.
+
+ Args:
+ group_id (int): ID of the group.
+ **kwargs: Extra options to send to the server (e.g. sudo)
+
+ Raises:
+ GitlabAuthenticationError: If authentication is not correct
+ GitlabDeleteError: If the server failed to perform the request
+ """
+ path = '/projects/%s/share/%s' % (self.get_id(), group_id)
+ self.manager.gitlab.http_delete(path, **kwargs)
+
# variables not supported in CLI
@cli.register_custom_action('Project', ('ref', 'token'))
@exc.on_http_error(exc.GitlabCreateError)