diff --git a/server/router/router.go b/server/router/router.go index a3cfe3b829bd4abd49f5f647d6a3f19537dc8cc1..bc4c3b9ff2eb224b14743cc2e7b76811dfc7b70a 100644 --- a/server/router/router.go +++ b/server/router/router.go @@ -39,8 +39,9 @@ func setupRouter() *gin.Engine { func registerAPIs(router *gin.Engine) { logger.Debug("router register") plugin.GlobalClient.RegisterHandlers(router) + api := router.Group("/plugin/" + plugin.GlobalClient.PluginInfo.Name) - atune := router.Group("/plugin/" + plugin.GlobalClient.PluginInfo.Name) + atune := api.Group("") { atune.POST("atune_install", controller.AtuneClientInstall) atune.POST("atune_uninstall", controller.AtuneClientRemove) @@ -48,7 +49,7 @@ func registerAPIs(router *gin.Engine) { atune.GET("info", controller.GetAtuneInfo) } - dbtune := router.Group("/plugin/" + plugin.GlobalClient.PluginInfo.Name) + dbtune := api.Group("") { dbtune.GET("tunes", controller.QueryTunes) dbtune.GET("tunes_noPaged", controller.QueryTunesNoPaged) @@ -59,7 +60,7 @@ func registerAPIs(router *gin.Engine) { dbtune.GET("tune_machine", controller.GetTuneMachines) } - task := router.Group("/plugin/" + plugin.GlobalClient.PluginInfo.Name) + task := api.Group("") { task.POST("task_run", controller.StartTask) task.POST("task_new", controller.CreatTask) @@ -68,7 +69,7 @@ func registerAPIs(router *gin.Engine) { task.GET("task_search", controller.SearchTask) } - restune := router.Group("/plugin/" + plugin.GlobalClient.PluginInfo.Name) + restune := api.Group("") { restune.GET("result", controller.QueryResults) restune.GET("tune_result", controller.QueryTuneResults) diff --git a/server/service/atunemanageservice.go b/server/service/atunemanageservice.go index cf119d3ae8f684306b7328581301f0faa69c7248..13d8d6e31304616eaf86793f188c0d23c8a50dc4 100644 --- a/server/service/atunemanageservice.go +++ b/server/service/atunemanageservice.go @@ -16,8 +16,8 @@ const ( CommandInstall_Type = "install" CommandUninstall_Type = "uninstall" - CommandInstall_Cmd = "yum install -y golang-github-prometheus-node_exporter && (echo '安装成功'; systemctl start node_exporter) || echo '安装失败'" - CommandUninstall_Cmd = "yum remove -y golang-github-prometheus-node_exporter && echo '卸载成功' || echo '卸载失败'" + CommandInstall_Cmd = "yum install -y atune atune-engine && (echo '安装成功'; sed -i '59s/true/false/; 66s/true/false/' /etc/atuned/atuned.cnf; sed -i '22s/true/false/' /etc/atuned/engine.cnf; systemctl restart atuned; systemctl restart atune-engine) || echo '安装失败'" + CommandUninstall_Cmd = "yum remove -y atune atune-engine && echo '卸载成功' || echo '卸载失败'" ) func AtuneManage(res *common.CmdResult, command_type string) error {