未验证 提交 370c3848 编写于 作者: G Guangzhe Huang 提交者: GitHub

Merge pull request #482 from huanggze/api-tag

api: add tags to monitoring and logging apis for classififcation
......@@ -44,7 +44,6 @@ var (
func addWebService(c *restful.Container) error {
ws := runtime.NewWebService(GroupVersion)
tags := []string{"Logging"}
ws.Route(ws.GET("/cluster").To(logging.LoggingQueryCluster).
Filter(filter.Logging).
......@@ -67,7 +66,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort", "Sort log by time. 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, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
Writes(esclient.Response{}).
Returns(http.StatusOK, RespOK, esclient.Response{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -93,7 +92,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort", "Sort log by time. 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, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
Writes(esclient.Response{}).
Returns(http.StatusOK, RespOK, esclient.Response{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -117,7 +116,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort", "Sort log by time. 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, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
Writes(esclient.Response{}).
Returns(http.StatusOK, RespOK, esclient.Response{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -140,7 +139,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort", "Sort log by time. 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, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
Writes(esclient.Response{}).
Returns(http.StatusOK, RespOK, esclient.Response{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -161,7 +160,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort", "Sort log by time. 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, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
Writes(esclient.Response{}).
Returns(http.StatusOK, RespOK, esclient.Response{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -181,7 +180,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort", "Sort log by time. 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, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "query"}).
Writes(esclient.Response{}).
Returns(http.StatusOK, RespOK, esclient.Response{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -190,21 +189,21 @@ func addWebService(c *restful.Container) error {
ws.Route(ws.GET("/fluentbit/filters").To(logging.LoggingQueryFluentbitFilters).
Filter(filter.Logging).
Doc("List all Fluent bit filter plugins. This API is work-in-process.").
Metadata(restfulspec.KeyOpenAPITags, tags)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "setting"})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
Produces(restful.MIME_JSON)
ws.Route(ws.POST("/fluentbit/filters").To(logging.LoggingUpdateFluentbitFilters).
Filter(filter.Logging).
Doc("Add a new Fluent bit filter plugin. This API is work-in-process.").
Metadata(restfulspec.KeyOpenAPITags, tags)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "setting"})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
Produces(restful.MIME_JSON)
ws.Route(ws.GET("/fluentbit/outputs").To(logging.LoggingQueryFluentbitOutputs).
Filter(filter.Logging).
Doc("List all Fluent bit output plugins.").
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "setting"}).
Writes(log.FluentbitOutputsResult{}).
Returns(http.StatusOK, RespOK, log.FluentbitOutputsResult{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -213,7 +212,7 @@ func addWebService(c *restful.Container) error {
ws.Route(ws.POST("/fluentbit/outputs").To(logging.LoggingInsertFluentbitOutput).
Filter(filter.Logging).
Doc("Add a new Fluent bit output plugin.").
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "setting"}).
Reads(fluentbitclient.OutputPlugin{}).
Writes(log.FluentbitOutputsResult{}).
Returns(http.StatusOK, RespOK, log.FluentbitOutputsResult{})).
......@@ -224,7 +223,7 @@ func addWebService(c *restful.Container) error {
Filter(filter.Logging).
Doc("Update a Fluent bit output plugin.").
Param(ws.PathParameter("output", "ID of the output to update.").DataType("string").Required(true)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "setting"}).
Reads(fluentbitclient.OutputPlugin{}).
Writes(log.FluentbitOutputsResult{}).
Returns(http.StatusOK, RespOK, log.FluentbitOutputsResult{})).
......@@ -235,7 +234,7 @@ func addWebService(c *restful.Container) error {
Filter(filter.Logging).
Doc("Delete a Fluent bit output plugin.").
Param(ws.PathParameter("output", "ID of the output to delete.").DataType("string").Required(true)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Logging", "setting"}).
Writes(log.FluentbitOutputsResult{}).
Returns(http.StatusOK, RespOK, log.FluentbitOutputsResult{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......
......@@ -42,8 +42,6 @@ var (
func addWebService(c *restful.Container) error {
ws := runtime.NewWebService(GroupVersion)
tags := []string{"Monitoring"}
ws.Route(ws.GET("/cluster").To(monitoring.MonitorCluster).
Doc("Get cluster-level metrics.").
Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. cluster_cpu|cluster_memory.").DataType("string").Required(false)).
......@@ -51,7 +49,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("start", "Used to get metrics over a range of time. Start time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("end", "Used to get metrics over a range of time. End time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("time", "Used to get metrics at a given time point. eg. 1559762729.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "cluster"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -65,8 +63,8 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort_type", "Sorting order, one of asc, desc. Valid only if type is rank.").DefaultValue("desc.").DataType("string").Required(false)).
Param(ws.QueryParameter("page", "The number of paged results per metric. Default to return the whole metrics.").DataType("integer").Required(false).DefaultValue("1")).
Param(ws.QueryParameter("limit", "Max count of items per page.").DataType("integer").Required(false).DefaultValue("5")).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistic.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistics.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "node"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -80,7 +78,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("start", "Used to get metrics over a range of time. Start time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("end", "Used to get metrics over a range of time. End time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("time", "Used to get metrics at a given time point. eg. 1559762729.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "node"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -94,8 +92,8 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort_type", "Sorting order, one of asc, desc. Valid only if type is rank.").DefaultValue("desc.").DataType("string").Required(false)).
Param(ws.QueryParameter("page", "The number of paged results per metric. Default to return the whole metrics.").DataType("integer").Required(false).DefaultValue("1")).
Param(ws.QueryParameter("limit", "Max count of items per page.").DataType("integer").Required(false).DefaultValue("5")).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistic.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistics.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "namespace"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -109,7 +107,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("start", "Used to get metrics over a range of time. Start time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("end", "Used to get metrics over a range of time. End time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("time", "Used to get metrics at a given time point. eg. 1559762729.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "namespace"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -124,8 +122,8 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort_type", "Sorting order, one of asc, desc. Valid only if type is rank.").DefaultValue("desc.").DataType("string").Required(false)).
Param(ws.QueryParameter("page", "The number of paged results per metric. Default to return the whole metrics.").DataType("integer").Required(false).DefaultValue("1")).
Param(ws.QueryParameter("limit", "Max count of items per page.").DataType("integer").Required(false).DefaultValue("5")).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistic.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistics.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "pod"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -140,7 +138,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("start", "Used to get metrics over a range of time. Start time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("end", "Used to get metrics over a range of time. End time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("time", "Used to get metrics at a given time point. eg. 1559762729.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "pod"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -155,8 +153,8 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort_type", "Sorting order, one of asc, desc. Valid only if type is rank.").DefaultValue("desc.").DataType("string").Required(false)).
Param(ws.QueryParameter("page", "The number of paged results per metric. Default to return the whole metrics.").DataType("integer").Required(false).DefaultValue("1")).
Param(ws.QueryParameter("limit", "Max count of items per page.").DataType("integer").Required(false).DefaultValue("5")).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistic.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistics.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "pod"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -171,7 +169,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("start", "Used to get metrics over a range of time. Start time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("end", "Used to get metrics over a range of time. End time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("time", "Used to get metrics at a given time point. eg. 1559762729.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "pod"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -187,8 +185,8 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort_type", "Sorting order, one of asc, desc. Valid only if type is rank.").DefaultValue("desc.").DataType("string").Required(false)).
Param(ws.QueryParameter("page", "The number of paged results per metric. Default to return the whole metrics.").DataType("integer").Required(false).DefaultValue("1")).
Param(ws.QueryParameter("limit", "Max count of items per page.").DataType("integer").Required(false).DefaultValue("5")).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistic.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistics.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "container"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -204,8 +202,8 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort_type", "Sorting order, one of asc, desc. Valid only if type is rank.").DefaultValue("desc.").DataType("string").Required(false)).
Param(ws.QueryParameter("page", "The number of paged results per metric. Default to return the whole metrics.").DataType("integer").Required(false).DefaultValue("1")).
Param(ws.QueryParameter("limit", "Max count of items per page.").DataType("integer").Required(false).DefaultValue("5")).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistic.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistics.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "container"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -216,12 +214,12 @@ func addWebService(c *restful.Container) error {
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)).
Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. container_cpu|container_memory.").DataType("string").Required(false)).Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("metrics_filter", "Metrics filter in regexp pattern, eg. container_cpu|container_memory.").DataType("string").Required(false)).
Param(ws.QueryParameter("step", "Used to get metrics over a range of time. Query resolution step. eg. 10m.").DataType("string").Required(false)).
Param(ws.QueryParameter("start", "Used to get metrics over a range of time. Start time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("end", "Used to get metrics over a range of time. End time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("time", "Used to get metrics at a given time point. eg. 1559762729.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "container"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -239,7 +237,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("start", "Used to get metrics over a range of time. Start time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("end", "Used to get metrics over a range of time. End time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("time", "Used to get metrics at a given time point. eg. 1559762729.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "workload"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -255,8 +253,8 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort_type", "Sorting order, one of asc, desc. Valid only if type is rank.").DefaultValue("desc.").DataType("string").Required(false)).
Param(ws.QueryParameter("page", "The number of paged results per metric. Default to return the whole metrics.").DataType("integer").Required(false).DefaultValue("1")).
Param(ws.QueryParameter("limit", "Max count of items per page.").DataType("integer").Required(false).DefaultValue("5")).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistic.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistics.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "workload"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -271,8 +269,8 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort_type", "Sorting order, one of asc, desc. Valid only if type is rank.").DefaultValue("desc.").DataType("string").Required(false)).
Param(ws.QueryParameter("page", "The number of paged results per metric. Default to return the whole metrics.").DataType("integer").Required(false).DefaultValue("1")).
Param(ws.QueryParameter("limit", "Max count of items per page.").DataType("integer").Required(false).DefaultValue("5")).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistic.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistics.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "workload"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -287,7 +285,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("start", "Used to get metrics over a range of time. Start time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("end", "Used to get metrics over a range of time. End time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("time", "Used to get metrics at a given time point. eg. 1559762729.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "workspace"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -301,8 +299,8 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("sort_type", "Sorting order, one of asc, desc. Valid only if type is rank.").DefaultValue("desc.").DataType("string").Required(false)).
Param(ws.QueryParameter("page", "The number of paged results per metric. Default to return the whole metrics.").DataType("integer").Required(false).DefaultValue("1")).
Param(ws.QueryParameter("limit", "Max count of items per page.").DataType("integer").Required(false).DefaultValue("5")).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistic.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Param(ws.QueryParameter("type", "Additional operation to the result. One of rank, statistics.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "workspace"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......@@ -316,7 +314,7 @@ func addWebService(c *restful.Container) error {
Param(ws.QueryParameter("start", "Used to get metrics over a range of time. Start time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("end", "Used to get metrics over a range of time. End time of query range. eg. 1559762729.").DataType("string").Required(false)).
Param(ws.QueryParameter("time", "Used to get metrics at a given time point. eg. 1559762729.").DataType("string").Required(false)).
Metadata(restfulspec.KeyOpenAPITags, tags).
Metadata(restfulspec.KeyOpenAPITags, []string{"Monitoring", "component"}).
Writes(metrics.FormatedLevelMetric{}).
Returns(http.StatusOK, RespOK, metrics.FormatedLevelMetric{})).
Consumes(restful.MIME_JSON, restful.MIME_XML).
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册