fftools.healthchecks¶
- class fftools.healthchecks.HealthChecks(url: str, path: str, ping_key: str | None = None, user_agent: str | None = None, create: bool = False)[source]¶
Bases:
objectping healthchecks.
you can use <HOSTNAME> in the path for the formatted hostname of the device.
- __init__(url: str, path: str, ping_key: str | None = None, user_agent: str | None = None, create: bool = False) None[source]¶
Init the healthchecks api.
- Parameters:
url (str) – base url of the healthchecks instance.
path (str) – ping path. full path if ping_key is not used, else only the part after the ping_key.
ping_key (str | None) – ping key to use.
user_agent (str | None) – custom user-agent to set for requests.
create (bool) – set ?create=1 to the ping url parameters
- Return type:
None
- exit_code(exit_code: str | int, message: str | None = None) tuple[int, str][source]¶
Ping with status: exit_code.
send the exit code of the program to healthchecks.
- fail(message: str | None = None) tuple[int, str][source]¶
Ping with status: fail.
fails the current job.
- log(message: str) tuple[int, str][source]¶
Ping with status: log.
sends a log to the current job. does not stop or fail the job.