From 5f052b18fffded9de336d16dcb24a1f7773fa9a4 Mon Sep 17 00:00:00 2001 From: Ray Zhou Date: Wed, 12 Jun 2019 12:07:59 +0800 Subject: [PATCH] Refine logging API docs --- pkg/apis/logging/v1alpha2/register.go | 14 +++++++------- pkg/apis/tenant/v1alpha2/register.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/apis/logging/v1alpha2/register.go b/pkg/apis/logging/v1alpha2/register.go index fd2f9b0dc..ca0be6be8 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)). 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)).