-
Notifications
You must be signed in to change notification settings - Fork 26
/
routes.go
48 lines (45 loc) · 1.3 KB
/
routes.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package logs
import (
"net/http"
"github.com/appbaseio/reactivesearch-api/plugins"
)
func (l *Logs) routes() []plugins.Route {
middleware := (&chain{}).Wrap
return []plugins.Route{
{
Name: "Get index logs",
Methods: []string{http.MethodGet},
Path: "/{index}/_logs",
HandlerFunc: middleware(l.getLogs()),
Description: "Returns the logs for an index",
},
{
Name: "Get log for passed ID",
Methods: []string{http.MethodGet},
Path: "/_log/{id}",
HandlerFunc: middleware(l.getLogById()),
Description: "Returns the logs for the passed ID, if present",
},
{
Name: "Get logs",
Methods: []string{http.MethodGet},
Path: "/_logs",
HandlerFunc: middleware(l.getLogs()),
Description: "Returns the logs for the cluster",
},
{
Name: "Get index logs for search requests",
Methods: []string{http.MethodGet},
Path: "/{index}/_logs/search",
HandlerFunc: middleware(l.getSearchLogs()),
Description: "Returns the search request logs for an index",
},
{
Name: "Get logs for search requests",
Methods: []string{http.MethodGet},
Path: "/_logs/search",
HandlerFunc: middleware(l.getSearchLogs()),
Description: "Returns the search request logs for the cluster",
},
}
}