From 1bee83332659d1d2e5c96a4edf41c1435a625c7e Mon Sep 17 00:00:00 2001 From: RGanor Date: Mon, 23 May 2022 16:46:11 +0000 Subject: [PATCH] Updated the unknown state --- powerdnsadmin/routes/api.py | 2 +- powerdnsadmin/swagger-spec.yaml | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/powerdnsadmin/routes/api.py b/powerdnsadmin/routes/api.py index 6a6d74e..d26deb8 100644 --- a/powerdnsadmin/routes/api.py +++ b/powerdnsadmin/routes/api.py @@ -1191,7 +1191,7 @@ def health(): if not domain_to_query: current_app.logger.error("No domain found to query a health check") - return make_response("Down", 503) + return make_response("Unknown", 503) try: domain.get_domain_info(domain_to_query.name) diff --git a/powerdnsadmin/swagger-spec.yaml b/powerdnsadmin/swagger-spec.yaml index dbf484e..75b1d9f 100644 --- a/powerdnsadmin/swagger-spec.yaml +++ b/powerdnsadmin/swagger-spec.yaml @@ -782,6 +782,32 @@ paths: '422': description: 'Returned when something is wrong with the content of the request. Contains an error message' + '/servers/{server_id}/health': + get: + security: + - APIKeyHeader: [] + summary: Perfoms health check + operationId: health_check + tags: + - Monitoring + parameters: + - name: server_id + in: path + required: true + description: The id of the server to retrieve + type: string + responses: + '200': + description: Healthcheck succeeded + schema: + type: string + example: "up" + '503': + description: Healthcheck failed + schema: + type: string + example: Down/Unknown + '/pdnsadmin/zones': get: security: