diff --git a/pkg/apis/iam/v1alpha2/register.go b/pkg/apis/iam/v1alpha2/register.go index 4fd5312a4..719dd0007 100644 --- a/pkg/apis/iam/v1alpha2/register.go +++ b/pkg/apis/iam/v1alpha2/register.go @@ -212,7 +212,7 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags)) ws.Route(ws.GET("/namespaces/{namespace}/roles/{role}/users"). To(iam.ListRoleUsers). - Doc("This method is used to retrieve the users that are bind the role in the specified namespace."). + Doc("This method is used to retrieve the users that are bound to the role in the specified namespace."). Param(ws.PathParameter("namespace", "kubernetes namespace")). Param(ws.PathParameter("role", "role name")). Returns(http.StatusOK, ok, []models.User{}). @@ -225,7 +225,7 @@ func addWebService(c *restful.Container) error { Metadata(restfulspec.KeyOpenAPITags, tags)) ws.Route(ws.GET("/clusterroles/{clusterrole}/users"). To(iam.ListClusterRoleUsers). - Doc("List all users that are bind the cluster role."). + Doc("List all users that are bound to the specified cluster role."). Param(ws.PathParameter("clusterrole", "cluster role name")). Returns(http.StatusOK, ok, UserList{}). Metadata(restfulspec.KeyOpenAPITags, tags)) diff --git a/pkg/apis/logging/v1alpha2/register.go b/pkg/apis/logging/v1alpha2/register.go index fd2f9b0dc..705579bf4 100644 --- a/pkg/apis/logging/v1alpha2/register.go +++ b/pkg/apis/logging/v1alpha2/register.go @@ -47,9 +47,9 @@ func addWebService(c *restful.Container) error { ws.Route(ws.GET("/cluster").To(logging.LoggingQueryCluster). Filter(filter.Logging). - Doc("Log query against the cluster."). + Doc("Query logs against the cluster."). Param(ws.QueryParameter("operation", "Query operation type. One of query, statistics, histogram.").DataType("string").Required(true)). - Param(ws.QueryParameter("workspaces", "List of workspaces the query will perform against, eg. wk-one,wk-two").DataType("string").Required(false)). + Param(ws.QueryParameter("workspaces", "List of workspaces separated by comma the query will perform against.").DataType("string").Required(false)). Param(ws.QueryParameter("workspace_query", "List of keywords for filtering workspaces. Workspaces whose name contains at least one keyword will be matched for query. Non case-sensitive matching. eg. one,two.").DataType("string").Required(false)). Param(ws.QueryParameter("namespaces", "List of namespaces the query will perform against, eg. ns-one,ns-two").DataType("string").Required(false)). Param(ws.QueryParameter("namespace_query", "List of keywords for filtering namespaces. Namespaces whose name contains at least one keyword will be matched for query. Non case-sensitive matching. eg. one,two.").DataType("string").Required(false)). @@ -74,7 +74,7 @@ func addWebService(c *restful.Container) error { ws.Route(ws.GET("/workspaces/{workspace}").To(logging.LoggingQueryWorkspace). Filter(filter.Logging). - Doc("Log query against a specific workspace."). + Doc("Query logs against a specific workspace."). Param(ws.PathParameter("workspace", "Perform query against a specific workspace.").DataType("string").Required(true)). Param(ws.QueryParameter("operation", "Query operation type. One of query, statistics, histogram.").DataType("string").Required(true)). Param(ws.QueryParameter("namespaces", "List of namespaces the query will perform against, eg. ns-one,ns-two").DataType("string").Required(false)). @@ -100,7 +100,7 @@ func addWebService(c *restful.Container) error { ws.Route(ws.GET("/namespaces/{namespace}").To(logging.LoggingQueryNamespace). Filter(filter.Logging). - Doc("Log query against a specific namespace."). + Doc("Query logs against a specific namespace."). Param(ws.PathParameter("namespace", "Perform query against a specific namespace.").DataType("string").Required(true)). Param(ws.QueryParameter("operation", "Query operation type. One of query, statistics, histogram.").DataType("string").Required(true)). Param(ws.QueryParameter("workloads", "List of workloads the query will perform against, eg. wl-one,wl-two").DataType("string").Required(false)). @@ -124,7 +124,7 @@ func addWebService(c *restful.Container) error { ws.Route(ws.GET("/namespaces/{namespace}/workloads/{workload}").To(logging.LoggingQueryWorkload). Filter(filter.Logging). - Doc("Log query against a specific workload."). + Doc("Query logs against a specific workload."). Param(ws.PathParameter("namespace", "Specify the namespace of the workload.").DataType("string").Required(true)). Param(ws.PathParameter("workload", "Perform query against a specific workload.").DataType("string").Required(true)). Param(ws.QueryParameter("operation", "Query operation type. One of query, statistics, histogram.").DataType("string").Required(true)). @@ -147,7 +147,7 @@ func addWebService(c *restful.Container) error { ws.Route(ws.GET("/namespaces/{namespace}/pods/{pod}").To(logging.LoggingQueryPod). Filter(filter.Logging). - Doc("Log query against a specific pod."). + Doc("Query logs against a specific pod."). Param(ws.PathParameter("namespace", "Specify the namespace of the pod.").DataType("string").Required(true)). Param(ws.PathParameter("pod", "Perform query against a specific pod.").DataType("string").Required(true)). Param(ws.QueryParameter("operation", "Query operation type. One of query, statistics, histogram.").DataType("string").Required(true)). @@ -168,7 +168,7 @@ func addWebService(c *restful.Container) error { ws.Route(ws.GET("/namespaces/{namespace}/pods/{pod}/containers/{container}").To(logging.LoggingQueryContainer). Filter(filter.Logging). - Doc("Log query against a specific container."). + Doc("Query logs against a specific container."). Param(ws.PathParameter("namespace", "Specify the namespace of the pod.").DataType("string").Required(true)). Param(ws.PathParameter("pod", "Specify the pod of the container.").DataType("string").Required(true)). Param(ws.PathParameter("container", "Perform query against a specific container.").DataType("string").Required(true)). @@ -219,7 +219,7 @@ func addWebService(c *restful.Container) error { Consumes(restful.MIME_JSON, restful.MIME_XML). Produces(restful.MIME_JSON) - ws.Route(ws.POST("/fluentbit/outputs/{output}").To(logging.LoggingUpdateFluentbitOutput). + ws.Route(ws.PUT("/fluentbit/outputs/{output}").To(logging.LoggingUpdateFluentbitOutput). Filter(filter.Logging). Doc("Update a Fluent bit output plugin."). Param(ws.PathParameter("output", "ID of the output to update.").DataType("string").Required(true)). diff --git a/pkg/apis/monitoring/v1alpha2/register.go b/pkg/apis/monitoring/v1alpha2/register.go index e80123025..5cfd54887 100644 --- a/pkg/apis/monitoring/v1alpha2/register.go +++ b/pkg/apis/monitoring/v1alpha2/register.go @@ -56,7 +56,7 @@ func addWebService(c *restful.Container) error { Produces(restful.MIME_JSON) ws.Route(ws.GET("/nodes").To(monitoring.MonitorAllNodes). - Doc("Get node-level metrics."). + Doc("Get all nodes' metrics."). Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. node_cpu|node_memory.").DataType("string").Required(false)). Param(ws.QueryParameter("resources_filter", "Node filter in regexp pattern, eg. i-caojnter|i-cmu82ogj.").DataType("string").Required(false)). Param(ws.QueryParameter("sort_metric", "Sort nodes by the specified metric. Valid only if type is rank.").DataType("string").Required(false)). @@ -114,7 +114,7 @@ func addWebService(c *restful.Container) error { Produces(restful.MIME_JSON) ws.Route(ws.GET("/namespaces/{namespace}/pods").To(monitoring.MonitorAllPodsOfSpecificNamespace). - Doc("Get pod-level metrics of a given namespace."). + Doc("Get all pod-level metrics of a given namespace."). Param(ws.PathParameter("namespace", "Specify the target namespace.").DataType("string").Required(true)). Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. pod_cpu|pod_memory.").DataType("string").Required(false)). Param(ws.QueryParameter("resources_filter", "Pods filter in regexp pattern, eg. coredns-77b8449dc9-hd6gd|coredns-77b8449dc9-b4n74.").DataType("string").Required(false)). @@ -145,7 +145,7 @@ func addWebService(c *restful.Container) error { Produces(restful.MIME_JSON) ws.Route(ws.GET("/nodes/{node}/pods").To(monitoring.MonitorAllPodsOnSpecificNode). - Doc("Get metrics of all pod on a specific node."). + Doc("Get metrics of all pods on a specific node."). Param(ws.PathParameter("node", "Specify the target node.").DataType("string").Required(true)). Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. node_cpu|node_memory.").DataType("string").Required(false)). Param(ws.QueryParameter("resources_filter", "Pod filter in regexp pattern, eg. coredns-77b8449dc9-hd6gd|coredns-77b8449dc9-b4n74.").DataType("string").Required(false)). @@ -161,7 +161,7 @@ func addWebService(c *restful.Container) error { Produces(restful.MIME_JSON) ws.Route(ws.GET("/nodes/{node}/pods/{pod}").To(monitoring.MonitorSpecificPodOnSpecificNode). - Doc("Get specific pod metrics under a given namespace."). + Doc("Get specific pod metrics on a specified node."). Param(ws.PathParameter("node", "Specify the target node.").DataType("string").Required(true)). Param(ws.PathParameter("pod", "Specify the target pod.").DataType("string").Required(true)). Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. pod_cpu|pod_memory.").DataType("string").Required(false)). @@ -193,7 +193,7 @@ func addWebService(c *restful.Container) error { Produces(restful.MIME_JSON) ws.Route(ws.GET("/namespaces/{namespace}/pods/{pod}/containers").To(monitoring.MonitorAllContainersOfSpecificNamespace). - Doc("Get container-level metrics under a given namespace and pod."). + Doc("Get all container-level metrics of a given pod."). Param(ws.PathParameter("namespace", "Specify the target namespace.").DataType("string").Required(true)). Param(ws.PathParameter("pod", "Specify the target pod.").DataType("string").Required(true)). Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. container_cpu|container_memory.").DataType("string").Required(false)). @@ -210,7 +210,7 @@ func addWebService(c *restful.Container) error { Produces(restful.MIME_JSON) ws.Route(ws.GET("/namespaces/{namespace}/pods/{pod}/containers/{container}").To(monitoring.MonitorSpecificContainerOfSpecificNamespace). - Doc("Get specific container metrics under a given node and pod."). + Doc("Get specific container metrics of a given pod."). Param(ws.PathParameter("namespace", "Specify the target namespace.").DataType("string").Required(true)). Param(ws.PathParameter("pod", "Specify the target pod.").DataType("string").Required(true)). Param(ws.PathParameter("container", "Specify the target container.").DataType("string").Required(true)). @@ -244,7 +244,7 @@ func addWebService(c *restful.Container) error { Produces(restful.MIME_JSON) ws.Route(ws.GET("/namespaces/{namespace}/workloads/{workload_kind}").To(monitoring.MonitorAllWorkloadsOfSpecificKind). - Doc("Get workload-level metrics of specific workload kind."). + Doc("Get all workload-level metrics of a specific workload kind under a given namespace."). Param(ws.PathParameter("namespace", "Specify the target namespace.").DataType("string").Required(true)). Param(ws.PathParameter("workload_kind", "Specify the target workload kind. One of deployment, daemonset, statefulset. Other values will be interpreted as any of three.").DataType("string").Required(true).DefaultValue("(.*)")). Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. node_cpu|node_memory.").DataType("string").Required(false)). @@ -261,7 +261,7 @@ func addWebService(c *restful.Container) error { Produces(restful.MIME_JSON) ws.Route(ws.GET("/namespaces/{namespace}/workloads").To(monitoring.MonitorAllWorkloadsOfSpecificNamespace). - Doc("Get workload-level metrics under a given namespace."). + Doc("Get all workload-level metrics of a given namespace."). Param(ws.PathParameter("namespace", "Specify the target namespace.").DataType("string").Required(true)). Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. workload_cpu|workload_memory.").DataType("string").Required(false)). Param(ws.QueryParameter("resources_filter", "Workload filter in regexp pattern.").DataType("string").Required(false)). diff --git a/pkg/apis/tenant/v1alpha2/register.go b/pkg/apis/tenant/v1alpha2/register.go index 41391939d..51b4f3ed1 100644 --- a/pkg/apis/tenant/v1alpha2/register.go +++ b/pkg/apis/tenant/v1alpha2/register.go @@ -152,7 +152,7 @@ func addWebService(c *restful.Container) error { To(tenant.LogQuery). Doc("Query cluster-level logs in a multi-tenants environment"). Param(ws.QueryParameter("operation", "Query operation type. One of query, statistics, histogram.").DataType("string").Required(true)). - Param(ws.QueryParameter("workspaces", "List of workspaces the query will perform against, eg. wk-one,wk-two").DataType("string").Required(false)). + Param(ws.QueryParameter("workspaces", "List of workspaces separated by comma the query will perform against.").DataType("string").Required(false)). Param(ws.QueryParameter("workspace_query", "List of keywords for filtering workspaces. Workspaces whose name contains at least one keyword will be matched for query. Non case-sensitive matching. eg. one,two.").DataType("string").Required(false)). Param(ws.QueryParameter("namespaces", "List of namespaces the query will perform against, eg. ns-one,ns-two").DataType("string").Required(false)). Param(ws.QueryParameter("namespace_query", "List of keywords for filtering namespaces. Namespaces whose name contains at least one keyword will be matched for query. Non case-sensitive matching. eg. one,two.").DataType("string").Required(false)).