PLT-6474: Server: Add elasticsearch/test endpoint to API. (#6792)

Этот коммит содержится в:
George Goldberg
2017-06-29 22:40:14 +01:00
коммит произвёл Joram Wilander
родитель a4f363a50b
Коммит f2898927f1
7 изменённых файлов: 106 добавлений и 0 удалений

24
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
}