From fe368a74565e736ad1fb1dfc20ab364379d83ae9 Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Wed, 19 Jul 2017 09:43:05 +0100 Subject: PLT-6595: API to purge Elasticsearch indexes. (#6971) --- app/elasticsearch.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'app/elasticsearch.go') 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 +} -- cgit v1.2.3-1-g7c22