diff --git a/pkg/apis/resources/v1alpha2/register.go b/pkg/apis/resources/v1alpha2/register.go index df59250a6..5556001b9 100644 --- a/pkg/apis/resources/v1alpha2/register.go +++ b/pkg/apis/resources/v1alpha2/register.go @@ -252,32 +252,36 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/routers"). To(routers.GetAllRouters). - Doc("List all routers"). + Doc("List all routers of all projects"). Metadata(restfulspec.KeyOpenAPITags, []string{constants.ClusterResourcesTag}). - Returns(http.StatusOK, ok, corev1.Service{})) + Returns(http.StatusOK, ok, corev1.ServiceList{})) webservice.Route(webservice.GET("/namespaces/{namespace}/router"). To(routers.GetRouter). Doc("List router of a specified project"). Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). + Returns(http.StatusOK, ok, corev1.Service{}). Param(webservice.PathParameter("namespace", "the name of the project"))) webservice.Route(webservice.DELETE("/namespaces/{namespace}/router"). To(routers.DeleteRouter). Doc("List router of a specified project"). Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). + Returns(http.StatusOK, ok, corev1.Service{}). Param(webservice.PathParameter("namespace", "the name of the project"))) webservice.Route(webservice.POST("/namespaces/{namespace}/router"). To(routers.CreateRouter). Doc("Create a router for a specified project"). Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). + Returns(http.StatusOK, ok, corev1.Service{}). Param(webservice.PathParameter("namespace", "the name of the project"))) webservice.Route(webservice.PUT("/namespaces/{namespace}/router"). To(routers.UpdateRouter). Doc("Update a router for a specified project"). Metadata(restfulspec.KeyOpenAPITags, []string{constants.NamespaceResourcesTag}). + Returns(http.StatusOK, ok, corev1.Service{}). Param(webservice.PathParameter("namespace", "the name of the project"))) webservice.Route(webservice.GET("/abnormalworkloads"). diff --git a/pkg/apis/servicemesh/metrics/v1alpha2/register.go b/pkg/apis/servicemesh/metrics/v1alpha2/register.go index 6c1b27b3e..7b358ab4c 100644 --- a/pkg/apis/servicemesh/metrics/v1alpha2/register.go +++ b/pkg/apis/servicemesh/metrics/v1alpha2/register.go @@ -96,7 +96,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/namespaces/{namespace}/metrics"). To(metrics.GetNamespaceMetrics). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get workload metrics from a specific namespace"). + Doc("Get metrics from a specific namespace"). Param(webservice.PathParameter("namespace", "name of the namespace").Required(true)). Param(webservice.PathParameter("service", "name of the service")). Param(webservice.QueryParameter("filters[]", "type of metrics type, fetch all metrics when empty, e.g. request_count, request_duration, request_error_count").DefaultValue("[]")). @@ -175,7 +175,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/namespaces/{namespace}/apps/{app}/health"). To(metrics.GetAppHealth). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get workload health"). + Doc("Get app health"). Param(webservice.PathParameter("namespace", "name of a namespace").Required(true)). Param(webservice.PathParameter("app", "app name").Required(true)). Param(webservice.QueryParameter("rateInterval", "the rate interval used for fetching error rate").DefaultValue("10m").Required(true)). @@ -187,7 +187,7 @@ func addWebService(c *restful.Container) error { webservice.Route(webservice.GET("/namespaces/{namespace}/services/{service}/health"). To(metrics.GetServiceHealth). Metadata(restfulspec.KeyOpenAPITags, tags). - Doc("Get workload health"). + Doc("Get service health"). Param(webservice.PathParameter("namespace", "name of a namespace").Required(true)). Param(webservice.PathParameter("service", "service name").Required(true)). Param(webservice.QueryParameter("rateInterval", "the rate interval used for fetching error rate").DefaultValue("10m").Required(true)).