Refine logging API docs

This commit is contained in:
Ray Zhou
2019-06-12 12:07:59 +08:00
committed by zryfish
parent a711ac9a75
commit 5f052b18ff
2 changed files with 8 additions and 8 deletions

View File

@@ -47,9 +47,9 @@ func addWebService(c *restful.Container) error {
ws.Route(ws.GET("/cluster").To(logging.LoggingQueryCluster). ws.Route(ws.GET("/cluster").To(logging.LoggingQueryCluster).
Filter(filter.Logging). 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("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("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("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)). 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). ws.Route(ws.GET("/workspaces/{workspace}").To(logging.LoggingQueryWorkspace).
Filter(filter.Logging). 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.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("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)). 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). ws.Route(ws.GET("/namespaces/{namespace}").To(logging.LoggingQueryNamespace).
Filter(filter.Logging). 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.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("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)). 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). ws.Route(ws.GET("/namespaces/{namespace}/workloads/{workload}").To(logging.LoggingQueryWorkload).
Filter(filter.Logging). 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("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.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)). 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). ws.Route(ws.GET("/namespaces/{namespace}/pods/{pod}").To(logging.LoggingQueryPod).
Filter(filter.Logging). 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("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.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)). 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). ws.Route(ws.GET("/namespaces/{namespace}/pods/{pod}/containers/{container}").To(logging.LoggingQueryContainer).
Filter(filter.Logging). 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("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("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)). Param(ws.PathParameter("container", "Perform query against a specific container.").DataType("string").Required(true)).

View File

@@ -152,7 +152,7 @@ func addWebService(c *restful.Container) error {
To(tenant.LogQuery). To(tenant.LogQuery).
Doc("Query cluster-level logs in a multi-tenants environment"). 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("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("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("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)). 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)).