Ver Fonte

添加一个接收 keepalived 通知的接口

reghao há 2 anos atrás
pai
commit
eda9e622f7

+ 25 - 0
manager/src/main/java/cn/reghao/devops/manager/machine/controller/ClusterController.java

@@ -0,0 +1,25 @@
+package cn.reghao.devops.manager.machine.controller;
+
+import cn.reghao.jutil.jdk.result.WebResult;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.http.MediaType;
+import org.springframework.web.bind.annotation.*;
+
+/**
+ * @author reghao
+ * @date 2024-01-04 15:34:39
+ */
+@Slf4j
+@Api(tags = "机器接口")
+@RestController
+@RequestMapping("/api/cluster")
+public class ClusterController {
+    @ApiOperation(value = "设置机器环境")
+    @PostMapping(value = "/notify/keepalived", produces = MediaType.APPLICATION_JSON_VALUE)
+    public String notify(@RequestParam("lvs") String lvs, @RequestParam("type") String type) {
+        log.info("{} -> {}", lvs, type);
+        return WebResult.success();
+    }
+}