A module to have a FastAPI HealthCheck reach out to a URI to validate external service health.
Project description
fastapi_healthcheck_uri
A module to have a FastAPI HealthCheck reach out to a URI to validate external service health.
Adding Health Checks
Here is what you need to get started.
from fastapi import FastAPI
from fastapi_healthcheck import HealthCheckFactory, healthCheckRoute
from fastapi_healthcheck_uri import HealthCheckUri
app = FastAPI()
# Add Health Checks
_healthChecks = HealthCheckFactory()
_healthChecks.add(
HealthCheckUri(
alias='reddit',
connectionUri="https://www.reddit.com/r/aww.json",
tags=('external', 'reddit', 'aww'),
healthyCode=200,
unhealthyCode=500
)
)
app.add_api_route('/health', endpoint=healthCheckRoute(factory=_healthChecks))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for fastapi_healthcheck_uri-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a570c92bb42efe37746470395b4c7a24619e10257ecdb8ef9f3c60b39959580 |
|
MD5 | 5c2d2c96f9a81ed0c99adca06372132a |
|
BLAKE2b-256 | a26469b02f6771256b5009ecebb92302baf8f6e4af430d0b07f8878b5519c047 |
Close
Hashes for fastapi_healthcheck_uri-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2a6a86faf1857f2cf90dbc1a3a538a3049b5897b534607eb28fafaf2565ef63 |
|
MD5 | 2230c5d795f6af068f4353d08a34096f |
|
BLAKE2b-256 | 7562cf8c881ebfa1061e506d6938836a6acf7b629ef53af38cdaaf53c3fd947c |