Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita1c79d2

Browse files
wrouesnelGauvain Pocentek
authored and
Gauvain Pocentek
committed
Add support for project transfers from the projects interface. (#561)
Seehttps://docs.gitlab.com/ee/api/projects.html#transfer-a-project-to-a-new-namespace
1 parentb325bd7 commita1c79d2

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

‎gitlab/v4/objects.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3611,6 +3611,25 @@ def mirror_pull(self, **kwargs):
36113611
path='/projects/%d/mirror/pull'%self.get_id()
36123612
self.manager.gitlab.http_post(path,**kwargs)
36133613

3614+
@cli.register_custom_action('Project', ('to_namespace', ))
3615+
@exc.on_http_error(exc.GitlabTransferProjectError)
3616+
deftransfer_project(self,to_namespace,**kwargs):
3617+
"""Transfer a project to the given namespace ID
3618+
3619+
Args:
3620+
to_namespace (str): ID or path of the namespace to transfer the
3621+
project to
3622+
**kwargs: Extra options to send to the server (e.g. sudo)
3623+
3624+
Raises:
3625+
GitlabAuthenticationError: If authentication is not correct
3626+
GitlabTransferProjectError: If the project could not be transfered
3627+
"""
3628+
path='/projects/%d/transfer'% (self.id,)
3629+
self.manager.gitlab.http_put(path,
3630+
post_data={"namespace":to_namespace},
3631+
**kwargs)
3632+
36143633

36153634
classProjectManager(CRUDMixin,RESTManager):
36163635
_path='/projects'

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp