| | |
| | | return dataSource |
| | | } |
| | | |
| | | //查询ES集群信息-入口 |
| | | // @Security ApiKeyAuth |
| | | // @Summary 查询ES集群信息-入口 |
| | | // @Description 查询ES集群信息-入口 |
| | | // @Accept json |
| | | // @Produce json |
| | | // @Tags es |
| | | // @Param obj body controllers.EsClusterInfo true "查询集群参数" |
| | | // @Success 200 {string} json "{"code":200, msg:"", success:true}" |
| | | // @Failure 500 {string} json "{"code":500, msg:"", success:false}" |
| | | // @Router /data/api-v/es/getEsClusterInfo [POST] |
| | | func (em *EsManagementController) GetEsClusterInfo(c *gin.Context) { |
| | | var body EsClusterInfo |
| | | c.BindJSON(&body) |
| | |
| | | return nodeInfos, err |
| | | } |
| | | |
| | | //创建节点 |
| | | // @Security ApiKeyAuth |
| | | // @Summary 创建节点 |
| | | // @Description 创建节点 |
| | | // @Accept json |
| | | // @Produce json |
| | | // @Tags es |
| | | // @Success 200 {string} json "{"code":200, msg:"", success:true}" |
| | | // @Failure 500 {string} json "{"code":500, msg:"", success:false}" |
| | | // @Router /data/api-v/es/createNode [POST] |
| | | func (em *EsManagementController) CreateNode(c *gin.Context) { |
| | | msg := "创建节点失败,请联系管理员" |
| | | str := "sh /opt/script/create_first_node.sh" |
| | |
| | | util.ResponseFormat(c, code.CreateFirstNodeErr, msg) |
| | | } |
| | | |
| | | //加入集群 |
| | | // @Security ApiKeyAuth |
| | | // @Summary 加入集群 |
| | | // @Description 加入集群 |
| | | // @Accept json |
| | | // @Produce json |
| | | // @Tags es |
| | | // @Param obj body controllers.AddCluster true "加入集群参数" |
| | | // @Success 200 {string} json "{"code":200, msg:"", success:true}" |
| | | // @Failure 500 {string} json "{"code":500, msg:"", success:false}" |
| | | // @Router /data/api-v/es/addCluster [POST] |
| | | func (em *EsManagementController) AddCluster(c *gin.Context) { |
| | | var ac AddCluster |
| | | err := c.BindJSON(&ac) |