mirror of
https://forgejo.altau.su/lego/lego-monitoring.git
synced 2026-03-09 20:31:10 +00:00
20 lines
730 B
Python
20 lines
730 B
Python
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)
|