[英]How to get all projects under a group called "gpt" in gitlab through API
My group has subgroups and projects.我的小组有子小组和项目。 How do I retrieve all projects under "gpt" group in gitlab through API.如何通过 API 检索 gitlab 中“gpt”组下的所有项目。
Gitlab Groups API for projects is paginated which means it gives max 100 records on 1 page.项目的 Gitlab 组 API 是分页的,这意味着它在一页上最多提供 100 条记录。 You need to check the 'X-Total-Pages' under the response header.您需要检查响应 header 下的“X-Total-Pages”。 X-Total-Pages are the total pages that you need to loop through. X-Total-Pages 是您需要循环浏览的总页数。
resp.headers["X-Total-Pages"] should get you the total pages. resp.headers["X-Total-Pages"] 应该为您提供总页数。
You will iterate through X-Total-Pages to get the all projects.您将遍历 X-Total-Pages 以获取所有项目。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.