Python HAProxy API Client
- requests >=0.12 (http://docs.python-requests.org/en/latest/)
from haproxyapi import haproxy
h = haproxy('http://127.0.0.1:800/', ("user","password"))
h.disable("backend", "server")
h.enable("backend", "server")
print h.stats()
Or retrieve a specific server status:
print h.status("backend", "server")