consul在一个请求中查询所有服务节点

时间:2015-12-30 01:08:37

标签: consul

https://www.consul.io/docs/agent/http/catalog.html

  

/ v1 / catalog / services:列出给定服务中的节点

我有很多服务,不得不为每个节点查询consul .. THUS这被多次调用

  

/ v1 / catalog / service /:服务的节点

需要一个http api才能在一个请求中获取所有服务,例如

  

/ v1 / catalog / servicesNodes:每项服务的节点

{
 "service1":[{Node":"2e6c1dbe173f","Address":"172.17.42.1",
             "ServiceID":"aa:80", "ServiceName":"aaww",...},{}],
 "service2":[{Node":"2e6c1dbe173ee","Address":"172.17.42.1",
             "ServiceID":"aaqq:80", "ServiceName":"aaqqww",...},{}],

}

0 个答案:

没有答案