Reputation: 347
I was wondering if there is a way to filter the services consul returns me using tags.
The endpoint:
/v1/catalog/services
returns a map of services to lists of tags and requires me to parse the services after they are returned.
I was wondering if there is some way to pass the tag (or tags) I want as a query parameter to the endpoint and get a map back that is already filtered.
Upvotes: 6
Views: 3061
Reputation: 1596
its supported by the ?tags=...
query parameter to the individual service:
https://www.consul.io/docs/agent/http/catalog.html#catalog_service
Otherwise one could just parse the returned json from catalog/services.
Upvotes: -1