diff --git a/examples/Advanced/pyproject.toml b/examples/Advanced/pyproject.toml index c171cc4..e6eb02d 100644 --- a/examples/Advanced/pyproject.toml +++ b/examples/Advanced/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.9" psutil = { version = "^5.6" } fastapi = { version = "^0.65.2" } uvicorn = { version = "^0.11.7" } -pyctuator = { version = "^1.0.0" } +pyctuator = { version = "^1.0.1" } sqlalchemy = { version = "^1.3" } PyMySQL = { version = "^0.9.3" } cryptography = { version = "^2.8" } diff --git a/examples/FastAPI/pyproject.toml b/examples/FastAPI/pyproject.toml index a493c24..337ddd4 100644 --- a/examples/FastAPI/pyproject.toml +++ b/examples/FastAPI/pyproject.toml @@ -11,7 +11,7 @@ python = "^3.9" psutil = { version = "^5.6" } fastapi = { version = "^0.82.0" } uvicorn = { version = "^0.18.2" } -pyctuator = { version = "^1.0.0" } +pyctuator = { version = "^1.0.1" } [build-system] requires = ["poetry>=0.12"] diff --git a/examples/Flask/pyproject.toml b/examples/Flask/pyproject.toml index d18d8b1..a6f32e1 100644 --- a/examples/Flask/pyproject.toml +++ b/examples/Flask/pyproject.toml @@ -10,7 +10,7 @@ authors = [ python = "^3.9" psutil = { version = "^5.6" } flask = { version = "^2.2.2" } -pyctuator = { version = "^1.0.0" } +pyctuator = { version = "^1.0.1" } [build-system] requires = ["poetry>=0.12"] diff --git a/examples/aiohttp/pyproject.toml b/examples/aiohttp/pyproject.toml index 0dee9c3..f285d6a 100644 --- a/examples/aiohttp/pyproject.toml +++ b/examples/aiohttp/pyproject.toml @@ -10,7 +10,7 @@ authors = [ python = "^3.9" psutil = { version = "^5.6" } aiohttp = { version = "^3.6.2" } -pyctuator = { version = "^1.0.0" } +pyctuator = { version = "^1.0.1" } [build-system] requires = ["poetry>=0.12"] diff --git a/examples/tornado/pyproject.toml b/examples/tornado/pyproject.toml index 9ab4dc1..ebdea6c 100644 --- a/examples/tornado/pyproject.toml +++ b/examples/tornado/pyproject.toml @@ -10,7 +10,7 @@ authors = [ python = "^3.9" psutil = { version = "^5.6" } tornado = { version = "^6.0.4" } -pyctuator = { version = "^1.0.0" } +pyctuator = { version = "^1.0.1" } [build-system] requires = ["poetry>=0.12"] diff --git a/pyctuator/health/health_provider.py b/pyctuator/health/health_provider.py index 536aec9..9d819b8 100644 --- a/pyctuator/health/health_provider.py +++ b/pyctuator/health/health_provider.py @@ -29,6 +29,12 @@ class HealthSummary: details: Mapping[str, HealthStatus] def http_status(self) -> int: + """ + :return: The HTTP according to the service's health. Done according to the documentation in + https://docs.spring.io/spring-boot/docs/2.7.0/reference/htmlsingle/#actuator.endpoints.health.writing-custom-health-indicators + The HTTP status code in the response reflects the overall health status. By default, OUT_OF_SERVICE + and DOWN map to 503. Any unmapped health statuses, including UP, map to 200. + """ if self.status == Status.DOWN: return HTTPStatus.SERVICE_UNAVAILABLE return HTTPStatus.OK diff --git a/pyproject.toml b/pyproject.toml index 0ba14be..38b1c9c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pyctuator" -version = "1.0.0" +version = "1.0.1" description = "A Python implementation of the Spring Actuator API for popular web frameworks" authors = [ "Michael Yakobi ",