diff options
author | Gauvain Pocentek <gauvain@pocentek.net> | 2018-06-10 10:13:48 +0200 |
---|---|---|
committer | Gauvain Pocentek <gauvain@pocentek.net> | 2018-06-10 10:13:48 +0200 |
commit | ebd6217853de7e7b6a140bbdf7e8779b5a40b861 (patch) | |
tree | 379e1bd8fc9e918cc94fcc8d373ee9e6869545b8 /gitlab/v4/objects.py | |
parent | f4c4e52fd8962638ab79429a49fd4a699048bafc (diff) | |
download | gitlab-ebd6217853de7e7b6a140bbdf7e8779b5a40b861.tar.gz |
Add support for Project.pull_mirror (EE)
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 a034308..609ff14 100644 --- a/gitlab/v4/objects.py +++ b/gitlab/v4/objects.py @@ -3357,6 +3357,21 @@ class Project(SaveMixin, ObjectDeleteMixin, RESTObject): path = '/projects/%d/search' % self.get_id() return self.manager.gitlab.http_list(path, query_data=data, **kwargs) + @cli.register_custom_action('Project') + @exc.on_http_error(exc.GitlabCreateError) + def mirror_pull(self, **kwargs): + """Start the pull mirroring process for the project. + + Args: + **kwargs: Extra options to send to the server (e.g. sudo) + + Raises: + GitlabAuthenticationError: If authentication is not correct + GitlabCreateError: If the server failed to perform the request + """ + path = '/projects/%d/mirror/pull' % self.get_id() + return self.manager.gitlab.http_post(path, **kwargs) + class ProjectManager(CRUDMixin, RESTManager): _path = '/projects' |