fix api not for setup module
This commit is contained in:
parent
48c4368282
commit
17136af69d
|
@ -61,7 +61,6 @@ PUT _ilm/policy/ilm_$[[INDEX_PREFIX]]metrics-30days-retention
|
|||
"min_age": "30d",
|
||||
"actions": {
|
||||
"delete": {
|
||||
"delete_searchable_snapshot": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ type GatewayAPI struct {
|
|||
api.Handler
|
||||
}
|
||||
|
||||
func init() {
|
||||
func InitAPI() {
|
||||
gateway:=GatewayAPI{}
|
||||
api.HandleAPIMethod(api.POST, "/gateway/instance/try_connect", gateway.RequireLogin(gateway.tryConnect))
|
||||
api.HandleAPIMethod(api.GET, "/gateway/instance/:instance_id", gateway.RequirePermission(gateway.getInstance, enum.PermissionGatewayInstanceRead))
|
||||
|
|
|
@ -3,7 +3,9 @@ package api
|
|||
import (
|
||||
"infini.sh/console/config"
|
||||
"infini.sh/console/plugin/api/alerting"
|
||||
"infini.sh/console/plugin/api/gateway"
|
||||
"infini.sh/console/plugin/api/index_management"
|
||||
"infini.sh/console/plugin/api/insight"
|
||||
"infini.sh/framework/core/api"
|
||||
"infini.sh/framework/core/api/rbac/enum"
|
||||
"path"
|
||||
|
@ -62,4 +64,6 @@ func Init(cfg *config.AppConfig) {
|
|||
|
||||
alertAPI.Init()
|
||||
|
||||
gateway.InitAPI()
|
||||
insight.InitAPI()
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@ type InsightAPI struct {
|
|||
api.Handler
|
||||
}
|
||||
|
||||
func init() {
|
||||
func InitAPI() {
|
||||
insight := InsightAPI{}
|
||||
api.HandleAPIMethod(api.POST, "/elasticsearch/:id/visualization/metadata", insight.HandleGetMetadata)
|
||||
api.HandleAPIMethod(api.POST, "/elasticsearch/:id/visualization/data", insight.HandleGetMetricData)
|
||||
|
|
|
@ -387,7 +387,7 @@ func (module *Module) initialize(w http.ResponseWriter, r *http.Request, ps http
|
|||
if request.BootstrapUsername!=""&&request.BootstrapPassword!=""{
|
||||
//Save bootstrap user
|
||||
user:=rbac.User{}
|
||||
user.ID="default_user_"+util.GetUUID()
|
||||
user.ID="default_user_"+request.BootstrapUsername
|
||||
user.Name=request.BootstrapUsername
|
||||
user.NickName=request.BootstrapUsername
|
||||
var hash []byte
|
||||
|
@ -421,7 +421,6 @@ func (module *Module) initialize(w http.ResponseWriter, r *http.Request, ps http
|
|||
}
|
||||
|
||||
//处理 ILM
|
||||
//处理默认用户信息
|
||||
|
||||
//callback
|
||||
InvokeSetupCallback()
|
||||
|
|
Loading…
Reference in New Issue