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
File details
Details for the file fastapi_healthcheck_uri-0.1.0.tar.gz
.
File metadata
- Download URL: fastapi_healthcheck_uri-0.1.0.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.9 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a570c92bb42efe37746470395b4c7a24619e10257ecdb8ef9f3c60b39959580 |
|
MD5 | 5c2d2c96f9a81ed0c99adca06372132a |
|
BLAKE2b-256 | a26469b02f6771256b5009ecebb92302baf8f6e4af430d0b07f8878b5519c047 |
File details
Details for the file fastapi_healthcheck_uri-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: fastapi_healthcheck_uri-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.1.12 CPython/3.9.9 Darwin/20.6.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2a6a86faf1857f2cf90dbc1a3a538a3049b5897b534607eb28fafaf2565ef63 |
|
MD5 | 2230c5d795f6af068f4353d08a34096f |
|
BLAKE2b-256 | 7562cf8c881ebfa1061e506d6938836a6acf7b629ef53af38cdaaf53c3fd947c |