@@ -69,7 +69,7 @@ func addWebService(c *restful.Container) error {
|
|||||||
Writes(v1alpha2.QueryResult{}).
|
Writes(v1alpha2.QueryResult{}).
|
||||||
Returns(http.StatusOK, RespOK, v1alpha2.QueryResult{})).
|
Returns(http.StatusOK, RespOK, v1alpha2.QueryResult{})).
|
||||||
Consumes(restful.MIME_JSON, restful.MIME_XML).
|
Consumes(restful.MIME_JSON, restful.MIME_XML).
|
||||||
Produces(restful.MIME_JSON, restful.MIME_OCTET)
|
Produces(restful.MIME_JSON, "text/plain")
|
||||||
|
|
||||||
ws.Route(ws.GET("/workspaces/{workspace}").To(logging.LoggingQueryWorkspace).
|
ws.Route(ws.GET("/workspaces/{workspace}").To(logging.LoggingQueryWorkspace).
|
||||||
Doc("Query logs against the specific workspace.").
|
Doc("Query logs against the specific workspace.").
|
||||||
|
|||||||
@@ -179,7 +179,7 @@ func addWebService(c *restful.Container) error {
|
|||||||
Writes(v1alpha2.Response{}).
|
Writes(v1alpha2.Response{}).
|
||||||
Returns(http.StatusOK, RespOK, v1alpha2.Response{})).
|
Returns(http.StatusOK, RespOK, v1alpha2.Response{})).
|
||||||
Consumes(restful.MIME_JSON, restful.MIME_XML).
|
Consumes(restful.MIME_JSON, restful.MIME_XML).
|
||||||
Produces(restful.MIME_JSON, restful.MIME_OCTET)
|
Produces(restful.MIME_JSON, "text/plain")
|
||||||
|
|
||||||
c.Add(ws)
|
c.Add(ws)
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
@@ -162,7 +162,8 @@ func logExport(param v1alpha2.QueryParameters, request *restful.Request, respons
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
response.Header().Set("Content-Type", restful.MIME_OCTET)
|
response.Header().Set(restful.HEADER_ContentType, "text/plain")
|
||||||
|
response.Header().Set("Content-Disposition", "attachment")
|
||||||
|
|
||||||
// keep search context alive for 1m
|
// keep search context alive for 1m
|
||||||
param.ScrollTimeout = time.Minute
|
param.ScrollTimeout = time.Minute
|
||||||
|
|||||||
@@ -348,7 +348,8 @@ func LogQuery(req *restful.Request, resp *restful.Response) {
|
|||||||
logging.LoggingQueryCluster(req, resp)
|
logging.LoggingQueryCluster(req, resp)
|
||||||
default:
|
default:
|
||||||
if operation == "export" {
|
if operation == "export" {
|
||||||
resp.Header().Set("Content-Type", restful.MIME_OCTET)
|
resp.Header().Set(restful.HEADER_ContentType, "text/plain")
|
||||||
|
resp.Header().Set("Content-Disposition", "attachment")
|
||||||
resp.Write(nil)
|
resp.Write(nil)
|
||||||
} else {
|
} else {
|
||||||
resp.WriteAsJson(loggingv1alpha2.QueryResult{Read: new(loggingv1alpha2.ReadResult)})
|
resp.WriteAsJson(loggingv1alpha2.QueryResult{Read: new(loggingv1alpha2.ReadResult)})
|
||||||
|
|||||||
Reference in New Issue
Block a user