未验证 提交 bda43378 编写于 作者: R rayzhou2017 提交者: GitHub

Merge pull request #567 from FeynmanZhou/api-docs1

refine components API and drain node API docs
...@@ -43,7 +43,7 @@ func addWebService(c *restful.Container) error { ...@@ -43,7 +43,7 @@ func addWebService(c *restful.Container) error {
webservice.Route(webservice.POST("/nodes/{node}/drainage"). webservice.Route(webservice.POST("/nodes/{node}/drainage").
To(operations.DrainNode). To(operations.DrainNode).
Deprecate(). 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")). Param(webservice.PathParameter("node", "node name")).
Returns(http.StatusOK, ok, errors.Error{})) Returns(http.StatusOK, ok, errors.Error{}))
......
...@@ -106,7 +106,7 @@ func addWebService(c *restful.Container) error { ...@@ -106,7 +106,7 @@ func addWebService(c *restful.Container) error {
webservice.Route(webservice.POST("/nodes/{node}/drainage"). webservice.Route(webservice.POST("/nodes/{node}/drainage").
To(operations.DrainNode). To(operations.DrainNode).
Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterResourcesTag}). 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")). Param(webservice.PathParameter("node", "node name")).
Returns(http.StatusOK, ok, errors.Error{})) Returns(http.StatusOK, ok, errors.Error{}))
......
...@@ -27,8 +27,8 @@ import ( ...@@ -27,8 +27,8 @@ import (
) )
type WorkLoadStatus struct { type WorkLoadStatus struct {
Namespace string `json:"namespace" description:"namespace"` Namespace string `json:"namespace" description:"the name of the namespace"`
Count map[string]int `json:"data" description:"unhealthy workload count"` Count map[string]int `json:"data" description:"the number of unhealthy workloads"`
Items map[string]interface{} `json:"items,omitempty" description:"unhealthy workloads"` Items map[string]interface{} `json:"items,omitempty" description:"unhealthy workloads"`
} }
......
...@@ -83,16 +83,16 @@ type Group struct { ...@@ -83,16 +83,16 @@ type Group struct {
type ComponentStatus struct { type ComponentStatus struct {
Name string `json:"name" description:"component name"` 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"` SelfLink string `json:"selfLink" description:"self link"`
Label interface{} `json:"label" description:"labels"` Label interface{} `json:"label" description:"labels"`
StartedAt time.Time `json:"startedAt" description:"started time"` StartedAt time.Time `json:"startedAt" description:"started time"`
TotalBackends int `json:"totalBackends" description:"total backends"` TotalBackends int `json:"totalBackends" description:"the total replicas of each backend system component"`
HealthyBackends int `json:"healthyBackends" description:"healthy backends"` HealthyBackends int `json:"healthyBackends" description:"the number of healthy backend components"`
} }
type NodeStatus struct { type NodeStatus struct {
TotalNodes int `json:"totalNodes" description:"total number of nodes"` 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 { type HealthStatus struct {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册