summaryrefslogtreecommitdiffstats
path: root/app/elasticsearch.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2017-07-19 09:43:05 +0100
committerGitHub <noreply@github.com>2017-07-19 09:43:05 +0100
commitfe368a74565e736ad1fb1dfc20ab364379d83ae9 (patch)
tree56186c11129a4aadc068a6387af39288cc9802b7 /app/elasticsearch.go
parent97f34e483b0fa8b2a8cfe75b72168cfa38cc9d80 (diff)
downloadchat-fe368a74565e736ad1fb1dfc20ab364379d83ae9.tar.gz
chat-fe368a74565e736ad1fb1dfc20ab364379d83ae9.tar.bz2
chat-fe368a74565e736ad1fb1dfc20ab364379d83ae9.zip
PLT-6595: API to purge Elasticsearch indexes. (#6971)
Diffstat (limited to 'app/elasticsearch.go')
-rw-r--r--app/elasticsearch.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/app/elasticsearch.go b/app/elasticsearch.go
index ef34a6074..857ed570a 100644
--- a/app/elasticsearch.go
+++ b/app/elasticsearch.go
@@ -31,3 +31,16 @@ func TestElasticsearch(cfg *model.Config) *model.AppError {
return nil
}
+
+func PurgeElasticsearchIndexes() *model.AppError {
+ if esI := einterfaces.GetElasticsearchInterface(); esI != nil {
+ if err := esI.PurgeIndexes(); err != nil {
+ return err
+ }
+ } else {
+ err := model.NewAppError("PurgeElasticsearchIndexes", "ent.elasticsearch.test_config.license.error", nil, "", http.StatusNotImplemented)
+ return err
+ }
+
+ return nil
+}