From 2d211cd4c2a719d3435f7676d2f5580fccf169f4 Mon Sep 17 00:00:00 2001 From: NagyZoltanPeter <113987313+NagyZoltanPeter@users.noreply.github.com> Date: Wed, 24 Apr 2024 12:08:32 +0200 Subject: [PATCH] Adapt reference for /health to the latest refactoring ... --- api-spec/healthapi.yaml | 11 +++++------ api-spec/openapi.yaml | 2 +- api-spec/schemas/apitypes.yaml | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 7 deletions(-) diff --git a/api-spec/healthapi.yaml b/api-spec/healthapi.yaml index 6bd5400..5763162 100644 --- a/api-spec/healthapi.yaml +++ b/api-spec/healthapi.yaml @@ -1,17 +1,16 @@ get: summary: Get node health status - description: Retrieve readiness of a Waku v2 node. + description: Retrieve status of a Waku v2 node. operationId: healthcheck tags: - health responses: '200': - description: Waku v2 node is up and running. + description: Health report of a Waku v2 node and its protocols. content: - text/plain: - schema: - type: string - example: Node is healty + application/json: + schema: + $ref: "./schemas/apitypes.yaml#/HealthReport" '500': description: Internal server error content: diff --git a/api-spec/openapi.yaml b/api-spec/openapi.yaml index 7649f65..87701ea 100644 --- a/api-spec/openapi.yaml +++ b/api-spec/openapi.yaml @@ -1,4 +1,4 @@ -openapi: 3.0.3 +openapi: 3.1.0 info: title: Waku V2 node REST API version: 1.0.0 diff --git a/api-spec/schemas/apitypes.yaml b/api-spec/schemas/apitypes.yaml index 50f3ef0..58954ec 100644 --- a/api-spec/schemas/apitypes.yaml +++ b/api-spec/schemas/apitypes.yaml @@ -252,3 +252,26 @@ FilterSubscription: type: string contentTopic: type: string + +HealthStatus: + type: string + enum: + - "Initializing" + - "Synchronizing" + - "Ready" + - "Not Ready" + - "Not Mounted" + - "Shutting Down" + +HealthReport: + type: object + properties: + nodeHealth: + $ref: '#/HealthStatus' + description: Overall health status of the node + protocolsHealth: + type: array + items: + type: object + additionalProperties: + $ref: '#/HealthStatus'