Merge pull request #494 from huanggze/api-fix
api docs: refine logging api description
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
@@ -49,21 +49,21 @@ func addWebService(c *restful.Container) error {
|
||||
Filter(filter.Logging).
|
||||
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 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)).
|
||||
Param(ws.QueryParameter("workloads", "List of workloads the query will perform against, eg. wl-one,wl-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("workload_query", "List of keywords for filtering workloads. Workloads 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("pods", "List of pods the query will perform against, eg. pod-one,pod-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pod_query", "List of keywords for filtering pods. Pods 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("containers", "List of containers the query will perform against, eg. container-one,container-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords for filtering containers. Containers 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("log_query", "List of keywords for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").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, separated by comma, for filtering workspaces. Workspaces whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("namespaces", "List of namespaces, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("namespace_query", "List of keywords, separated by comma, for filtering namespaces. Namespaces whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("workloads", "List of workloads, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("workload_query", "List of keywords, separated by comma, for filtering workloads. Workloads whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pods", "List of pods, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pod_query", "List of keywords, separated by comma, for filtering pods. Pods whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("containers", "List of containers, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords, separated by comma, for filtering containers. Containers whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("log_query", "List of keywords, separated by comma, for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("interval", "Count logs at intervals. Valid only if operation is histogram. The unit can be ms(milliseconds), s(seconds), m(minutes), h(hours), d(days), w(weeks), M(months), q(quarters), y(years). eg. 30m.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort log by time. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start of query range. Default to 0. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End of query range. Default to now. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort logs by timestamp. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("from", "Beginning index of result to return. Use this option together with size.").DataType("integer").DefaultValue("0").Required(false)).
|
||||
Param(ws.QueryParameter("size", "Size of result to return.").DataType("integer").DefaultValue("10").Required(false)).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
|
||||
@@ -77,19 +77,19 @@ func addWebService(c *restful.Container) error {
|
||||
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)).
|
||||
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("workloads", "List of workloads the query will perform against, eg. wl-one,wl-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("workload_query", "List of keywords for filtering workloads. Workloads 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("pods", "List of pods the query will perform against, eg. pod-one,pod-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pod_query", "List of keywords for filtering pods. Pods 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("containers", "List of containers the query will perform against, eg. container-one,container-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords for filtering containers. Containers 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("log_query", "List of keywords for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("namespaces", "List of namespaces, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("namespace_query", "List of keywords, separated by comma, for filtering namespaces. Namespaces whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("workloads", "List of workloads, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("workload_query", "List of keywords, separated by comma, for filtering workloads. Workloads whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pods", "List of pods, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pod_query", "List of keywords, separated by comma, for filtering pods. Pods whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("containers", "List of containers, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords, separated by comma, for filtering containers. Containers whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("log_query", "List of keywords, separated by comma, for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("interval", "Count logs at intervals. Valid only if operation is histogram. The unit can be ms(milliseconds), s(seconds), m(minutes), h(hours), d(days), w(weeks), M(months), q(quarters), y(years). eg. 30m.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort log by time. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start of query range. Default to 0. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End of query range. Default to now. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort logs by timestamp. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("from", "Beginning index of result to return. Use this option together with size.").DataType("integer").DefaultValue("0").Required(false)).
|
||||
Param(ws.QueryParameter("size", "Size of result to return.").DataType("integer").DefaultValue("10").Required(false)).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
|
||||
@@ -103,17 +103,17 @@ func addWebService(c *restful.Container) error {
|
||||
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)).
|
||||
Param(ws.QueryParameter("workload_query", "List of keywords for filtering workloads. Workloads 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("pods", "List of pods the query will perform against, eg. pod-one,pod-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pod_query", "List of keywords for filtering pods. Pods 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("containers", "List of containers the query will perform against, eg. container-one,container-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords for filtering containers. Containers 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("log_query", "List of keywords for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("workloads", "List of workloads, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("workload_query", "List of keywords, separated by comma, for filtering workloads. Workloads whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pods", "List of pods, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pod_query", "List of keywords, separated by comma, for filtering pods. Pods whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("containers", "List of containers, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords, separated by comma, for filtering containers. Containers whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("log_query", "List of keywords, separated by comma, for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("interval", "Count logs at intervals. Valid only if operation is histogram. The unit can be ms(milliseconds), s(seconds), m(minutes), h(hours), d(days), w(weeks), M(months), q(quarters), y(years). eg. 30m.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort log by time. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start of query range. Default to 0. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End of query range. Default to now. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort logs by timestamp. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("from", "Beginning index of result to return. Use this option together with size.").DataType("integer").DefaultValue("0").Required(false)).
|
||||
Param(ws.QueryParameter("size", "Size of result to return.").DataType("integer").DefaultValue("10").Required(false)).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
|
||||
@@ -128,15 +128,15 @@ func addWebService(c *restful.Container) error {
|
||||
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)).
|
||||
Param(ws.QueryParameter("pods", "List of pods the query will perform against, eg. pod-one,pod-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pod_query", "List of keywords for filtering pods. Pods 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("containers", "List of containers the query will perform against, eg. container-one,container-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords for filtering containers. Containers 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("log_query", "List of keywords for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pods", "List of pods, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("pod_query", "List of keywords, separated by comma, for filtering pods. Pods whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("containers", "List of containers, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords, separated by comma, for filtering containers. Containers whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("log_query", "List of keywords, separated by comma, for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("interval", "Count logs at intervals. Valid only if operation is histogram. The unit can be ms(milliseconds), s(seconds), m(minutes), h(hours), d(days), w(weeks), M(months), q(quarters), y(years). eg. 30m.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort log by time. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start of query range. Default to 0. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End of query range. Default to now. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort logs by timestamp. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("from", "Beginning index of result to return. Use this option together with size.").DataType("integer").DefaultValue("0").Required(false)).
|
||||
Param(ws.QueryParameter("size", "Size of result to return.").DataType("integer").DefaultValue("10").Required(false)).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
|
||||
@@ -151,13 +151,13 @@ func addWebService(c *restful.Container) error {
|
||||
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)).
|
||||
Param(ws.QueryParameter("containers", "List of containers the query will perform against, eg. container-one,container-two").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords for filtering containers. Containers 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("log_query", "List of keywords for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("containers", "List of containers, separated by comma, the query will perform against.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("container_query", "List of keywords, separated by comma, for filtering containers. Containers whose name contains at least one keyword will be matched for query. Non case-sensitive matching.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("log_query", "List of keywords, separated by comma, for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("interval", "Count logs at intervals. Valid only if operation is histogram. The unit can be ms(milliseconds), s(seconds), m(minutes), h(hours), d(days), w(weeks), M(months), q(quarters), y(years). eg. 30m.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort log by time. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start of query range. Default to 0. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End of query range. Default to now. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort logs by timestamp. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("from", "Beginning index of result to return. Use this option together with size.").DataType("integer").DefaultValue("0").Required(false)).
|
||||
Param(ws.QueryParameter("size", "Size of result to return.").DataType("integer").DefaultValue("10").Required(false)).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
|
||||
@@ -173,11 +173,11 @@ func addWebService(c *restful.Container) error {
|
||||
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.QueryParameter("operation", "Query operation type. One of query, statistics, histogram.").DataType("string").Required(true)).
|
||||
Param(ws.QueryParameter("log_query", "List of keywords for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("log_query", "List of keywords, separated by comma, for filtering logs. The query returns log containing at least one keyword. Non case-sensitive matching. eg. err,INFO.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("interval", "Count logs at intervals. Valid only if operation is histogram. The unit can be ms(milliseconds), s(seconds), m(minutes), h(hours), d(days), w(weeks), M(months), q(quarters), y(years). eg. 30m.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End time of query range, eg. 1559664000000.").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort log by time. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("start_time", "Start of query range. Default to 0. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("end_time", "End of query range. Default to now. This option accepts built-in formats supported by Elasticsearch, such as epoch_millis (eg. 1559664000000).").DataType("string").Required(false)).
|
||||
Param(ws.QueryParameter("sort", "Sort logs by timestamp. One of acs, desc.").DataType("string").DefaultValue("desc").Required(false)).
|
||||
Param(ws.QueryParameter("from", "Beginning index of result to return. Use this option together with size.").DataType("integer").DefaultValue("0").Required(false)).
|
||||
Param(ws.QueryParameter("size", "Size of result to return.").DataType("integer").DefaultValue("10").Required(false)).
|
||||
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
|
||||
|
||||
@@ -285,11 +285,12 @@ func createQueryRequest(param QueryParameters) (int, []byte, error) {
|
||||
return operation, queryRequest, err
|
||||
}
|
||||
|
||||
// Fore more info, refer to https://www.elastic.co/guide/en/elasticsearch/reference/current/getting-started-search-API.html
|
||||
type Response struct {
|
||||
Status int `json:"status" description:"query status"`
|
||||
Workspace string `json:"workspace,omitempty" description:"workspace the query was performed against"`
|
||||
Shards Shards `json:"_shards" description:"tells shard information"`
|
||||
Hits Hits `json:"hits" description:"search results"`
|
||||
Hits Hits `json:"hits" description:"query results"`
|
||||
Aggregations json.RawMessage `json:"aggregations" description:"aggregation results"`
|
||||
}
|
||||
|
||||
@@ -306,15 +307,15 @@ type Hits struct {
|
||||
}
|
||||
|
||||
type Hit struct {
|
||||
Source Source `json:"_source" description:"search result item"`
|
||||
HighLight HighLight `json:"highlight" description:"highlighted log fragment"`
|
||||
Source Source `json:"_source" description:"a search result"`
|
||||
HighLight HighLight `json:"highlight" description:"highlighted log information"`
|
||||
Sort []int64 `json:"sort" description:"sort key for results"`
|
||||
}
|
||||
|
||||
type Source struct {
|
||||
Log string `json:"log" description:"the log message"`
|
||||
Log string `json:"log" description:"log message"`
|
||||
Time string `json:"time" description:"log timestamp"`
|
||||
Kubernetes Kubernetes `json:"kubernetes" description:"kubernetes addon information on the log"`
|
||||
Kubernetes Kubernetes `json:"kubernetes" description:"kubernetes information"`
|
||||
}
|
||||
|
||||
type Kubernetes struct {
|
||||
|
||||
@@ -72,16 +72,16 @@ type Plugin struct {
|
||||
// Fluent-bit output plugins
|
||||
type OutputPlugin struct {
|
||||
Plugin
|
||||
Id string `json:"id,omitempty" description:"output plugin uuid"`
|
||||
Enable bool `json:"enable" description:"current output plugin status, one of true, false"`
|
||||
Updatetime time.Time `json:"updatetime,omitempty" description:"last updatetime of the output plugin"`
|
||||
Id string `json:"id,omitempty" description:"output uuid"`
|
||||
Enable bool `json:"enable" description:"active status, one of true, false"`
|
||||
Updatetime time.Time `json:"updatetime,omitempty" description:"last updatetime"`
|
||||
}
|
||||
|
||||
// Parameter generic parameter type to handle values from different sources
|
||||
type Parameter struct {
|
||||
Name string `json:"name" description:"configuration parameter key, eg. Name. refer to fluent bit official doc for more information."`
|
||||
Name string `json:"name" description:"configuration parameter key, eg. Name. refer to Fluent bit's Output Plugins Section for more configuration parameters."`
|
||||
ValueFrom *ValueFrom `json:"valueFrom,omitempty"`
|
||||
Value string `json:"value" description:"configuration parameter value, eg. es. refer to fluent bit official doc for more information."`
|
||||
Value string `json:"value" description:"configuration parameter value, eg. es. refer to Fluent bit's Output Plugins Section for more configuration parameters."`
|
||||
}
|
||||
|
||||
// ValueFrom generic type to determine value origin
|
||||
|
||||
Reference in New Issue
Block a user