Reputation: 524
My group has subgroups and projects. How do I retrieve all projects under "gpt" group in gitlab through API.
Upvotes: 0
Views: 73
Reputation: 524
Gitlab Groups API for projects is paginated which means it gives max 100 records on 1 page. You need to check the 'X-Total-Pages' under the response header. X-Total-Pages are the total pages that you need to loop through.
resp.headers["X-Total-Pages"] should get you the total pages.
You will iterate through X-Total-Pages to get the all projects.
Upvotes: 0