update api doc

Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
hongming
2019-06-06 18:35:57 +08:00
committed by zryfish
parent dd87197de3
commit 468ef322d1
12 changed files with 190 additions and 110 deletions

View File

@@ -26,14 +26,14 @@ import (
"kubesphere.io/kubesphere/pkg/models/resources"
)
type workLoadStatus struct {
Namespace string `json:"namespace"`
Count map[string]int `json:"data"`
Items map[string]interface{} `json:"items,omitempty"`
type WorkLoadStatus struct {
Namespace string `json:"namespace" description:"namespace"`
Count map[string]int `json:"data" description:"unhealthy workload count"`
Items map[string]interface{} `json:"items,omitempty" description:"unhealthy workloads"`
}
func GetNamespacesResourceStatus(namespace string) (*workLoadStatus, error) {
res := workLoadStatus{Count: make(map[string]int), Namespace: namespace, Items: make(map[string]interface{})}
func GetNamespacesResourceStatus(namespace string) (*WorkLoadStatus, error) {
res := WorkLoadStatus{Count: make(map[string]int), Namespace: namespace, Items: make(map[string]interface{})}
var notReadyList *models.PageableResponse
var err error
for _, resource := range []string{resources.Deployments, resources.StatefulSets, resources.DaemonSets, resources.PersistentVolumeClaims, resources.Jobs} {
@@ -61,7 +61,7 @@ func GetNamespacesResourceStatus(namespace string) (*workLoadStatus, error) {
return &res, nil
}
func GetClusterResourceStatus() (*workLoadStatus, error) {
func GetClusterResourceStatus() (*WorkLoadStatus, error) {
return GetNamespacesResourceStatus("")
}