fastapi-healthchecks-1.0.7
توضیحات
FastAPI Healthchecks
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | fastapi-healthchecks-1.0.7 |
| نام | fastapi-healthchecks |
| نسخه کتابخانه | 1.0.7 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | RockITSoft |
| ایمیل نویسنده | - |
| آدرس صفحه اصلی | - |
| آدرس اینترنتی | https://pypi.org/project/fastapi-healthchecks/ |
| مجوز | MIT |
# FastAPI health checks
Configurable health checks endpoints for FastAPI applications.
## Quickstart
```python
app = FastAPI()
app.include_router(
HealthcheckRouter(
Probe(
name="readiness",
checks=[
PostgreSqlCheck(host="db.example.com", username=..., password=...),
RedisCheck(host="redis.example.com", username=..., password=...),
],
),
Probe(
name="liveness",
checks=[
...,
],
),
),
prefix="/health",
)
```
The probes from this example will be available as `GET /health/readiness` and `GET /health/liveness`.
## Bundled checks
* `PostgreSqlCheck` – checks PostgreSQL server availability
* `RedisCheck` – checks Redis server availability
* `RabbitMqCheck` – checks RabbitMQ server availability
* `SettingsCheck` – validates settings models based on pydantic BaseModel
* `HttpCheck` – checks availability of specified URL
* `CephCheck` – checks Ceph server availability
## Custom checks
You can create your own checks by providing custom `fastapi_healthchecks.checks.Check` implementations. Like this:
```python
class MaintenanceCheck(Check):
async def __call__(self) -> CheckResult:
if is_maintenance():
return CheckResult(name="Maintenance", passed=False, details="Closed for maintenance")
else:
return CheckResult(name="Maintenance", passed=True)
```
نیازمندی
| مقدار | نام |
|---|---|
| >=0.70.1 | fastapi |
| >=1.9 | pydantic |
| >=7) | aio-pika |
| >=9.3) | aioboto3 |
| >=3,<4) | aiohttp[speedups] |
| >=0.25.0) | asyncpg |
| >=4,<5) | redis |
زبان مورد نیاز
| مقدار | نام |
|---|---|
| >=3.10,<4.0 | Python |
نحوه نصب
نصب پکیج whl fastapi-healthchecks-1.0.7:
pip install fastapi-healthchecks-1.0.7.whl
نصب پکیج tar.gz fastapi-healthchecks-1.0.7:
pip install fastapi-healthchecks-1.0.7.tar.gz