Reputation: 159
I need to list all applications based on some label filters.
https://argocd_domain/api/v1/applications
in order to list all apps from argoCD API, I want to put all possible filters.
Upvotes: 5
Views: 8396
Reputation: 91
Here you can select the exact version on GitHub and get the raw swagger json:
https://github.com/argoproj/argo-cd/blob/master/assets/swagger.json
Upvotes: 0
Reputation: 4734
You can find a hosted version of Argo's Swagger UI on https://cd.apps.argoproj.io/swagger-ui
Upvotes: 4
Reputation: 1719
You can find the Swagger docs by setting the path to /swagger-ui in your Argo CD server address. E.g. http://localhost:8080/swagger-ui
.
Upvotes: 5
Reputation: 8412
The Argo CD API is documented in its Swagger document.
Copy and paste that JSON to the Swagger Editor, and you'll get a nicely-formatted page describing the API. Here's the section for listing applications:
The function to handle a list-applications request calls ConvertSelectorToLabelsMap
. Reading the implementation of that parsing function, you can find the expected format of the selector
parameter.
At a glance, it seems the format is a comma-delimited list of key=value
pairs.
Using the Swagger Editor, I generated the this test URL:
curl -X GET "https://editor.swagger.io/api/v1/applications?selector=label1%3Dvalue1%2Clabel2%3Dvalue2" -H "accept: application/json"
Looks like you'll need to URL-encode the equals signs and commas.
Upvotes: 7