Question

How can I retrieve a list of unhealthy droplets

Posted January 16, 2020 189 views
Load Balancing

I am looking to revtrieve a list of droplets which have failed the loadbalancer healthchecks and are currently “down”

The idea being I have a periodic script the runs, finds all the unhealhy/down droplets and replaces them with new ones.

The best I could find were some XHR requests made in the dashboard which look something like:

https://cloud.digitalocean.com/api/v1/load_balancers/combined_metrics/haproxy_backend_up?load_balancer_ids[]=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxx&period=6hour

But that is not available via the API.

Does anyone know of a way to do this?

Submit an answer

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!