add haproxy config generator for proxying

This commit is contained in:
lza_menace 2023-02-02 15:00:09 -08:00
parent 33a6a9b8a2
commit 0d12e4d30a
4 changed files with 44 additions and 3 deletions

View file

@ -24,6 +24,10 @@ class Node(Model):
datetime_failed = DateTimeField(default=None, null=True)
fail_reason = CharField(null=True)
def get_netloc(self):
_url = urlparse(self.url)
return _url.netloc
def get_failed_checks(self):
hcs = HealthCheck.select().where(HealthCheck.node == self, HealthCheck.health == False)
return hcs