Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
testREST
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Saeed Hadadan
testREST
Commits
de358648
Commit
de358648
authored
5 years ago
by
Harrison Cook
Browse files
Options
Downloads
Patches
Plain Diff
transfer project to group
parent
b48050fa
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
script_git.py
+16
-1
16 additions, 1 deletion
script_git.py
with
16 additions
and
1 deletion
script_git.py
+
16
−
1
View file @
de358648
...
...
@@ -3,7 +3,7 @@
import
requests
as
r
import
json
as
j
SECRET_KEY
=
'
SWZskgnDTNUzVsQ7EmKs
'
SECRET_KEY
=
'
'
# FILL IN
BASE_URL
=
'
https://gitlab.cs.umd.edu/
'
DEFAULT_HEADERS
=
{
...
...
@@ -68,3 +68,18 @@ def add_to_project(project_id, user_id, permission):
except
KeyError
:
return
False
def
transfer_to_group
(
project_id
,
group_id
):
rq
=
r
.
put
(
BASE_URL
+
"
api/v4/projects/
"
+
str
(
project_id
)
+
"
/transfer
"
,
headers
=
DEFAULT_HEADERS
,
data
=
j
.
dumps
(
{
'
namespace
'
:
group_id
}
)
)
res
=
j
.
loads
(
rq
.
text
)
try
:
return
res
[
'
id
'
]
==
project_id
except
KeyError
:
return
False
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment