gpt4 book ai didi

argoproj - 我在哪里可以获得 ArgoCD api 的深入文档

转载 作者:行者123 更新时间:2023-12-05 08:30:33 25 4
gpt4 key购买 nike

我需要根据一些标签过滤器列出所有应用程序。

https://argocd_domain/api/v1/applications

为了列出来自 argoCD API 的所有应用,我想放置所有可能的过滤器。

最佳答案

Argo CD API 记录在其 Swagger document 中。

将该 JSON 复制并粘贴到 Swagger Editor ,您将获得一个格式良好的描述 API 的页面。这是列出应用程序的部分:

Screenshot of Swagger Editor section for listing applications

function to handle a list-applications request 调用 ConvertSelectorToLabelsMap。读取 the implementation of that parsing function ,您可以找到 selector 参数的预期格式。

乍一看,格式似乎是一个以逗号分隔的 key=value 对列表。

使用 Swagger 编辑器,我生成了这个测试 URL:

curl -X GET "https://editor.swagger.io/api/v1/applications?selector=label1%3Dvalue1%2Clabel2%3Dvalue2" -H  "accept: application/json"

看起来您需要对等号和逗号进行 URL 编码。

关于argoproj - 我在哪里可以获得 ArgoCD api 的深入文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63558600/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com