From f2898927f1b92d3c8cd9e7c63ce27dee7e6ae88f Mon Sep 17 00:00:00 2001 From: George Goldberg Date: Thu, 29 Jun 2017 22:40:14 +0100 Subject: PLT-6474: Server: Add elasticsearch/test endpoint to API. (#6792) --- app/elasticsearch.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 app/elasticsearch.go (limited to 'app/elasticsearch.go') diff --git a/app/elasticsearch.go b/app/elasticsearch.go new file mode 100644 index 000000000..c021b15e8 --- /dev/null +++ b/app/elasticsearch.go @@ -0,0 +1,24 @@ +// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. +// See License.txt for license information. + +package app + +import ( + "net/http" + + "github.com/mattermost/platform/model" + "github.com/mattermost/platform/einterfaces" +) + +func TestElasticsearch() *model.AppError { + if esI := einterfaces.GetElasticSearchInterface(); esI != nil { + if err := esI.TestConfig(); err != nil { + return err + } + } else { + err := model.NewAppError("TestElasticsearch", "ent.elasticsearch.test_config.license.error", nil, "", http.StatusNotImplemented) + return err + } + + return nil +} -- cgit v1.2.3-1-g7c22