Update components API doc.

This commit is contained in:
Ray Zhou
2019-06-27 18:53:36 +08:00
parent b91c6b66d4
commit 0d07e3ca68

View File

@@ -187,18 +187,18 @@ func addWebService(c *restful.Container) error {
webservice.Route(webservice.GET("/components"). webservice.Route(webservice.GET("/components").
To(components.GetComponents). To(components.GetComponents).
Metadata(restfulspec.KeyOpenAPITags, tags). Metadata(restfulspec.KeyOpenAPITags, tags).
Doc(""). Doc("List the system components.").
Returns(http.StatusOK, ok, map[string]models.Component{})) Returns(http.StatusOK, ok, map[string]models.Component{}))
webservice.Route(webservice.GET("/components/{component}"). webservice.Route(webservice.GET("/components/{component}").
To(components.GetComponentStatus). To(components.GetComponentStatus).
Metadata(restfulspec.KeyOpenAPITags, tags). Metadata(restfulspec.KeyOpenAPITags, tags).
Doc(""). Doc("Describe the specified system component.").
Param(webservice.PathParameter("component", "component name")). Param(webservice.PathParameter("component", "component name")).
Returns(http.StatusOK, ok, models.Component{})) Returns(http.StatusOK, ok, models.Component{}))
webservice.Route(webservice.GET("/componenthealth"). webservice.Route(webservice.GET("/componenthealth").
To(components.GetSystemHealthStatus). To(components.GetSystemHealthStatus).
Metadata(restfulspec.KeyOpenAPITags, tags). Metadata(restfulspec.KeyOpenAPITags, tags).
Doc(""). Doc("Get the health status of system components.").
Returns(http.StatusOK, ok, map[string]int{})) Returns(http.StatusOK, ok, map[string]int{}))
tags = []string{"Quotas"} tags = []string{"Quotas"}