Clarify "Transfer Project to Group" API endpoint example
Transfer Project to a New Namespace
Transfer Project to a Group (which links to the first one)
TL;DR:
Please provide a curl example for how to transfer a project to a new group/namespace using the API, and/or ensure the provided example is complete.
PROBLEM:
The "Projects" documentation for transferring a project to a group is currently missing where to put the namespace
attribute and how to format it.
Though both id and namespace are required, it only shows:
PUT /projects/:id/transfer
The "Groups" documentation also links to this incomplete example (Discussed in Closed 22535).
QUESTION/SOLUTION:
Where does :namespace
go and how??
If the target namespace is a sub-group, is the numeric sub-group ID sufficient or do I need to include numeric group ID for the parent somewhere as well?
ATTEMPTS TO GET THIS WORKING:
Trying w/integer id & namespace values such as project id=123456 and group ID=098765 doesn't work:
curl -H "Content-Type: application/json" -H "PRIVATE-TOKEN:$GITLAB_API" -X PUT "https://gitlab.com/api/v4/projects/123456/transfer/098765
Response: 404, Not Found
Neither does using a url-encoded namespace string for "myGroup/subGroup name" such as:
curl -H "Content-Type: application/json" -H "PRIVATE-TOKEN:$GITLAB_API" -X PUT "https://gitlab.com/api/v4/projects/123456/transfer/myGroup%2FsubGroup%20name
Response: 404, Not Found
Also tried putting projects/:id/:namespace/transfer
, projects/:namespace/:id/transfer
, projects/:id/namespace/:namespace
, sending namespace as a URL parameter instead ... Nothing worked.
Please clear up the docs to show what the correct format should be. Thank you!