通过文物API获取两种包装类型的所有存储库

发布于 2025-01-30 12:46:27 字数 234 浏览 1 评论 0原文

我正在尝试获取两种软件包类型的所有存储库(Maven和Terraform)。我正在尝试使用的URL是:

curl -u username:password -X GET "https://artifactory.es/artifactory/api/repositories?packageType=docker,helm"

但是我只收到第一个包装的包装,在这种情况下,Docker软件包。

I'm trying to get all repositories of two package types (Maven and Terraform). The URL I'm trying is:

curl -u username:password -X GET "https://artifactory.es/artifactory/api/repositories?packageType=docker,helm"

But I'm getting only the packages of the first one, in this case Docker packages.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

提笔书几行 2025-02-06 12:46:27

如官方文档中所述(),您一次只能获得一种回购类型。虽然这将是一个不错的补充。

您可以使用JQ之类的工具,并简单地从所有存储库的完整列表中操纵数据。

curl -u username:password -X GET "https://artifactory.es/artifactory/api/repositories" | jq '[.[] | select (.packageType == "Docker" or .packageType == "Helm")]'

这将使您仅使用 docker helm 存储库。

As described in the official docs (The GetRepositories API), you can only get one repo type at a time. Although this would be a nice addition.

You can use a tool like jq and simply manipulate data from a full list of all repositories.

curl -u username:password -X GET "https://artifactory.es/artifactory/api/repositories" | jq '[.[] | select (.packageType == "Docker" or .packageType == "Helm")]'

This will leave you with the Docker or Helm repositories only.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文