From 523549577c5ad416a6d9558ccf2ddf439b16bc01 Mon Sep 17 00:00:00 2001 From: Andrey Golev Date: Thu, 5 Mar 2020 15:39:04 +0200 Subject: [PATCH] swagger added. Response output renamed --- dkron/api.go | 2 +- website/content/swagger.yaml | 12 ++++++++++++ website/content/v1.2/swagger.yaml | 12 ++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) diff --git a/dkron/api.go b/dkron/api.go index 41670d34e..526a380d1 100644 --- a/dkron/api.go +++ b/dkron/api.go @@ -255,7 +255,7 @@ func (h *HTTPTransport) isLeaderHandler(c *gin.Context) { if isleader { renderJSON(c, http.StatusOK, "I am a leader") } else { - renderJSON(c, http.StatusNotFound, "I am not a leader") + renderJSON(c, http.StatusNotFound, "I am a follower") } } diff --git a/website/content/swagger.yaml b/website/content/swagger.yaml index 0cb3a01fc..fddf58a2d 100644 --- a/website/content/swagger.yaml +++ b/website/content/swagger.yaml @@ -173,6 +173,18 @@ paths: description: Successful response schema: $ref: '#/definitions/member' + /isleader: + get: + description: | + Check if node is a leader or follower. + operationId: getIsLeader + tags: + - default + responses: + 200: + description: Node is a leader + 404: + description: Node is a follower /leave: post: description: | diff --git a/website/content/v1.2/swagger.yaml b/website/content/v1.2/swagger.yaml index e4e66d82a..5030f6010 100644 --- a/website/content/v1.2/swagger.yaml +++ b/website/content/v1.2/swagger.yaml @@ -166,6 +166,18 @@ paths: description: Successful response schema: $ref: '#/definitions/member' + /isleader: + get: + description: | + Check if node is a leader or follower. + operationId: getIsLeader + tags: + - default + responses: + 200: + description: Node is a leader + 404: + description: Node is a follower /leave: get: description: |