Created
September 16, 2014 00:12
-
-
Save progrium/93c6a98a8af9a548a099 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def healthy_nodes(): | |
nodes = requests.get("http://localhost:8500/v1/health/nodes").json() | |
passing = requests.get("http://localhost:8500/v1/health/state/passing").json() | |
passing = [c["Node"] for c in passing if c["CheckID"] == "serfHealth"] | |
return [n for n in nodes if n["Node"] in passing] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment