consul
A sample Python script to access information in a Consul service.
examples/python/list_consul.py
import consul con = consul.Consul() print(dir(con)) print(dir(con.catalog)) id, services = con.catalog.services() print(id) print('--- services ---') for s in services: print(s) print('---- service elastic --') id, nodes = con.catalog.service('elastic') print(id) hosts = [] for n in nodes: print(n) hosts.append(n['Address']) print(hosts)
Published on 2018-12-15
If you have any comments or questions, feel free to post them on the source of this page in GitHub. Source on GitHub.
Comment on this post