mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-10 04:41:10 +00:00
add healthchecks client
This commit is contained in:
parent
c01ab8303c
commit
d59d5ac4e2
11 changed files with 630 additions and 5 deletions
20
src/lego_monitoring/alerting/clients/healthchecks.py
Normal file
20
src/lego_monitoring/alerting/clients/healthchecks.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from typing import Optional
|
||||
|
||||
from uplink import Body, Consumer, Path, Query, post, response_handler
|
||||
|
||||
from .common import raise_for_status
|
||||
|
||||
|
||||
@response_handler(raise_for_status)
|
||||
class HealthchecksClient(Consumer):
|
||||
@post("{key}/{slug}")
|
||||
def _success(self, key: Path, slug: Path, create: Query, log: Body): ...
|
||||
|
||||
@post("{key}/{slug}/fail")
|
||||
def _failure(self, key: Path, slug: Path, create: Query, log: Body): ...
|
||||
|
||||
def success(self, key: Path, slug: str, create: bool = False, log: Optional[str] = None):
|
||||
return self._success(key, slug, int(create), log)
|
||||
|
||||
def failure(self, key: Path, slug: str, create: bool = False, log: Optional[str] = None):
|
||||
return self._failure(key, slug, int(create), log)
|
||||
Loading…
Add table
Add a link
Reference in a new issue