From 439106265f06f9587453e33b295e7ad58e9968aa Mon Sep 17 00:00:00 2001 From: burnettk Date: Thu, 29 Dec 2022 18:12:41 -0500 Subject: [PATCH] move status to health controller --- src/spiffworkflow_backend/api.yml | 2 +- .../routes/health_controller.py | 12 ++++++++++++ .../routes/process_api_blueprint.py | 7 ------- 3 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 src/spiffworkflow_backend/routes/health_controller.py diff --git a/src/spiffworkflow_backend/api.yml b/src/spiffworkflow_backend/api.yml index 0eed88cc..b4e047ca 100755 --- a/src/spiffworkflow_backend/api.yml +++ b/src/spiffworkflow_backend/api.yml @@ -115,7 +115,7 @@ paths: /status: get: - operationId: spiffworkflow_backend.routes.process_api_blueprint.status + operationId: spiffworkflow_backend.routes.health_controller.status summary: Returns 200 if the server is Responding tags: - Liveness diff --git a/src/spiffworkflow_backend/routes/health_controller.py b/src/spiffworkflow_backend/routes/health_controller.py new file mode 100644 index 00000000..b513bbe3 --- /dev/null +++ b/src/spiffworkflow_backend/routes/health_controller.py @@ -0,0 +1,12 @@ +"""APIs for dealing with process groups, process models, and process instances.""" +import json +from spiffworkflow_backend.models.process_instance import ProcessInstanceModel +import flask.wrappers + +from flask.wrappers import Response + + +def status() -> flask.wrappers.Response: + """Status.""" + ProcessInstanceModel.query.filter().first() + return Response(json.dumps({"ok": True}), status=200, mimetype="application/json") diff --git a/src/spiffworkflow_backend/routes/process_api_blueprint.py b/src/spiffworkflow_backend/routes/process_api_blueprint.py index 1df431e5..9e2ce52c 100644 --- a/src/spiffworkflow_backend/routes/process_api_blueprint.py +++ b/src/spiffworkflow_backend/routes/process_api_blueprint.py @@ -3,7 +3,6 @@ import json from typing import Any from typing import Dict -import connexion # type: ignore import flask.wrappers import werkzeug from flask import Blueprint @@ -47,12 +46,6 @@ from spiffworkflow_backend.services.service_task_service import ServiceTaskServi process_api_blueprint = Blueprint("process_api", __name__) -def status() -> flask.wrappers.Response: - """Status.""" - ProcessInstanceModel.query.filter().first() - return Response(json.dumps({"ok": True}), status=200, mimetype="application/json") - - def permissions_check(body: Dict[str, Dict[str, list[str]]]) -> flask.wrappers.Response: """Permissions_check.""" if "requests_to_check" not in body: