mirror of
https://github.com/bloomberg/goldpinger.git
synced 2026-02-14 18:09:50 +00:00
@@ -19,9 +19,6 @@ import (
|
||||
// swagger:model ClusterHealthResults
|
||||
type ClusterHealthResults struct {
|
||||
|
||||
// DNS
|
||||
DNS []string `json:"DNS"`
|
||||
|
||||
// o k
|
||||
// Required: true
|
||||
OK bool `json:"OK"`
|
||||
@@ -33,17 +30,11 @@ type ClusterHealthResults struct {
|
||||
// Format: date-time
|
||||
GeneratedAt strfmt.DateTime `json:"generated-at,omitempty"`
|
||||
|
||||
// hosts healthy
|
||||
HostsHealthy []string `json:"hostsHealthy"`
|
||||
// nodes healthy
|
||||
NodesHealthy []string `json:"nodesHealthy"`
|
||||
|
||||
// hosts unhealthy
|
||||
HostsUnhealthy []string `json:"hostsUnhealthy"`
|
||||
|
||||
// pods healthy
|
||||
PodsHealthy []string `json:"podsHealthy"`
|
||||
|
||||
// pods unhealthy
|
||||
PodsUnhealthy []string `json:"podsUnhealthy"`
|
||||
// nodes unhealthy
|
||||
NodesUnhealthy []string `json:"nodesUnhealthy"`
|
||||
}
|
||||
|
||||
// Validate validates this cluster health results
|
||||
|
||||
@@ -104,8 +104,8 @@ func configureAPI(api *operations.GoldpingerAPI) http.Handler {
|
||||
)
|
||||
defer cancel()
|
||||
|
||||
ok, payload := goldpinger.CheckCluster(ctx)
|
||||
if ok {
|
||||
payload := goldpinger.CheckCluster(ctx)
|
||||
if payload.OK {
|
||||
return operations.NewClusterHealthOK().WithPayload(payload)
|
||||
} else {
|
||||
return operations.NewClusterHealthServiceUnavailable().WithPayload(payload)
|
||||
|
||||
@@ -231,12 +231,6 @@ func init() {
|
||||
"OK"
|
||||
],
|
||||
"properties": {
|
||||
"DNS": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"OK": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
@@ -249,25 +243,13 @@ func init() {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"hostsHealthy": {
|
||||
"nodesHealthy": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"hostsUnhealthy": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"podsHealthy": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"podsUnhealthy": {
|
||||
"nodesUnhealthy": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
@@ -576,12 +558,6 @@ func init() {
|
||||
"OK"
|
||||
],
|
||||
"properties": {
|
||||
"DNS": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"OK": {
|
||||
"type": "boolean",
|
||||
"default": false
|
||||
@@ -594,25 +570,13 @@ func init() {
|
||||
"type": "string",
|
||||
"format": "date-time"
|
||||
},
|
||||
"hostsHealthy": {
|
||||
"nodesHealthy": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"hostsUnhealthy": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"podsHealthy": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"podsUnhealthy": {
|
||||
"nodesUnhealthy": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
|
||||
Reference in New Issue
Block a user