-
Notifications
You must be signed in to change notification settings - Fork 26
/
routes.go
35 lines (32 loc) · 1 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
package reindexer
import (
"net/http"
"github.com/appbaseio/reactivesearch-api/plugins"
)
func (rx *reindexer) routes() []plugins.Route {
middleware := (&chain{}).Wrap
routes := []plugins.Route{
{
Name: "Reindex source to destination",
Methods: []string{http.MethodPost},
Path: "/_reindex/{source_index}/{destination_index}",
HandlerFunc: middleware(rx.reindexSrcToDest()),
Description: "Reindexes an index to a provided destination index with optionally provided mappings, settings and data.",
},
{
Name: "Reindex",
Methods: []string{http.MethodPost},
Path: "/_reindex/{index}",
HandlerFunc: middleware(rx.reindex()),
Description: "Reindexes a single index with the given mappings, settings and types.",
},
{
Name: "AliasedIndexes",
Methods: []string{http.MethodGet},
Path: "/_aliasedindices",
HandlerFunc: middleware(rx.aliasedIndices()),
Description: "Get map of indices and aliases",
},
}
return routes
}