In GitLab you can create subgroups within a group and projects within those subgroups. The GitLab documentation allows you to list the subgroups of a group and the projects of a group, but I cannot find anything about listing projects of a subgroup. Does anyone know the curl command for this, or at least know that it's not supported yet?
I've tried:curl -s -H 'PRIVATE-TOKEN: xxxxx' https://gitlab.com/api/v4/groups/mygroup/subgroups/mysubgroup/projects
curl -s -H 'PRIVATE-TOKEN: xxxxx' https://gitlab.com/api/v4/subgroups/mysubgroup/projects
and other similar variations with no luck so far.
If you're a GitLab.com user, the base URL is https://gitlab.com .
On the Edit Project page there is a Project ID field in the top right corner. (You can also see the ID on the CI/CD pipelines page, in the exameple code of the Triggers section.) In older versions, you can see it on the Triggers page, in the URLs of the example code.
The GitLab API allows you to perform many of the actions you typically do when using the user interface. Using the API allows us to automate the process and eliminate any user interaction.
Use %2f
to specify full path to subgroup:
curl -s https://gitlab.com/api/v4/groups/gitlab-org%2fgitter/projects
See this issue.
To get all the projects of group and subgroups call the api like this
curl --silent --header "Private-Token: YOUR_GITLAB_TOKEN" https://gitlab.example.com/api/v4/groups/<group_name>/projects?include_subgroups=true
or using group id
<your_gitlab-url>/api/v4/groups/<group_ID>/projects?include_subgroups=true
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With