From 5d2ad6ce19ffc3163dce5aee0438cad3349342ef Mon Sep 17 00:00:00 2001 From: Mikolaj Pawlikowski Date: Fri, 12 Mar 2021 13:31:01 +0000 Subject: [PATCH] Also add a total number of nodes in a field for convenience Signed-off-by: Mikolaj Pawlikowski --- pkg/models/cluster_health_results.go | 3 +++ pkg/restapi/embedded_spec.go | 8 ++++++++ swagger.yml | 3 +++ 3 files changed, 14 insertions(+) diff --git a/pkg/models/cluster_health_results.go b/pkg/models/cluster_health_results.go index 63bd1d7..3a7a50b 100644 --- a/pkg/models/cluster_health_results.go +++ b/pkg/models/cluster_health_results.go @@ -33,6 +33,9 @@ type ClusterHealthResults struct { // nodes healthy NodesHealthy []string `json:"nodesHealthy"` + // nodes total + NodesTotal int64 `json:"nodesTotal,omitempty"` + // nodes unhealthy NodesUnhealthy []string `json:"nodesUnhealthy"` } diff --git a/pkg/restapi/embedded_spec.go b/pkg/restapi/embedded_spec.go index ccd5c8d..cc1bc4c 100644 --- a/pkg/restapi/embedded_spec.go +++ b/pkg/restapi/embedded_spec.go @@ -249,6 +249,10 @@ func init() { "type": "string" } }, + "nodesTotal": { + "type": "integer", + "format": "int64" + }, "nodesUnhealthy": { "type": "array", "items": { @@ -576,6 +580,10 @@ func init() { "type": "string" } }, + "nodesTotal": { + "type": "integer", + "format": "int64" + }, "nodesUnhealthy": { "type": "array", "items": { diff --git a/swagger.yml b/swagger.yml index 5676f51..a8ab2fd 100644 --- a/swagger.yml +++ b/swagger.yml @@ -144,6 +144,9 @@ definitions: type: array items: type: string + nodesTotal: + type: integer + format: int64 generated-at: type: string format: date-time