如何使用 API list 极狐GitLab 群组中的镜像仓库?

GitLab 是一个全球知名的一体化 DevOps 平台,很多人都通过私有化部署 GitLab 来进行源代码托管。极狐GitLabhttps://gitlab.cn/install?channel=content\&utm_source=csdn 是 GitLab 在中国的发行版,专门为中国程序员服务。可以一键式部署极狐GitLab。

极狐GitLab 在 5 月 28 日正式发布了 AI 产品驭码CodeRider。现已开启免费试用,登录官网:https://coderider.gitlab.cn/ 即可申请试用。

更多关于极狐GitLabhttps://gitlab.cn 或者 DevOps 的最佳实践,可以关注文末的极狐GitLab 公众号。

学习极狐GitLab 的相关资料:

  1. 极狐GitLab 官网https://gitlab.cn
  2. 极狐GitLab 官网文档https://docs.gitlab.cn
  3. 极狐GitLab 论坛https://forum.gitlab.cn/
  4. 极狐GitLab 安装配置https://gitlab.cn/install
  5. 极狐GitLab 资源中心https://resources.gitlab.cn/
  6. AI 产品驭码CodeRiderhttps://coderider.gitlab.cn/

搜索【极狐GitLab】公众号,后台输入加群 ,备注gitlab,即可加入官方微信技术交流群。

极狐GitLab 提供如下 API 用来 list 群组中的镜像仓库:

复制代码
GET /groups/:id/registry/repositories

使用的必须参数:

  • token:个人访问令牌
  • id:群组 ID

以极狐GitLab SaaS(JihuLab.com)为例,https://jihulab.com/jh-xiaomage-devops 这是一个个人群组,群组 ID 为5169。使用如下命令即可 list 出该 Group 下面的所有容器镜像。

复制代码
curl --header "PRIVATE-TOKEN: YOUR-PERSONAL-ACCESS-TOKEN" \
     "https://jihulab.com/api/v4/groups/5169/registry/repositories"

可以看到如下返回结果:

复制代码
[
  {
    "id": 534,
    "name": "kaniko",
    "path": "jh-xiaomage-devops/go-demo/kaniko",
    "project_id": 16274,
    "location": "registry.jihulab.com/jh-xiaomage-devops/go-demo/kaniko",
    "created_at": "2022-02-21T18:42:43.937+08:00",
    "cleanup_policy_started_at": null,
    "status": null
  },
  {
    "id": 535,
    "name": "",
    "path": "jh-xiaomage-devops/go-demo",
    "project_id": 16274,
    "location": "registry.jihulab.com/jh-xiaomage-devops/go-demo",
    "created_at": "2022-02-21T18:45:07.090+08:00",
    "cleanup_policy_started_at": null,
    "status": null
  }
]

可以看到群组 jh-xiaomage-devops下面有两个容器镜像仓库,go-demo/kaniko和go-demo/。对应的镜像仓库地址为 registry.jihulab.com/jh-xiaomage-devops/go-demo/kanikoregistry.jihulab.com/jh-xiaomage-devops/go-demo

可以在项目页面上进行查看:

可以点击某一个来查看下面有多少镜像。比如点击 go-demo可以看到下面的内容:

相关推荐
程序员允诺18 小时前
[DevOps实战] 彻底解决依赖地狱:如何编译全静态、可移植的 Xorriso 工具
运维·devops
cuijiecheng201819 小时前
GitLab创建项目
gitlab
智能运维指南2 天前
破解信创改造痛点:国产DevOps平台选型的核心逻辑与实践路径
devops·devops平台·devops系统·devops厂商·研发效能平台
翰德恩咨询2 天前
敏捷咨询实战:如何让DevOps从理念到高效落地
敏捷开发·devops
Bruk.Liu2 天前
Gitea Actions 的概念及基础使用
运维·ci/cd·持续集成
学嵌入式的小杨同学2 天前
【Linux 实战】手写 ls 命令核心功能:C 语言实现文件属性与目录遍历(附完整可运行代码)
linux·运维·服务器·c语言·chrome·后端·ci/cd
叼奶嘴的超人2 天前
手动创建Docker版Fastapi CI/CD镜像文件
ci/cd·docker·fastapi
_运维那些事儿2 天前
GitLabCI/CD语法
linux·服务器·git·ci/cd·gitlab·运维开发·devops
_运维那些事儿2 天前
GitLab&Jenkins
运维·ci/cd·gitlab·jenkins·devops
一念一花一世界2 天前
Jenkins 太重?试试超轻量开源 CI/CD 工具 Arbess
运维·ci/cd·jenkins·arbess