From 36b35c390621eac229d882bc6ae7a1ed7af998a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E9=B9=8F=E9=A3=9E=40yunify?= Date: Fri, 5 Jul 2019 20:34:10 +0800 Subject: [PATCH] refine monitoring metrics API docs and IAM api docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 周鹏飞@yunify --- pkg/apis/operations/v1alpha2/register.go | 2 +- pkg/apis/resources/v1alpha2/register.go | 2 +- pkg/models/status/status.go | 4 ++-- pkg/models/types.go | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/apis/operations/v1alpha2/register.go b/pkg/apis/operations/v1alpha2/register.go index 5b7611e05..4f54a332f 100644 --- a/pkg/apis/operations/v1alpha2/register.go +++ b/pkg/apis/operations/v1alpha2/register.go @@ -43,7 +43,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/nodes/{node}/drainage"). To(operations.DrainNode). Deprecate(). - Doc("Drain node"). + Doc("remove a node from service, safely evict all of your pods from a node and you can power down the node. More info: https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/"). Param(webservice.PathParameter("node", "node name")). Returns(http.StatusOK, ok, errors.Error{})) diff --git a/pkg/apis/resources/v1alpha2/register.go b/pkg/apis/resources/v1alpha2/register.go index 5556001b9..83e863aa4 100644 --- a/pkg/apis/resources/v1alpha2/register.go +++ b/pkg/apis/resources/v1alpha2/register.go @@ -106,7 +106,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.POST("/nodes/{node}/drainage"). To(operations.DrainNode). Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterResourcesTag}). - Doc("Drain node"). + Doc("remove a node from service, safely evict all of your pods from a node and you can power down the node. More info: https://kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/"). Param(webservice.PathParameter("node", "node name")). Returns(http.StatusOK, ok, errors.Error{})) diff --git a/pkg/models/status/status.go b/pkg/models/status/status.go index 040f09499..269726827 100644 --- a/pkg/models/status/status.go +++ b/pkg/models/status/status.go @@ -27,8 +27,8 @@ import ( ) type WorkLoadStatus struct { - Namespace string `json:"namespace" description:"namespace"` - Count map[string]int `json:"data" description:"unhealthy workload count"` + Namespace string `json:"namespace" description:"the name of the namespace"` + Count map[string]int `json:"data" description:"the number of unhealthy workloads"` Items map[string]interface{} `json:"items,omitempty" description:"unhealthy workloads"` } diff --git a/pkg/models/types.go b/pkg/models/types.go index b4c0e95fa..3916d6cb7 100644 --- a/pkg/models/types.go +++ b/pkg/models/types.go @@ -83,16 +83,16 @@ type Group struct { type ComponentStatus struct { Name string `json:"name" description:"component name"` - Namespace string `json:"namespace" description:"namespace"` + Namespace string `json:"namespace" description:"the name of the namespace"` SelfLink string `json:"selfLink" description:"self link"` Label interface{} `json:"label" description:"labels"` StartedAt time.Time `json:"startedAt" description:"started time"` - TotalBackends int `json:"totalBackends" description:"total backends"` - HealthyBackends int `json:"healthyBackends" description:"healthy backends"` + TotalBackends int `json:"totalBackends" description:"the total replicas of each backend system component"` + HealthyBackends int `json:"healthyBackends" description:"the number of healthy backend components"` } type NodeStatus struct { TotalNodes int `json:"totalNodes" description:"total number of nodes"` - HealthyNodes int `json:"healthyNodes" description:"number of healthy nodes"` + HealthyNodes int `json:"healthyNodes" description:"the number of healthy nodes"` } type HealthStatus struct {