refactor component api

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-06-28 18:15:46 +08:00
committed by zryfish
parent e72b880b18
commit d37d67d82b
3 changed files with 41 additions and 42 deletions

View File

@@ -81,7 +81,7 @@ type Group struct {
Description string `json:"description"`
}
type Component struct {
type ComponentStatus struct {
Name string `json:"name" description:"component name"`
Namespace string `json:"namespace" description:"namespace"`
SelfLink string `json:"selfLink" description:"self link"`
@@ -90,6 +90,16 @@ type Component struct {
TotalBackends int `json:"totalBackends" description:"total backends"`
HealthyBackends int `json:"healthyBackends" description:"healthy backends"`
}
type NodeStatus struct {
TotalNodes int `json:"totalNodes" description:"total number of nodes"`
HealthyNodes int `json:"healthyNodes" description:"number of healthy nodes"`
}
type HealthStatus struct {
KubeSphereComponents []ComponentStatus `json:"kubesphereStatus" description:"kubesphere components status"`
KubernetesComponents []corev1.ComponentStatus `json:"kubernetesStatus" description:"kubernetes components status"`
NodeStatus NodeStatus `json:"nodeStatus" description:"nodes status"`
}
type PodInfo struct {
Namespace string `json:"namespace" description:"namespace"`