Skip to content
Snippets Groups Projects
Commit 5d4348b9 authored by Francé Wilke's avatar Francé Wilke
Browse files

Add offset to api-logs; remove relevant_id

parent 10c2e6fa
Branches
Tags
No related merge requests found
...@@ -147,7 +147,6 @@ type ApiLog struct { ...@@ -147,7 +147,6 @@ type ApiLog struct {
Username string `json:"username,omitempty"` Username string `json:"username,omitempty"`
SourceIP string `json:"source_ip,omitempty"` //only logged for incoming API SourceIP string `json:"source_ip,omitempty"` //only logged for incoming API
UserAgent string `json:"user_agent,omitempty"` //only for incoming, indicate type of browser when UI UserAgent string `json:"user_agent,omitempty"` //only for incoming, indicate type of browser when UI
RelevantID string `json:"relevant_id,omitempty"`
Request ApiLogRequest `json:"request"` Request ApiLogRequest `json:"request"`
Response ApiLogResponse `json:"response"` Response ApiLogResponse `json:"response"`
} }
......
...@@ -37,6 +37,7 @@ type SearchRequestBody struct { ...@@ -37,6 +37,7 @@ type SearchRequestBody struct {
Size int64 `json:"size,omitempty"` Size int64 `json:"size,omitempty"`
Query Query `json:"query"` Query Query `json:"query"`
Sort []map[string]string `json:"sort,omitempty"` Sort []map[string]string `json:"sort,omitempty"`
From int64 `json:"from,omitempty"`
} }
type Query struct { type Query struct {
......
...@@ -40,7 +40,7 @@ type TimeSeries interface { ...@@ -40,7 +40,7 @@ type TimeSeries interface {
// ... // ...
// } // }
// } // }
Search(query Query, searchQuery []map[string]string, limit int64) (docs map[string]interface{}, totalCount int, err error) Search(query Query, searchQuery []map[string]string, limit int64, offset int64) (docs map[string]interface{}, totalCount int, err error)
// Get takes the id returned in Search() // Get takes the id returned in Search()
// The id is uuid assigned by OpenSearch when documents are added with Write(). // The id is uuid assigned by OpenSearch when documents are added with Write().
...@@ -398,7 +398,7 @@ type IndexSettings struct { ...@@ -398,7 +398,7 @@ type IndexSettings struct {
//Search //Search
//Return: //Return:
// docs will be a slice of the TimeSeries data type // docs will be a slice of the TimeSeries data type
func (ts *timeSeries) Search(query Query, sortQuery []map[string]string, limit int64) (docs map[string]interface{}, totalCount int, err error) { func (ts *timeSeries) Search(query Query, sortQuery []map[string]string, limit int64, offset int64) (docs map[string]interface{}, totalCount int, err error) {
if ts == nil { if ts == nil {
return nil, 0, errors.Errorf("time series == nil") return nil, 0, errors.Errorf("time series == nil")
} }
...@@ -421,6 +421,7 @@ func (ts *timeSeries) Search(query Query, sortQuery []map[string]string, limit i ...@@ -421,6 +421,7 @@ func (ts *timeSeries) Search(query Query, sortQuery []map[string]string, limit i
Size: limit, Size: limit,
Query: query, Query: query,
Sort: sortQuery, Sort: sortQuery,
From: offset,
} }
jsonBody, _ := json.Marshal(body) jsonBody, _ := json.Marshal(body)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment