Spaces:
Sleeping
Sleeping
Download quantlib_api/resources/health.py from gdukens/QuantLib_Pro: direct link, hf CLI and curl.
- Browser
- Download file 882 Bytes
-
https://huggingface.co/spaces/gdukens/QuantLib_Pro/resolve/main/quantlib_api/resources/health.py
- Command line
-
hf download hf://spaces/gdukens/QuantLib_Pro/quantlib_api/resources/health.py
-
curl -L -o health.py https://huggingface.co/spaces/gdukens/QuantLib_Pro/resolve/main/quantlib_api/resources/health.py
882 Bytes
| """ | |
| QuantLib Pro SDK — Health Resource | |
| """ | |
| from typing import Any, Dict | |
| from quantlib_api.resources.base import BaseResource | |
| class HealthResource(BaseResource): | |
| """API health checks.""" | |
| PREFIX = "" | |
| def check(self) -> Dict[str, Any]: | |
| """ | |
| Check API health status. | |
| Returns | |
| ------- | |
| dict | |
| Health status, uptime, version | |
| """ | |
| return self._http.get("/health") | |
| def detailed(self) -> Dict[str, Any]: | |
| """Get detailed health check with component status.""" | |
| return self._http.get("/health/detailed") | |
| def readiness(self) -> Dict[str, Any]: | |
| """Check if API is ready to accept traffic.""" | |
| return self._http.get("/health/readiness") | |
| def liveness(self) -> Dict[str, Any]: | |
| """Check if API process is alive.""" | |
| return self._http.get("/health/liveness") | |