Initial commit all
parent
6c043685ed
commit
4110a57be3
|
@ -0,0 +1,150 @@
|
|||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.bocloud</groupId>
|
||||
<artifactId>bocloud.tse</artifactId>
|
||||
<version>6.5.0-LTS-SZ</version>
|
||||
</parent>
|
||||
<artifactId>bocloud.tse.booter</artifactId>
|
||||
<version>${bocloud.booter.version}</version>
|
||||
<dependencies>
|
||||
<!-- Spring -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<!-- Bocloud相关配置 -->
|
||||
<dependency>
|
||||
<groupId>com.freedom</groupId>
|
||||
<artifactId>megatron.microservice</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bocloud</groupId>
|
||||
<artifactId>bocloud.tse.scheduler</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.8.2</version>
|
||||
</dependency>
|
||||
<!--for spring boot 3-->
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
<version>2.0.7</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<parameters>true</parameters>
|
||||
<source>21</source>
|
||||
<target>21</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifest>
|
||||
<mainClass>com.bocloud.tse.booter.Application</mainClass>
|
||||
<addClasspath>true</addClasspath>
|
||||
<useUniqueVersions>false</useUniqueVersions>
|
||||
<classpathPrefix>libs/</classpathPrefix>
|
||||
</manifest>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
<version>3.6.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>copy-dependencies</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<type>jar</type>
|
||||
<includeTypes>jar</includeTypes>
|
||||
<includeScope>runtime</includeScope>
|
||||
<outputDirectory>${project.build.directory}/libs</outputDirectory>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>bocloud.booter.tomcat</id>
|
||||
<properties>
|
||||
<bocloud.booter.version>6.5.0-LTS-SZ</bocloud.booter.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
<profile>
|
||||
<id>bocloud.booter.tongweb</id>
|
||||
<properties>
|
||||
<bocloud.booter.version>6.5.0-LTS-SZ-TONGWEB</bocloud.booter.version>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.tongweb</groupId>
|
||||
<artifactId>tongweb-embed</artifactId>
|
||||
<version>7.0.E.2</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tongweb.springboot</groupId>
|
||||
<artifactId>tongweb-spring-boot-starter</artifactId>
|
||||
<version>2.x.0.RELEASE</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.hibernate.validator</groupId>
|
||||
<artifactId>hibernate-validator</artifactId>
|
||||
</exclusion>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</profile>
|
||||
</profiles>
|
||||
</project>
|
|
@ -0,0 +1,19 @@
|
|||
package com.bocloud.tse.booter;
|
||||
|
||||
import org.springframework.amqp.rabbit.annotation.EnableRabbit;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.scheduling.annotation.EnableScheduling;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableRabbit
|
||||
@EnableScheduling
|
||||
@ComponentScan(value = {"com.bocloud", "com.megatron"})
|
||||
public class Application {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Application.class, args);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,129 @@
|
|||
package com.bocloud.tse.booter.config;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.bocloud.tse.scheduler.worker.listener.TaskResultListener;
|
||||
import org.springframework.amqp.core.AcknowledgeMode;
|
||||
import org.springframework.amqp.core.Binding;
|
||||
import org.springframework.amqp.core.BindingBuilder;
|
||||
import org.springframework.amqp.core.DirectExchange;
|
||||
import org.springframework.amqp.core.Queue;
|
||||
import org.springframework.amqp.core.TopicExchange;
|
||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
||||
import org.springframework.amqp.rabbit.core.RabbitAdmin;
|
||||
import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
||||
import org.springframework.amqp.rabbit.listener.SimpleMessageListenerContainer;
|
||||
import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
|
||||
import org.springframework.amqp.support.converter.MessageConverter;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Scope;
|
||||
|
||||
import com.bocloud.tse.scheduler.listener.TaskActionListener;
|
||||
import com.megatron.common.utils.MapTools;
|
||||
import com.megatron.framework.core.CurrentService;
|
||||
|
||||
/**
|
||||
* rabbitmq相关配置
|
||||
*/
|
||||
@Configuration
|
||||
@ConfigurationProperties(prefix = "spring.rabbitmq")
|
||||
public class RabbitMQConfiguration {
|
||||
|
||||
@Autowired
|
||||
private ConnectionFactory connectionFactory;
|
||||
private Map<String, Object> arguments = MapTools.simpleMap("x-ha-policy", "all");
|
||||
|
||||
/**
|
||||
* 声明任务动作队列
|
||||
*/
|
||||
@Bean
|
||||
public Queue declareTaskActionQueue(CurrentService service) {
|
||||
return new Queue("task.action.queue.tse." + service.getService().getHost() + "_" + service.getService().getPort(), true, false, true, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义direct exchange
|
||||
*/
|
||||
@Bean
|
||||
public DirectExchange defineDirectExchange() {
|
||||
return new DirectExchange("bocloud.direct.exchange", true, true, arguments);
|
||||
}
|
||||
|
||||
@Bean
|
||||
public Queue declareTaskResultQueue(CurrentService service) {
|
||||
return new Queue("task.result.queue." + service.getService().getHost() + "_" + service.getService().getPort(),
|
||||
true, false, true, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* 定义topic exchange
|
||||
*/
|
||||
@Bean
|
||||
public TopicExchange defineTopicExchange() {
|
||||
return new TopicExchange("bocloud.topic.exchange", true, true, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务动作队列绑定bocloud.topic.exchange
|
||||
*/
|
||||
@Bean
|
||||
public Binding bindingTaskActionQueue(CurrentService service) {
|
||||
return BindingBuilder.bind(declareTaskActionQueue(service)).to(defineTopicExchange())
|
||||
.with("topic.task.action.#");
|
||||
}
|
||||
|
||||
/**
|
||||
* 绑定任务执行结果队列
|
||||
*
|
||||
* @param service
|
||||
* @return
|
||||
*/
|
||||
@Bean
|
||||
public Binding bindingTaskResultQueue(CurrentService service) {
|
||||
return BindingBuilder.bind(declareTaskResultQueue(service)).to(defineDirectExchange()).withQueueName();
|
||||
}
|
||||
@Bean
|
||||
public SimpleMessageListenerContainer autoActionListener(CurrentService service,
|
||||
TaskActionListener taskActionListener) {
|
||||
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
|
||||
container.setQueues(declareTaskActionQueue(service));
|
||||
container.setAcknowledgeMode(AcknowledgeMode.AUTO); // 设置确认模式自动确认
|
||||
container.setMessageListener(taskActionListener);
|
||||
return container;
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SimpleMessageListenerContainer autoTaskResultListener(CurrentService service,
|
||||
TaskResultListener taskResultListener) {
|
||||
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(connectionFactory);
|
||||
container.setQueues(declareTaskResultQueue(service));
|
||||
container.setAcknowledgeMode(AcknowledgeMode.AUTO); // 设置确认模式自动确认
|
||||
container.setMessageListener(taskResultListener);
|
||||
return container;
|
||||
}
|
||||
@Bean
|
||||
public MessageConverter messageConverter() {
|
||||
return new Jackson2JsonMessageConverter();
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public RabbitTemplate amqpTemplate() {
|
||||
RabbitTemplate amqpTemplate = new RabbitTemplate(connectionFactory);
|
||||
amqpTemplate.setMessageConverter(messageConverter());
|
||||
amqpTemplate.setExchange(defineDirectExchange().getName());
|
||||
return amqpTemplate;
|
||||
}
|
||||
|
||||
@Bean
|
||||
@Scope(ConfigurableBeanFactory.SCOPE_PROTOTYPE)
|
||||
public RabbitAdmin rabbitAdmin() {
|
||||
RabbitAdmin rabbitAdmin = new RabbitAdmin(connectionFactory);
|
||||
return rabbitAdmin;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.bocloud.tse.booter.config;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
import io.swagger.v3.oas.models.OpenAPI;
|
||||
import io.swagger.v3.oas.models.info.Contact;
|
||||
import io.swagger.v3.oas.models.info.Info;
|
||||
|
||||
@Configuration
|
||||
public class SwaggerConfiguration {
|
||||
|
||||
@Bean
|
||||
public OpenAPI openAPI() {
|
||||
Contact contact = new Contact().name("未伟").email("weiwei@beyondcent.com").url("http://www.bocloud.com/");
|
||||
Info info = new Info().title("任务引擎服务API接口文档").description("任务引擎服务API接口文档")
|
||||
.termsOfService("http://www.bocloud.com/").contact(contact).version("1.0");
|
||||
return new OpenAPI().info(info);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
package com.bocloud.tse.booter.config;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import com.bocloud.cmp.boot.config.PagerArgumentResolver;
|
||||
import com.bocloud.cmp.boot.interceptor.AccessInterceptor;
|
||||
import com.bocloud.cmp.boot.interceptor.LogInterceptor;
|
||||
import com.megatron.framework.core.InterceptorBridge;
|
||||
import com.megatron.framework.core.config.InterceptorConfiguration;
|
||||
import com.megatron.framework.core.domain.InterceptorEntity;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 拦截器配置类
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class WebInterceptorConfiguration implements InterceptorConfiguration {
|
||||
|
||||
private static final String[] ACCESS_EXCLUDES = new String[] {"/status", "/status/db", "/status/**",
|
||||
"/v1/status/**", "/login", "/sso", "/v1/logview", "/v1/logzip", "/v1/config/**", "/v1/plugins/**", "/*/*.css",
|
||||
"/*/*.js", "/*/*.png", "/*/*.jpg", "/*/*.jpeg", "/*.html", "/*/*.html", "/swagger-resources/**", "/favicon.ico",
|
||||
"/webjars/**", "/v3/**", "/swagger-ui.html/**", "**/api-docs", "/error", "/favicon.ico"};
|
||||
private static final String[] LOG_EXCLUDES = new String[] {"/*/*.css", "/*/*.js", "/*/*.png", "/*/*.jpg",
|
||||
"/*/*.jpeg", "/*.html", "/*/*.html", "/swagger-resources/**", "/favicon.ico", "/webjars/**", "/v3/**",
|
||||
"/swagger-ui.html/**", "**/api-docs", "/error", "/favicon.ico"};
|
||||
private static final String[] INCLUDES = new String[] {"/**"};
|
||||
private final LogInterceptor logInterceptor;
|
||||
private final AccessInterceptor accessInterceptor;
|
||||
|
||||
@Autowired
|
||||
public WebInterceptorConfiguration(AccessInterceptor accessInterceptor, LogInterceptor logInterceptor) {
|
||||
this.logInterceptor = logInterceptor;
|
||||
this.accessInterceptor = accessInterceptor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public InterceptorBridge buildBridge() {
|
||||
log.info("start to build interceptors...");
|
||||
InterceptorBridge bridge = new InterceptorBridge();
|
||||
InterceptorEntity accessEntity = InterceptorEntity.builder().interceptor(accessInterceptor).includes(INCLUDES)
|
||||
.excludes(ACCESS_EXCLUDES).order(0).build();
|
||||
InterceptorEntity auditLogEntity = InterceptorEntity.builder().interceptor(logInterceptor).includes(INCLUDES)
|
||||
.excludes(LOG_EXCLUDES).order(1).build();
|
||||
List<InterceptorEntity> interceptors = new ArrayList<>();
|
||||
interceptors.add(accessEntity);
|
||||
interceptors.add(auditLogEntity);
|
||||
bridge.setInterceptors(interceptors);
|
||||
bridge.setResolvers(Collections.singletonList(new PagerArgumentResolver()));
|
||||
bridge.setMessageConverters(new ArrayList<>(0));
|
||||
log.info("build interceptors success!!!");
|
||||
return bridge;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.bocloud.tse.booter.controller;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.bocloud.tse.intf.EngineService;
|
||||
import com.bocloud.tse.model.EngineModule;
|
||||
import com.bocloud.tse.scheduler.core.JobScheduler;
|
||||
import com.megatron.common.model.GeneralResult;
|
||||
import com.megatron.common.model.RequestContext;
|
||||
import com.megatron.common.utils.Common;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/v1/engines")
|
||||
@Tag(name = "任务引擎管理")
|
||||
public class EngineController {
|
||||
|
||||
@Autowired
|
||||
private EngineService engineService;
|
||||
@Autowired
|
||||
private JobScheduler scheduler;
|
||||
|
||||
@Operation(summary = "任务引擎列表")
|
||||
@GetMapping
|
||||
public GeneralResult<?> services() {
|
||||
return engineService.services();
|
||||
}
|
||||
|
||||
@Operation(summary = "任务引擎状态")
|
||||
@GetMapping("/status")
|
||||
public GeneralResult<Boolean> status() {
|
||||
return new GeneralResult<>(true, scheduler.isRunning(), "任务引擎状态查询成功");
|
||||
}
|
||||
|
||||
@Operation(summary = "任务引擎操作(开启/关闭)")
|
||||
@PostMapping("/action")
|
||||
public GeneralResult<?> action(@RequestBody EngineModule module) {
|
||||
GeneralResult<?> result = engineService.action(module);
|
||||
if (result.isSuccess() && engineService.checkInstance(module.getInstance())) {
|
||||
String action = module.getAction();
|
||||
if ("start".equals(action) && !scheduler.isRunning()) {
|
||||
scheduler.switchOn();
|
||||
} else if ("stop".equals(action) && scheduler.isRunning()) {
|
||||
scheduler.switchOff();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@PutMapping(value = "/exclude")
|
||||
@Operation(tags = { "CMC", "CSC" }, summary = "任务引擎排除")
|
||||
public GeneralResult<Void> taskExclude(@RequestParam(value = "instance") String instance,
|
||||
@Value(Common.REQ_CONTEXT) RequestContext context) {
|
||||
return engineService.exclude(instance, context.getTarget());
|
||||
}
|
||||
|
||||
@PutMapping(value = "/recover")
|
||||
@Operation(tags = { "CMC", "CSC" }, summary = "任务引擎恢复")
|
||||
public GeneralResult<Void> taskRecover(@RequestParam(value = "instance") String instance,
|
||||
@Value(Common.REQ_CONTEXT) RequestContext context) {
|
||||
return engineService.recover(instance, context.getTarget());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
package com.bocloud.tse.booter.controller;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Queue;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.bocloud.tse.intf.TaskInstanceService;
|
||||
import com.bocloud.tse.model.Job;
|
||||
import com.bocloud.tse.scheduler.core.JobChannel;
|
||||
import com.bocloud.tse.scheduler.core.JobScheduler;
|
||||
import com.bocloud.tse.scheduler.core.TaskCache;
|
||||
import com.bocloud.tse.scheduler.executor.NodeExecutor;
|
||||
import com.bocloud.tse.scheduler.executor.TaskExecutor;
|
||||
import com.megatron.common.model.GeneralResult;
|
||||
import com.megatron.common.model.Result;
|
||||
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
/**
|
||||
* 状态控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/v1")
|
||||
@Tag(name = "任务状态管理")
|
||||
public class SchedulerController {
|
||||
|
||||
@Autowired
|
||||
private JobScheduler scheduler;
|
||||
@Autowired
|
||||
private TaskInstanceService instanceService;
|
||||
@Autowired
|
||||
private JobChannel channel;
|
||||
|
||||
private TaskCache cache = TaskCache.instance();
|
||||
|
||||
@GetMapping("/status/task/total")
|
||||
@Operation(tags = { "CMC" }, summary = "任务整体信息")
|
||||
public GeneralResult<Map<String, Object>> totalStatus() {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("RunningTask", cache.getTaskExecutorPool().size());
|
||||
map.put("RunningNode", cache.getNodeExecutorPool().size());
|
||||
return new GeneralResult<>(true, map, "success");
|
||||
}
|
||||
|
||||
@GetMapping("/status/task/running")
|
||||
@Operation(tags = { "CMC" }, summary = "执行中任务信息")
|
||||
public GeneralResult<Map<String, TaskExecutor>> runningTask() {
|
||||
return new GeneralResult<>(true, cache.getTaskExecutorPool(), "success");
|
||||
}
|
||||
|
||||
@GetMapping("/status/node/running")
|
||||
@Operation(tags = { "CMC" }, summary = "执行中任务节点信息")
|
||||
public GeneralResult<Map<String, NodeExecutor>> runningNode() {
|
||||
return new GeneralResult<>(true, cache.getNodeExecutorPool(), "success");
|
||||
}
|
||||
|
||||
@GetMapping("/status/task/waiting")
|
||||
@Operation(tags = { "CMC" }, summary = "等待中任务信息")
|
||||
public GeneralResult<List<Job>> waitingTask() {
|
||||
return new GeneralResult<>(true, instanceService.getAllJobs(), "success");
|
||||
}
|
||||
|
||||
@PostMapping("/task/scheduler")
|
||||
@Operation(tags = { "CMC" }, summary = "任务调度处理")
|
||||
public GeneralResult<Queue<Job>> scheduler(@RequestBody JSONObject object) {
|
||||
String type = object.getString("type");
|
||||
if ("insert".equalsIgnoreCase(type)) {
|
||||
Job job = JSONObject.parseObject(object.getString("data"), Job.class);
|
||||
boolean result = channel.insertTask(job);
|
||||
if (!result) {
|
||||
return new GeneralResult<>(false, "任务启动失败");
|
||||
}
|
||||
} else if ("remove".equalsIgnoreCase(type)) {
|
||||
Result result = scheduler.removeCronTask(object.getString("data"));
|
||||
if (result.isFailed()) {
|
||||
return new GeneralResult<>(false, "任务移除失败");
|
||||
}
|
||||
} else {
|
||||
return new GeneralResult<>(false, "暂不支持该类操作");
|
||||
}
|
||||
return new GeneralResult<>(true, "success");
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.bocloud.tse.booter.syslog;
|
||||
|
||||
import ch.qos.logback.classic.net.SyslogAppender;
|
||||
import ch.qos.logback.core.net.SyslogOutputStream;
|
||||
|
||||
import java.net.SocketException;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
public class SysLogAppenderTcpAndUdp extends SyslogAppender {
|
||||
|
||||
@Override
|
||||
public SyslogOutputStream createOutputStream() throws SocketException, UnknownHostException {
|
||||
return new SyslogOutputStreamTcpAndUdp(getSyslogHost(), getPort());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.bocloud.tse.booter.syslog;
|
||||
|
||||
import ch.qos.logback.classic.spi.ILoggingEvent;
|
||||
import ch.qos.logback.core.pattern.CompositeConverter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class SysLogLevelConvertor extends CompositeConverter<ILoggingEvent> {
|
||||
|
||||
private static final Map<String, String> MAP = new HashMap<>() {{
|
||||
this.put("DEBUG", "7");
|
||||
this.put("INFO", "6");
|
||||
this.put("WARN", "4");
|
||||
this.put("ERROR", "3");
|
||||
}};
|
||||
|
||||
@Override
|
||||
protected String transform(ILoggingEvent iLoggingEvent, String s) {
|
||||
return MAP.getOrDefault(iLoggingEvent.getLevel().toString(), iLoggingEvent.getLevel().toString());
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
package com.bocloud.tse.booter.syslog;
|
||||
|
||||
import ch.qos.logback.core.net.SyslogOutputStream;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.InetAddress;
|
||||
import java.net.Socket;
|
||||
import java.net.SocketException;
|
||||
import java.net.UnknownHostException;
|
||||
|
||||
public class SyslogOutputStreamTcpAndUdp extends SyslogOutputStream {
|
||||
|
||||
private static final int MAX_LEN_TCP = 1024;
|
||||
|
||||
private InetAddress addressTcp;
|
||||
private Socket socketTcp;
|
||||
private ByteArrayOutputStream baosTcp = new ByteArrayOutputStream();
|
||||
final private int portTcp;
|
||||
|
||||
public SyslogOutputStreamTcpAndUdp(String syslogHost, int port) throws SocketException, UnknownHostException {
|
||||
super(syslogHost, port);
|
||||
this.addressTcp = InetAddress.getByName(syslogHost);
|
||||
this.portTcp = port;
|
||||
try {
|
||||
this.socketTcp = new Socket(addressTcp, portTcp);
|
||||
} catch (IOException e) {
|
||||
throw new SocketException(e);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(byte[] byteArray, int offset, int len) throws IOException {
|
||||
super.write(byteArray, offset, len);
|
||||
baosTcp.write(byteArray, offset, len);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void flush() throws IOException {
|
||||
super.flush();
|
||||
|
||||
byte[] bytes = baosTcp.toByteArray();
|
||||
|
||||
// clean up for next round
|
||||
if (baosTcp.size() > MAX_LEN_TCP) {
|
||||
baosTcp = new ByteArrayOutputStream();
|
||||
} else {
|
||||
baosTcp.reset();
|
||||
}
|
||||
|
||||
// after a failure, it can happen that bytes.length is zero
|
||||
// in that case, there is no point in sending out an empty message/
|
||||
if (bytes.length == 0) {
|
||||
return;
|
||||
}
|
||||
if (this.socketTcp != null) {
|
||||
socketTcp.getOutputStream().write(bytes);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void close() {
|
||||
super.close();
|
||||
addressTcp = null;
|
||||
try {
|
||||
socketTcp.close();
|
||||
} catch (IOException ignored) {
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,104 @@
|
|||
server:
|
||||
port: '18088'
|
||||
|
||||
spring:
|
||||
application:
|
||||
name: tse
|
||||
thread:
|
||||
core:
|
||||
pool:
|
||||
size: 1000
|
||||
max:
|
||||
pool:
|
||||
size: 1000
|
||||
queue:
|
||||
capacity: 2000
|
||||
upload:
|
||||
path: /home/cmp
|
||||
cloud:
|
||||
zookeeper:
|
||||
connect-string: 10.20.12.65:2181
|
||||
home: /bocloud/cmp/product
|
||||
auth:
|
||||
username: bocloud
|
||||
password: AES@CoU6oY/zuAoBbu6cdgOKlA==
|
||||
config:
|
||||
enabled: false
|
||||
discovery:
|
||||
register: true
|
||||
enable: true
|
||||
instance-host: 10.20.12.65
|
||||
instance-port: ${server.port}
|
||||
root: ${spring.cloud.zookeeper.home}/services
|
||||
conn:
|
||||
timeout: '50000'
|
||||
session:
|
||||
timeout: '50000'
|
||||
datasource:
|
||||
druid:
|
||||
dialect: mysql
|
||||
url: jdbc:mysql://10.20.12.65:3306/cop?characterEncoding=utf8&useSSL=false
|
||||
username: cmp
|
||||
password: Gy2VghUgWHszx8gLFT4etT9ZVOukJi73KoG1q3Oz/DAz5h2mFVVunjcyaaKT9tMPsBgoWBFRmrYbhgqJqT/Q8A==
|
||||
initialSize: '2'
|
||||
maxActive: '30'
|
||||
minIdle: '2'
|
||||
maxWait: '60000'
|
||||
poolPreparedStatements: 'true'
|
||||
maxOpenPreparedStatements: '20'
|
||||
maxPoolPreparedStatementPerConnectionSize: '20'
|
||||
validationQuery: select 1
|
||||
validationQueryTimeout: '1'
|
||||
testOnBorrow: 'true'
|
||||
testOnReturn: 'true'
|
||||
testWhileIdle: 'true'
|
||||
remove-abandoned: 'true'
|
||||
remove-abandoned-timeout: '60'
|
||||
log-abandoned: 'true'
|
||||
timeBetweenEvictionRunsMillis: '10000'
|
||||
minEvictableIdleTimeMillis: '30001'
|
||||
asyncCloseConnectionEnable: 'true'
|
||||
filters: config,stat,wall,log4j
|
||||
publicKey: MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJfVJOpXYGy8aBCk3zEoKKQDTVCCvJwhhithfY/I5PUvzFBAYygunmuCtUhzPUZ+1RJQds0Q4fu07m5mr5kv5ocCAwEAAQ==
|
||||
connectionProperties: config.decrypt=true;config.decrypt.key=MFwwDQYJKoZIhvcNAQEBBQADSwAwSAJBAJfVJOpXYGy8aBCk3zEoKKQDTVCCvJwhhithfY/I5PUvzFBAYygunmuCtUhzPUZ+1RJQds0Q4fu07m5mr5kv5ocCAwEAAQ==;druid.stat.mergeSql=true;druid.stat.slowSqlMillis=5000
|
||||
use-global-data-source-stat: 'true'
|
||||
rabbitmq:
|
||||
host: 10.20.12.65
|
||||
port: 5672
|
||||
username: admin
|
||||
password: AES@CoU6oY/zuAoBbu6cdgOKlA==
|
||||
virtual-host: cmp
|
||||
dynamic: 'true'
|
||||
banner:
|
||||
charset: UTF-8
|
||||
freemarker:
|
||||
checkTemplateLocation: 'false'
|
||||
redis:
|
||||
# standalone
|
||||
host: 10.20.12.65
|
||||
port: 6379
|
||||
timeout: 60000ms
|
||||
password: AES@CoU6oY/zuAoBbu6cdgOKlA==
|
||||
lettuce:
|
||||
pool:
|
||||
max-active: '1024'
|
||||
max-idle: '16'
|
||||
min-idle: '4'
|
||||
max-wait: -1ms
|
||||
servlet:
|
||||
multipart:
|
||||
max-file-size: 2MB
|
||||
max-request-size: 20MB
|
||||
main:
|
||||
allow-circular-references: true
|
||||
logging:
|
||||
config: classpath:logback-spring.xml
|
||||
dir: /log/services
|
||||
level:
|
||||
root: info
|
||||
com:
|
||||
bocloud: info
|
||||
file:
|
||||
max-size: 100MB
|
||||
max-history: '30'
|
||||
total-size-cap: 2GB
|
|
@ -0,0 +1,8 @@
|
|||
██████ ██ ██████ ████ ████ ███████ ██████████ ████████ ████████
|
||||
░█░░░░██ ██ ██ ░██ ██░░░░██░██░██ ██░██░██░░░░██ ░░░░░██░░░ ██░░░░░░ ░██░░░░░
|
||||
░█ ░██ █████ ░░██ ██ ██████ ███████ ░██ ██ ░░ ░██░░██ ██ ░██░██ ░██ ░██ ░██ ░██
|
||||
░██████ ██░░░██ ░░███ ██░░░░██░░██░░░██ ██████░██ ░██ ░░███ ░██░███████ ░██ ░█████████░███████
|
||||
░█░░░░ ██░███████ ░██ ░██ ░██ ░██ ░██ ██░░░██░██ ░██ ░░█ ░██░██░░░░ ░██ ░░░░░░░░██░██░░░░
|
||||
░█ ░██░██░░░░ ██ ░██ ░██ ░██ ░██░██ ░██░░██ ██░██ ░ ░██░██ ░██ ░██░██
|
||||
░███████ ░░██████ ██ ░░██████ ███ ░██░░██████ ░░██████ ░██ ░██░██ ░██ ████████ ░████████
|
||||
░░░░░░░ ░░░░░░ ░░ ░░░░░░ ░░░ ░░ ░░░░░░ ░░░░░░ ░░ ░░ ░░ ░░ ░░░░░░░░ ░░░░░░░░
|
|
@ -0,0 +1,75 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<!-- 读取application.properties中的配置 -->
|
||||
<springProperty scope="context" name="service.name" source="spring.application.name"/>
|
||||
<springProperty scope="context" name="logging.dir" source="logging.dir"/>
|
||||
<springProperty scope="context" name="logging.file.total-size-cap" source="logging.file.total-size-cap"/>
|
||||
<springProperty scope="context" name="logging.file.max-size" source="logging.file.max-size"/>
|
||||
<springProperty scope="context" name="logging.file.max-history" source="logging.file.max-history"/>
|
||||
<springProperty scope="context" name="logging.level.com.bocloud" source="logging.level.com.bocloud"/>
|
||||
<springProperty scope="context" name="logging.level.root" source="logging.level.root"/>
|
||||
<springProperty scope="context" name="logging.syslog.host" source="logging.syslog.host"/>
|
||||
<springProperty scope="context" name="logging.syslog.port" source="logging.syslog.port"/>
|
||||
<springProperty scope="context" name="logging.syslog.facility" source="logging.syslog.facility"/>
|
||||
<springProperty scope="context" name="logging.syslog.level" source="logging.syslog.level"/>
|
||||
|
||||
<conversionRule conversionWord="ilevel" converterClass="com.bocloud.tse.booter.syslog.SysLogLevelConvertor"/>
|
||||
|
||||
<property name="local_log_pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} %highlight(%-5level) [%thread] [%X{REQUEST_ID}] %cyan(%logger{32}):%L - %msg%n"/>
|
||||
<property name="sys_log_pattern" value="{"level":"%ilevel{%level}","log_level":"%level","time":"%d{yyyy-MM-dd HH:mm:ss.SSS}","thread":"%thread","class":"%logger{36}.%M:%line","message":"%msg"}%n"/>
|
||||
|
||||
<!-- 默认的控制台日志输出,一般生产环境都是后台启动,这个没太大作用 -->
|
||||
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
|
||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||
<pattern>${local_log_pattern}</pattern>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!-- 配置文件轮转 -->
|
||||
<appender name="LOG_FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<File>${logging.dir}/${service.name}.log</File>
|
||||
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<FileNamePattern>${logging.dir}/history/${service.name}.%d{yyyy-MM-dd}.%i.log.gz
|
||||
</FileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>${logging.file.max-size}</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
<MaxHistory>${logging.file.max-history}</MaxHistory>
|
||||
<totalSizeCap>${logging.file.total-size-cap}</totalSizeCap>
|
||||
</rollingPolicy>
|
||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||
<pattern>${local_log_pattern}</pattern>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<!--syslog -->
|
||||
<appender name="SYSLOG" class="com.bocloud.tse.booter.syslog.SysLogAppenderTcpAndUdp">
|
||||
<syslogHost>${logging.syslog.host}</syslogHost> <!-- Syslog 服务器的地址 -->
|
||||
<port>${logging.syslog.port}</port> <!-- Syslog 服务器的端口号 -->
|
||||
<facility>${logging.syslog.facility}</facility> <!-- Syslog 设备标识 -->
|
||||
<suffixPattern>${sys_log_pattern}</suffixPattern>
|
||||
<filter class="ch.qos.logback.classic.filter.ThresholdFilter">
|
||||
<level>${logging.syslog.level}</level>
|
||||
</filter>
|
||||
</appender>
|
||||
|
||||
<root level="${logging.level.root}">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="LOG_FILE"/>
|
||||
<appender-ref ref="SYSLOG"/>
|
||||
</root>
|
||||
|
||||
<logger name="com.bocloud" level="${logging.level.com.bocloud}" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="LOG_FILE"/>
|
||||
<appender-ref ref="SYSLOG"/>
|
||||
</logger>
|
||||
|
||||
<logger name="com.alibaba.druid.pool.DruidAbstractDataSource" level="error" additivity="false">
|
||||
<appender-ref ref="CONSOLE"/>
|
||||
<appender-ref ref="LOG_FILE"/>
|
||||
<appender-ref ref="SYSLOG"/>
|
||||
</logger>
|
||||
|
||||
<logger name="io.lettuce.core.protocol" level="ERROR" />
|
||||
</configuration>
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>com.bocloud</groupId>
|
||||
<artifactId>bocloud.tse</artifactId>
|
||||
<version>6.5.0-LTS-SZ</version>
|
||||
</parent>
|
||||
<artifactId>bocloud.tse.core</artifactId>
|
||||
<dependencies>
|
||||
<!-- megatron -->
|
||||
<dependency>
|
||||
<groupId>com.freedom</groupId>
|
||||
<artifactId>megatron.common</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.freedom</groupId>
|
||||
<artifactId>megatron.framework</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.bocloud</groupId>
|
||||
<artifactId>bocloud.tse.entity</artifactId>
|
||||
</dependency>
|
||||
<!-- oracle -->
|
||||
<dependency>
|
||||
<groupId>com.oracle</groupId>
|
||||
<artifactId>ojdbc6</artifactId>
|
||||
<version>1.0</version>
|
||||
</dependency>
|
||||
<!--sqlserver non official driver -->
|
||||
<dependency>
|
||||
<groupId>net.sourceforge.jtds</groupId>
|
||||
<artifactId>jtds</artifactId>
|
||||
</dependency>
|
||||
<!--使用druid的sql parser进行sql的语法分析 -->
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.bocloud.tse.core.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Inherited
|
||||
public @interface Arg {
|
||||
String code() default "";
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.bocloud.tse.core.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
/**
|
||||
* Worker类型 主要包括:脚本,文件,资源,软件,方法,数据,运维
|
||||
*/
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Inherited
|
||||
public @interface Module {
|
||||
String code() default "task.maintain.scirpt";
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package com.bocloud.tse.core.annotation;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Inherited;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
@Target(ElementType.TYPE)
|
||||
@Inherited
|
||||
public @interface Worker {
|
||||
String name() default "";
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.bocloud.tse.core.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Option {
|
||||
|
||||
private Boolean sudo;
|
||||
private Boolean become;
|
||||
private String becomeUser;
|
||||
private String becomePass;
|
||||
|
||||
public Option() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Option(boolean sudo) {
|
||||
super();
|
||||
this.sudo = sudo;
|
||||
}
|
||||
|
||||
public Option(Boolean sudo, Boolean become) {
|
||||
this.sudo = sudo;
|
||||
this.become = become;
|
||||
}
|
||||
|
||||
public Option(Boolean sudo, Boolean become, String becomeUser, String becomePass) {
|
||||
super();
|
||||
this.sudo = sudo;
|
||||
this.become = become;
|
||||
this.becomeUser = becomeUser;
|
||||
this.becomePass = becomePass;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.bocloud.tse.core.domain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.bocloud.tse.model.WorkerHost;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 目标机器分组,用来整体封装Linux和Windows类型的目标机器
|
||||
*/
|
||||
@Data
|
||||
public class TargetGroup {
|
||||
|
||||
private List<WorkerHost> windows;
|
||||
|
||||
private List<WorkerHost> linuxs;
|
||||
|
||||
public TargetGroup(List<WorkerHost> windows, List<WorkerHost> linuxs) {
|
||||
this.windows = windows;
|
||||
this.linuxs = linuxs;
|
||||
}
|
||||
|
||||
public TargetGroup() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.bocloud.tse.core.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Worker执行的脚本内容封装类
|
||||
*/
|
||||
@Data
|
||||
public class WorkerScript {
|
||||
|
||||
/**
|
||||
* 脚本类型
|
||||
*/
|
||||
private String type;
|
||||
/**
|
||||
* 脚本参数
|
||||
*/
|
||||
private String params;
|
||||
/**
|
||||
* 脚本内容
|
||||
*/
|
||||
private String content;
|
||||
/**
|
||||
* 执行脚本时候的可选参数
|
||||
*/
|
||||
private Option options;
|
||||
/**
|
||||
* 脚本执行是否为异步
|
||||
*/
|
||||
private Boolean async;
|
||||
/**
|
||||
* 脚本执行异步执行超时时间
|
||||
*/
|
||||
private Long asyncTimeout;
|
||||
|
||||
public WorkerScript(String type, String params, String content, Option options, Boolean async, Long asyncTimeout) {
|
||||
super();
|
||||
this.type = type;
|
||||
this.params = params;
|
||||
this.content = content;
|
||||
this.options = options;
|
||||
this.async = async;
|
||||
this.asyncTimeout = asyncTimeout;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WorkerScript [type=" + type + ", params=" + params + ", content=" + content + ", options=" + options
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.bocloud.tse.core.domain.args.maintain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 简单参数封装类用来封装文件分发,备份恢复等模块的参数内容
|
||||
*/
|
||||
@Data
|
||||
public class FileArg {
|
||||
|
||||
private String src;
|
||||
|
||||
private String dest;
|
||||
|
||||
public FileArg(String src, String dest) {
|
||||
this.src = src;
|
||||
this.dest = dest;
|
||||
}
|
||||
|
||||
public FileArg() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.bocloud.tse.core.domain.args.maintain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 配置Host allow参数
|
||||
*/
|
||||
@Data
|
||||
public class HostAllowArg {
|
||||
|
||||
private List<String> workers;
|
||||
private String state;
|
||||
|
||||
public HostAllowArg() {}
|
||||
|
||||
public HostAllowArg(List<String> workers, String state) {
|
||||
super();
|
||||
this.workers = workers;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
package com.bocloud.tse.core.domain.args.maintain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ScriptLocalArg {
|
||||
|
||||
private String content;
|
||||
|
||||
private String type;
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.bocloud.tse.core.domain.args.maintain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ScriptsArg {
|
||||
|
||||
private List<Map<String, Object>> scripts;
|
||||
|
||||
public ScriptsArg(List<Map<String, Object>> scripts) {
|
||||
this.scripts = scripts;
|
||||
}
|
||||
|
||||
public ScriptsArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.bocloud.tse.core.domain.args.maintain;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务参数
|
||||
*/
|
||||
@Data
|
||||
public class ServiceArg {
|
||||
|
||||
private String name;
|
||||
private String state;
|
||||
private Boolean enabled;
|
||||
private String arguments;
|
||||
@JSONField(name = "start_mode")
|
||||
private String startMode;
|
||||
|
||||
public ServiceArg() {}
|
||||
|
||||
public ServiceArg(String name, String state, Boolean enabled, String arguments, String startMode) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.state = state;
|
||||
this.enabled = enabled;
|
||||
this.arguments = arguments;
|
||||
this.startMode = startMode;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.bocloud.tse.core.domain.args.maintain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 用户操作参数
|
||||
*/
|
||||
@Data
|
||||
public class UserArg {
|
||||
|
||||
private String type;
|
||||
private Map<String, Object> sudo;
|
||||
private List<Map<String, Object>> users;
|
||||
|
||||
public UserArg() {}
|
||||
|
||||
public UserArg(String type, Map<String, Object> sudo, List<Map<String, Object>> users) {
|
||||
super();
|
||||
this.type = type;
|
||||
this.sudo = sudo;
|
||||
this.users = users;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActivemqArg {
|
||||
|
||||
private String version;
|
||||
// private List<Map<String, Object>> queue;
|
||||
// private List<Map<String, Object>> topic;
|
||||
// private List<Map<String, Object>> authentication;
|
||||
@JSONField(name = "activemq_admin_user")
|
||||
private List<Map<String, Object>> activemqAdminUser;
|
||||
|
||||
public ActivemqArg(String version, List<Map<String, Object>> activemqAdminUser) {
|
||||
this.version = version;
|
||||
this.activemqAdminUser = activemqAdminUser;
|
||||
}
|
||||
|
||||
public ActivemqArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApacheArg {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "apache_vhosts")
|
||||
private List<Map<String, Object>> apacheVhosts;
|
||||
|
||||
public ApacheArg(Map<String, Object> softwareConfig, List<Map<String, Object>> apacheVhosts) {
|
||||
this.softwareConfig = softwareConfig;
|
||||
if (null != apacheVhosts && !apacheVhosts.isEmpty()) {
|
||||
this.apacheVhosts = apacheVhosts;
|
||||
for (Map<String, Object> vhost : this.apacheVhosts) {
|
||||
Iterator<Entry<String, Object>> iterator = vhost.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Entry<String, Object> entry = iterator.next();
|
||||
if (null == vhost.get(entry.getKey()) || "".equals(vhost.get(entry.getKey()))) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ApacheArg() {}
|
||||
|
||||
public void setApacheVhosts(List<Map<String, Object>> apacheVhosts) {
|
||||
if (null != apacheVhosts && !apacheVhosts.isEmpty()) {
|
||||
this.apacheVhosts = apacheVhosts;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ElasticsearchArg {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "cluster_name")
|
||||
private String clusterName;
|
||||
|
||||
public ElasticsearchArg() {}
|
||||
|
||||
public ElasticsearchArg(Map<String, Object> softwareConfig, String clusterName) {
|
||||
super();
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.clusterName = clusterName;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EtcdArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "etcd_secure")
|
||||
private boolean etcdSecure;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "etcd_initial_cluster_token")
|
||||
private String etcdInitialClusterToken;
|
||||
|
||||
public EtcdArg(String version, boolean clusterInstall, boolean etcdSecure, Map<String, Object> softwareConfig,
|
||||
String etcdInitialClusterToken) {
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.etcdSecure = etcdSecure;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.etcdInitialClusterToken = etcdInitialClusterToken;
|
||||
}
|
||||
|
||||
public EtcdArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExporterArg {
|
||||
|
||||
private String version;
|
||||
private String path;
|
||||
|
||||
public ExporterArg() {}
|
||||
|
||||
public ExporterArg(String version, String path) {
|
||||
this.version = version;
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GitlabArg {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "gitlab_root_password")
|
||||
private String gitlabRootPassword;
|
||||
|
||||
public GitlabArg() {}
|
||||
|
||||
public GitlabArg(Map<String, Object> softwareConfig, String gitlabRootPassword) {
|
||||
super();
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.gitlabRootPassword = gitlabRootPassword;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class JdkArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "install_jce")
|
||||
private boolean installJce;
|
||||
@JSONField(name = "set_java_home")
|
||||
private boolean setJavaHome;
|
||||
|
||||
public JdkArg(String version, boolean installJce, boolean setJavaHome) {
|
||||
this.version = version;
|
||||
this.installJce = installJce;
|
||||
this.setJavaHome = setJavaHome;
|
||||
}
|
||||
|
||||
public JdkArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class JenkinsArg {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "jenkins_admin_username")
|
||||
private String jenkinsAdminUsername;
|
||||
@JSONField(name = "jenkins_admin_password")
|
||||
private String jenkinsAdminPassword;
|
||||
|
||||
public JenkinsArg() {}
|
||||
|
||||
public JenkinsArg(Map<String, Object> softwareConfig, String jenkinsAdminUsername, String jenkinsAdminPassword) {
|
||||
super();
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.jenkinsAdminUsername = jenkinsAdminUsername;
|
||||
this.jenkinsAdminPassword = jenkinsAdminPassword;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class K8sArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "container_config")
|
||||
private Map<String, Object> containerConfig;
|
||||
@JSONField(name = "k8s_config")
|
||||
private Map<String, Object> k8sConfig;
|
||||
@JSONField(name = "network_config")
|
||||
private Map<String, Object> networkConfig;
|
||||
@JSONField(name = "storage_config")
|
||||
private Map<String, Object> storageConfig;
|
||||
@JSONField(name = "harbor_config")
|
||||
private Map<String, Object> harborConfig;
|
||||
|
||||
public K8sArg(String version, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
Map<String, Object> containerConfig, Map<String, Object> k8sConfig, Map<String, Object> networkConfig,
|
||||
Map<String, Object> storageConfig, Map<String, Object> harborConfig) {
|
||||
super();
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.containerConfig = containerConfig;
|
||||
this.k8sConfig = k8sConfig;
|
||||
this.networkConfig = networkConfig;
|
||||
this.storageConfig = storageConfig;
|
||||
this.harborConfig = harborConfig;
|
||||
}
|
||||
|
||||
public K8sArg() {}
|
||||
|
||||
public void setHarborConfig(Map<String, Object> harborConfig) {
|
||||
if (null == harborConfig || harborConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.harborConfig = harborConfig;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.front.software.KafkaZkFront;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class KafkaArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "zookeeper")
|
||||
private KafkaZkFront zookeeper;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "jmx_exporter_config")
|
||||
private Map<String, Object> jmxExporterConfig;
|
||||
@JSONField(name = "install_jmx_exporter")
|
||||
private boolean installJmxExporter;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "install_kafka_exporter")
|
||||
private boolean installKafkaExporter;
|
||||
@JSONField(name = "auth_config")
|
||||
private Map<String, Object> authConfig;
|
||||
@JSONField(name = "kafka_server")
|
||||
private Map<String, Object> kafkaServer;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
|
||||
public KafkaArg(String version, boolean clusterInstall, Map<String, Object> softwareConfig, KafkaZkFront zookeeper,
|
||||
Map<String, Object> manageConfig, Map<String, Object> jmxExporterConfig, boolean installJmxExporter,
|
||||
List<Map<String, Object>> mntDisks, boolean installKafkaExporter, Map<String, Object> authConfig,
|
||||
Map<String, Object> kafkaServer, boolean installTelegraf) {
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.zookeeper = zookeeper;
|
||||
this.manageConfig = manageConfig;
|
||||
this.jmxExporterConfig = jmxExporterConfig;
|
||||
this.installJmxExporter = installJmxExporter;
|
||||
this.mntDisks = mntDisks;
|
||||
this.installKafkaExporter = installKafkaExporter;
|
||||
this.authConfig = authConfig;
|
||||
this.kafkaServer = kafkaServer;
|
||||
this.installTelegraf = installTelegraf;
|
||||
}
|
||||
|
||||
public KafkaArg() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void setJmxExporterConfig(Map<String, Object> jmxExporterConfig) {
|
||||
if (null == jmxExporterConfig || jmxExporterConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.jmxExporterConfig = jmxExporterConfig;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
public void setAuthConfig(Map<String, Object> authConfig) {
|
||||
if (null == authConfig || authConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.authConfig = authConfig;
|
||||
}
|
||||
|
||||
public void setKafkaServer(Map<String, Object> kafkaServer) {
|
||||
if (null == kafkaServer || kafkaServer.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.kafkaServer = kafkaServer;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
import com.bocloud.tse.core.domain.group.GroupHost;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MemcacheArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "magent_config")
|
||||
private Map<String, Object> magentConfig;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
|
||||
public MemcacheArg(String version, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
Map<String, Object> magentConfig, List<Group> groups, boolean installTelegraf) {
|
||||
super();
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
if (clusterInstall) {
|
||||
if (null == magentConfig) {
|
||||
magentConfig = new HashMap<>();
|
||||
}
|
||||
if (!magentConfig.containsKey("magent_port")) {
|
||||
magentConfig.put("magent_port", 12000);
|
||||
}
|
||||
List<String> masters = new ArrayList<>();
|
||||
List<String> slavers = new ArrayList<>();
|
||||
for (Group group : groups) {
|
||||
if ("memcached_masters".equals(group.getName())) {
|
||||
List<GroupHost> hosts = group.getHosts();
|
||||
for (GroupHost host : hosts) {
|
||||
masters.add(host.getHost() + ":" + softwareConfig.get("memcached_port"));
|
||||
}
|
||||
} else if ("memcached_backups".equals(group.getName())) {
|
||||
List<GroupHost> hosts = group.getHosts();
|
||||
for (GroupHost host : hosts) {
|
||||
slavers.add(host.getHost() + ":" + softwareConfig.get("memcached_port"));
|
||||
}
|
||||
}
|
||||
}
|
||||
magentConfig.put("memcached_servers", masters);
|
||||
magentConfig.put("memcached_backups", slavers);
|
||||
this.magentConfig = magentConfig;
|
||||
}
|
||||
this.installTelegraf = installTelegraf;
|
||||
}
|
||||
|
||||
public MemcacheArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,62 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MongodbArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "mongodb_users")
|
||||
private List<Map<String, Object>> mongodbUsers;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
|
||||
public MongodbArg() {}
|
||||
|
||||
public MongodbArg(String version, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
Map<String, Object> manageConfig, List<Map<String, Object>> mongodbUsers, List<Map<String, Object>> mntDisks,
|
||||
boolean installTelegraf) {
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.manageConfig = manageConfig;
|
||||
this.mongodbUsers = mongodbUsers;
|
||||
this.mntDisks = mntDisks;
|
||||
this.installTelegraf = installTelegraf;
|
||||
}
|
||||
|
||||
public void setManageConfig(Map<String, Object> manageConfig) {
|
||||
if (null == manageConfig || manageConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.manageConfig = manageConfig;
|
||||
}
|
||||
|
||||
public void setMongodbUsers(List<Map<String, Object>> mongodbUsers) {
|
||||
if (null == mongodbUsers || mongodbUsers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mongodbUsers = mongodbUsers;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,92 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MysqlArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "cluster_type")
|
||||
private String clusterType;
|
||||
@JSONField(name = "mgr_group_name")
|
||||
private String mgrGroupName;
|
||||
@JSONField(name = "keepalived_virtual_router_id")
|
||||
private Integer keepalivedVirtualRouterId;
|
||||
@JSONField(name = "mysql_vip")
|
||||
private String mysqlVip;
|
||||
@JSONField(name = "mysql_vip_netmask")
|
||||
private String mysqlVipNetmask;
|
||||
@JSONField(name = "mysql_replication_master")
|
||||
private String mysqlReplicationMaster;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "mysql_databases")
|
||||
private List<Map<String, Object>> mysqlDatabases;
|
||||
@JSONField(name = "mysql_users")
|
||||
private List<Map<String, Object>> mysqlUsers;
|
||||
@JSONField(name = "mysql_replication_user")
|
||||
private Map<String, Object> mysqlReplicationUser;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
|
||||
public MysqlArg(String version, boolean clusterInstall, String clusterType, String mgrGroupName,
|
||||
Integer keepalivedVirtualRouterId, String mysqlVip, String mysqlVipNetmask, String mysqlReplicationMaster,
|
||||
Map<String, Object> softwareConfig, List<Map<String, Object>> mysqlDatabases,
|
||||
List<Map<String, Object>> mysqlUsers, Map<String, Object> mysqlReplicationUser,
|
||||
List<Map<String, Object>> mntDisks, boolean installTelegraf) {
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.clusterType = clusterType;
|
||||
this.mgrGroupName = mgrGroupName;
|
||||
this.keepalivedVirtualRouterId = keepalivedVirtualRouterId;
|
||||
this.mysqlVip = mysqlVip;
|
||||
this.mysqlVipNetmask = mysqlVipNetmask;
|
||||
this.mysqlReplicationMaster = mysqlReplicationMaster;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.mysqlDatabases = mysqlDatabases;
|
||||
this.mysqlUsers = mysqlUsers;
|
||||
this.mysqlReplicationUser = mysqlReplicationUser;
|
||||
this.mntDisks = mntDisks;
|
||||
this.installTelegraf = installTelegraf;
|
||||
}
|
||||
|
||||
public MysqlArg() {}
|
||||
|
||||
public void setMysqlDatabases(List<Map<String, Object>> mysqlDatabases) {
|
||||
if (null == mysqlDatabases || mysqlDatabases.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mysqlDatabases = mysqlDatabases;
|
||||
}
|
||||
|
||||
public void setMysqlUsers(List<Map<String, Object>> mysqlUsers) {
|
||||
if (null == mysqlUsers || mysqlUsers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mysqlUsers = mysqlUsers;
|
||||
}
|
||||
|
||||
public void setMysqlReplicationUser(Map<String, Object> mysqlReplicationUser) {
|
||||
if (null == mysqlReplicationUser || mysqlReplicationUser.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mysqlReplicationUser = mysqlReplicationUser;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NfsArg {
|
||||
|
||||
@JSONField(name = "nfs_server")
|
||||
private Map<String, Object> nfsServer;
|
||||
@JSONField(name = "nfs_client")
|
||||
private boolean nfsClient;
|
||||
|
||||
public NfsArg(Map<String, Object> nfsServer, boolean nfsClient) {
|
||||
this.nfsServer = nfsServer;
|
||||
this.nfsClient = nfsClient;
|
||||
}
|
||||
|
||||
public NfsArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,61 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.common.NginxConfig;
|
||||
import com.bocloud.tse.core.domain.common.NginxHttpParam;
|
||||
import com.bocloud.tse.core.domain.common.NginxSite;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NginxArg {
|
||||
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall = false;
|
||||
//nginx http配置
|
||||
@JSONField(name = "nginx_http_params")
|
||||
private NginxHttpParam nginxHttpParam;
|
||||
//nginx 配置
|
||||
@JSONField(name = "nginx_configs")
|
||||
private NginxConfig nginxConfig;
|
||||
//nginx 站点配置
|
||||
@JSONField(name = "nginx_sites")
|
||||
private Map<String, NginxSite> nginxSites;
|
||||
@JSONField(name = "sites_listen_ports")
|
||||
private List<Integer> sitesListenPorts;
|
||||
|
||||
public NginxArg() {}
|
||||
|
||||
public NginxArg(boolean clusterInstall, NginxHttpParam nginxHttpParam, NginxConfig nginxConfig,
|
||||
Map<String, NginxSite> nginxSites) {
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.nginxHttpParam = nginxHttpParam;
|
||||
this.nginxConfig = nginxConfig;
|
||||
this.nginxSites = nginxSites;
|
||||
if (null != this.nginxSites && !nginxSites.isEmpty()) {
|
||||
sitesListenPorts = new ArrayList<>();
|
||||
for (NginxSite site : nginxSites.values()) {
|
||||
sitesListenPorts.add(site.getListen());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void setNginxConfig(NginxConfig nginxConfig) {
|
||||
if (null != nginxConfig && nginxConfig.empty()) {
|
||||
return;
|
||||
}
|
||||
this.nginxConfig = nginxConfig;
|
||||
}
|
||||
|
||||
public void setNginxSites(Map<String, NginxSite> nginxSites) {
|
||||
if (null != nginxSites && nginxSites.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.nginxSites = nginxSites;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,56 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OracleArg {
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "oracle_databases")
|
||||
private List<Map<String, Object>> oracleDatabases;
|
||||
@JSONField(name = "asm_diskgroups")
|
||||
private Map<String, List<Map<String, Object>>> asmDiskGroups;
|
||||
@JSONField(name = "host_fs_layout")
|
||||
private List<Map<String, Object>> hostFsLayout;
|
||||
|
||||
public OracleArg(String version, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
Map<String, Object> manageConfig, List<Map<String, Object>> oracleDatabases,
|
||||
Map<String, List<Map<String, Object>>> asmDiskGroups, List<Map<String, Object>> hostFsLayout) {
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
if (null != softwareConfig && !softwareConfig.isEmpty()) {
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
this.manageConfig = manageConfig;
|
||||
this.asmDiskGroups = asmDiskGroups;
|
||||
this.hostFsLayout = hostFsLayout;
|
||||
if (null != oracleDatabases && !oracleDatabases.isEmpty()) {
|
||||
this.oracleDatabases = oracleDatabases;
|
||||
for (Map<String, Object> database : this.oracleDatabases) {
|
||||
Iterator<Entry<String, Object>> iterator = database.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Entry<String, Object> entry = iterator.next();
|
||||
if (null == database.get(entry.getKey()) || "".equals(database.get(entry.getKey()).toString())
|
||||
|| "[]".equals(database.get(entry.getKey()).toString())) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public OracleArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PhpArg {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
|
||||
public PhpArg() {}
|
||||
|
||||
public PhpArg(Map<String, Object> softwareConfig) {
|
||||
super();
|
||||
if (softwareConfig.containsKey("php_packages")) {
|
||||
String value = softwareConfig.get("php_packages").toString();
|
||||
if (value.contains(",")) {
|
||||
softwareConfig.put("php_packages", Arrays.asList(value.split(",")));
|
||||
}
|
||||
}
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
|
||||
public void setSoftwareConfig(Map<String, Object> softwareConfig) {
|
||||
if (softwareConfig.containsKey("php_packages")) {
|
||||
String value = softwareConfig.get("php_packages").toString();
|
||||
if (value.contains(",")) {
|
||||
softwareConfig.put("php_packages", Arrays.asList(value.split(",")));
|
||||
}
|
||||
}
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,160 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PostgresqlArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "postgresql_databases")
|
||||
private List<Map<String, Object>> postgresqlDatabases;
|
||||
@JSONField(name = "postgresql_users")
|
||||
private List<Map<String, Object>> postgresqlUsers;
|
||||
@JSONField(name = "postgresql_privileges")
|
||||
private List<Map<String, Object>> postgresqlPrivileges;
|
||||
@JSONField(name = "postgresql_schemas")
|
||||
private List<Map<String, Object>> postgresqlSchemas;
|
||||
@JSONField(name = "postgresql_extensions")
|
||||
private List<Map<String, Object>> postgresqlExtensions;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "etcd_config")
|
||||
private Map<String, Object> etcdConfig;
|
||||
@JSONField(name = "cluster_config")
|
||||
private Map<String, Object> clusterConfig;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
@JSONField(name = "postgresql_bocloud_user")
|
||||
private String postgresqlBocloudUser;
|
||||
@JSONField(name = "postgresql_bocloud_password")
|
||||
private String postgresqlBocloudPassword;
|
||||
|
||||
public PostgresqlArg(String version, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
List<Map<String, Object>> postgresqlDatabases, List<Map<String, Object>> postgresqlUsers,
|
||||
List<Map<String, Object>> postgresqlPrivileges, List<Map<String, Object>> postgresqlSchemas,
|
||||
List<Map<String, Object>> postgresqlExtensions, List<Map<String, Object>> mntDisks,
|
||||
Map<String, Object> etcdConfig, Map<String, Object> clusterConfig, boolean installTelegraf,
|
||||
String postgresqlBocloudUser, String postgresqlBocloudPassword) {
|
||||
super();
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.postgresqlUsers = postgresqlUsers;
|
||||
this.postgresqlPrivileges = postgresqlPrivileges;
|
||||
this.postgresqlSchemas = postgresqlSchemas;
|
||||
this.postgresqlExtensions = postgresqlExtensions;
|
||||
if (null != postgresqlDatabases && !postgresqlDatabases.isEmpty()) {
|
||||
this.postgresqlDatabases = postgresqlDatabases;
|
||||
for (Map<String, Object> databases : this.postgresqlDatabases) {
|
||||
Iterator<Entry<String, Object>> iterator = databases.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
Entry<String, Object> entry = iterator.next();
|
||||
if (null == databases.get(entry.getKey()) || "".equals(databases.get(entry.getKey()))) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
if (clusterInstall) {
|
||||
if (null == etcdConfig || etcdConfig.isEmpty()) {
|
||||
etcdConfig = new JSONObject();
|
||||
etcdConfig.put("version", "3.1.20");
|
||||
etcdConfig.put("cluster_install", true);
|
||||
etcdConfig.put("etcd_secure", false);
|
||||
etcdConfig.put("etcd_initial_cluster_token", "etcd-cluster");
|
||||
JSONObject etcdSoftConfig = new JSONObject();
|
||||
etcdSoftConfig.put("etcd_data_dir", "/var/cache/etcd/state");
|
||||
etcdSoftConfig.put("etcd_client_port", 2379);
|
||||
etcdSoftConfig.put("etcd_peer_port", 2380);
|
||||
etcdConfig.put("software_config", etcdSoftConfig);
|
||||
}
|
||||
if (null == clusterConfig) {
|
||||
clusterConfig = new JSONObject();
|
||||
}
|
||||
clusterConfig.put("with_haproxy_load_balancing", true);
|
||||
clusterConfig.put("patroni_etcd_port", 2379);
|
||||
clusterConfig.put("patroni_cluster_name", "postgre_cluster");
|
||||
this.etcdConfig = etcdConfig;
|
||||
this.clusterConfig = clusterConfig;
|
||||
}
|
||||
this.installTelegraf = installTelegraf;
|
||||
this.postgresqlBocloudUser = postgresqlBocloudUser;
|
||||
this.postgresqlBocloudPassword = postgresqlBocloudPassword;
|
||||
}
|
||||
|
||||
public PostgresqlArg() {}
|
||||
|
||||
public void setPostgresqlDatabases(List<Map<String, Object>> postgresqlDatabases) {
|
||||
if (null == postgresqlDatabases || postgresqlDatabases.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlDatabases = postgresqlDatabases;
|
||||
}
|
||||
|
||||
public void setPostgresqlUsers(List<Map<String, Object>> postgresqlUsers) {
|
||||
if (null == postgresqlUsers || postgresqlUsers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlUsers = postgresqlUsers;
|
||||
}
|
||||
|
||||
public void setPostgresqlPrivileges(List<Map<String, Object>> postgresqlPrivileges) {
|
||||
if (null == postgresqlPrivileges || postgresqlPrivileges.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlPrivileges = postgresqlPrivileges;
|
||||
}
|
||||
|
||||
public void setPostgresqlSchemas(List<Map<String, Object>> postgresqlSchemas) {
|
||||
if (null == postgresqlSchemas || postgresqlSchemas.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlSchemas = postgresqlSchemas;
|
||||
}
|
||||
|
||||
public void setPostgresqlExtensions(List<Map<String, Object>> postgresqlExtensions) {
|
||||
if (null == postgresqlExtensions || postgresqlExtensions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlExtensions = postgresqlExtensions;
|
||||
}
|
||||
|
||||
public List<Map<String, Object>> getMntDisks() {
|
||||
return mntDisks;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
public void setEtcdConfig(Map<String, Object> etcdConfig) {
|
||||
if (null == etcdConfig || etcdConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.etcdConfig = etcdConfig;
|
||||
}
|
||||
|
||||
public void setClusterConfig(Map<String, Object> clusterConfig) {
|
||||
if (null == clusterConfig || clusterConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.clusterConfig = clusterConfig;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RabbitmqArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "rabbitmq_users")
|
||||
private List<Map<String, Object>> rabbitmqUsers;
|
||||
@JSONField(name = "rabbitmq_vhosts")
|
||||
private List<Map<String, Object>> rabbitmqVhosts;
|
||||
@JSONField(name = "rabbitmq_plugins")
|
||||
private List<Map<String, Object>> rabbitmqPlugins;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
@JSONField(name = "rabbitmq_admin_user")
|
||||
private String rabbitmqAdminUser;
|
||||
@JSONField(name = "rabbitmq_admin_password")
|
||||
private String rabbitmqAdminPassword;
|
||||
|
||||
public RabbitmqArg(String version, boolean clusterInstall, List<Map<String, Object>> rabbitmqUsers,
|
||||
List<Map<String, Object>> rabbitmqVhosts, List<Map<String, Object>> rabbitmqPlugins,
|
||||
List<Map<String, Object>> mntDisks, boolean installTelegraf, String rabbitmqAdminUser,
|
||||
String rabbitmqAdminPassword) {
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.rabbitmqUsers = rabbitmqUsers;
|
||||
this.rabbitmqVhosts = rabbitmqVhosts;
|
||||
this.rabbitmqPlugins = rabbitmqPlugins;
|
||||
this.mntDisks = mntDisks;
|
||||
this.installTelegraf = installTelegraf;
|
||||
this.rabbitmqAdminUser = rabbitmqAdminUser;
|
||||
this.rabbitmqAdminPassword = rabbitmqAdminPassword;
|
||||
}
|
||||
|
||||
public RabbitmqArg() {}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RacIscsiArg {
|
||||
|
||||
@JSONField(name = "iscsi_config")
|
||||
private Map<String, Object> iscsiConfig;
|
||||
|
||||
public RacIscsiArg(Map<String, Object> iscsiConfig) {
|
||||
this.iscsiConfig = iscsiConfig;
|
||||
}
|
||||
|
||||
public RacIscsiArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,58 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RedisArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
@JSONField(name = "redis_master_nodes")
|
||||
private List<String> redisMasterNodes;
|
||||
@JSONField(name = "redis_slave_nodes")
|
||||
private List<String> redisSlaveNodes;
|
||||
|
||||
public RedisArg(String version, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
Map<String, Object> manageConfig, List<Map<String, Object>> mntDisks, boolean installTelegraf,
|
||||
List<String> redisMasterNodes, List<String> redisSlaveNodes) {
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.manageConfig = manageConfig;
|
||||
this.mntDisks = mntDisks;
|
||||
this.installTelegraf = installTelegraf;
|
||||
this.redisMasterNodes = redisMasterNodes;
|
||||
this.redisSlaveNodes = redisSlaveNodes;
|
||||
}
|
||||
|
||||
public RedisArg() {}
|
||||
|
||||
public void setManageConfig(Map<String, Object> manageConfig) {
|
||||
if (null == manageConfig || manageConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.manageConfig = manageConfig;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
import com.bocloud.tse.core.domain.group.GroupHost;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RocketmqArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "cluster_name")
|
||||
private String clusterName;
|
||||
@JSONField(name = "rocketmq_nameserver_list")
|
||||
private String rocketmqNameserverList;
|
||||
@JSONField(name = "install_rocketmq_exporter")
|
||||
private boolean installRocketmqExporter;
|
||||
|
||||
public RocketmqArg(String version, boolean clusterInstall, Map<String, Object> softwareConfig, String clusterName,
|
||||
boolean installRocketmqExporter, List<Group> groups) {
|
||||
super();
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.clusterName = clusterName;
|
||||
this.installRocketmqExporter = installRocketmqExporter;
|
||||
String nameservers = "";
|
||||
for (Group group : groups) {
|
||||
if (!"rocketmq_namesrv".equals(group.getName())) {
|
||||
continue;
|
||||
}
|
||||
List<GroupHost> hosts = group.getHosts();
|
||||
for (GroupHost host : hosts) {
|
||||
nameservers += host.getHost() + ":" + softwareConfig.get("rocketmq_nameserver_port") + ";";
|
||||
}
|
||||
}
|
||||
if (nameservers.contains(";")) {
|
||||
nameservers = nameservers.substring(0, nameservers.length() - 1);
|
||||
}
|
||||
this.rocketmqNameserverList = nameservers;
|
||||
}
|
||||
|
||||
public RocketmqArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SqlserverArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "win_disk")
|
||||
private Map<String, Object> winDisk;
|
||||
|
||||
public SqlserverArg(String version, Map<String, Object> softwareConfig, Map<String, Object> winDisk) {
|
||||
this.version = version;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.winDisk = winDisk;
|
||||
}
|
||||
|
||||
public SqlserverArg() {}
|
||||
|
||||
public void setWinDisk(Map<String, Object> winDisk) {
|
||||
if (null == winDisk || winDisk.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.winDisk = winDisk;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.common.TomcatInstance;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TomcatArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "tomcat_instances")
|
||||
private List<TomcatInstance> tomcatInstances;
|
||||
|
||||
public TomcatArg() {}
|
||||
|
||||
public TomcatArg(String version, Map<String, Object> softwareConfig, List<TomcatInstance> tomcatInstances) {
|
||||
this.version = version;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.tomcatInstances = tomcatInstances;
|
||||
}
|
||||
|
||||
public void setTomcatInstances(List<TomcatInstance> tomcatInstances) {
|
||||
if (null != tomcatInstances && !tomcatInstances.isEmpty()) {
|
||||
this.tomcatInstances = tomcatInstances;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WebSphereArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
|
||||
public WebSphereArg(Map<String, Object> softwareConfig) {
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
|
||||
public WebSphereArg(String version, Map<String, Object> softwareConfig) {
|
||||
this.version = version;
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
|
||||
public WebSphereArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WeblogicArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "jdk_version")
|
||||
private String jdkVersion;
|
||||
@JSONField(name = "os_user")
|
||||
private String osUser;
|
||||
|
||||
public WeblogicArg(String version, Map<String, Object> softwareConfig, Map<String, Object> manageConfig,
|
||||
String jdkVersion, String osUser) {
|
||||
this.version = version;
|
||||
if (null != softwareConfig && !softwareConfig.isEmpty()) {
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
this.manageConfig = manageConfig;
|
||||
this.jdkVersion = jdkVersion;
|
||||
this.osUser = osUser;
|
||||
}
|
||||
|
||||
public WeblogicArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WebspheremqArg {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "version")
|
||||
private String version;
|
||||
|
||||
public WebspheremqArg() {}
|
||||
|
||||
public WebspheremqArg(Map<String, Object> softwareConfig, String version) {
|
||||
super();
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.version = version;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,35 @@
|
|||
package com.bocloud.tse.core.domain.args.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ZookeeperArg {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
|
||||
public ZookeeperArg(String version, Map<String, Object> softwareConfig) {
|
||||
this.version = version;
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
|
||||
public ZookeeperArg(String version, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
boolean installTelegraf) {
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.installTelegraf = installTelegraf;
|
||||
}
|
||||
|
||||
public ZookeeperArg() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.bocloud.tse.core.domain.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.megatron.common.utils.ListTool;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NginxConfig {
|
||||
|
||||
private List<String> proxy;
|
||||
private List<String> upstream;
|
||||
private List<String> geo;
|
||||
private List<String> ssl;
|
||||
private List<String> gzip;
|
||||
|
||||
public NginxConfig() {}
|
||||
|
||||
public void setProxy(List<String> proxy) {
|
||||
if (ListTool.isEmpty(proxy)) {
|
||||
return;
|
||||
}
|
||||
this.proxy = new ArrayList<>();
|
||||
for (String data : proxy) {
|
||||
this.proxy.add(data.replace("\n", " "));
|
||||
}
|
||||
}
|
||||
|
||||
public void setUpstream(List<String> upstream) {
|
||||
if (ListTool.isEmpty(upstream)) {
|
||||
return;
|
||||
}
|
||||
this.upstream = new ArrayList<>();
|
||||
for (String data : upstream) {
|
||||
this.upstream.add(data.replace("\n", " "));
|
||||
}
|
||||
}
|
||||
|
||||
public void setGeo(List<String> geo) {
|
||||
if (ListTool.isEmpty(geo)) {
|
||||
return;
|
||||
}
|
||||
this.geo = new ArrayList<>();
|
||||
for (String data : geo) {
|
||||
this.geo.add(data.replace("\n", " "));
|
||||
}
|
||||
}
|
||||
|
||||
public void setSsl(List<String> ssl) {
|
||||
if (ListTool.isEmpty(ssl)) {
|
||||
return;
|
||||
}
|
||||
this.ssl = new ArrayList<>();
|
||||
for (String data : ssl) {
|
||||
this.ssl.add(data.replace("\n", " "));
|
||||
}
|
||||
}
|
||||
|
||||
public void setGzip(List<String> gzip) {
|
||||
if (ListTool.isEmpty(gzip)) {
|
||||
return;
|
||||
}
|
||||
this.gzip = new ArrayList<>();
|
||||
for (String data : gzip) {
|
||||
this.gzip.add(data.replace("\n", " "));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean empty() {
|
||||
return null == proxy && null == upstream && null == geo && null == ssl && null == gzip;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
package com.bocloud.tse.core.domain.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.megatron.common.utils.ListTool;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NginxHttpParam {
|
||||
|
||||
private String sendfile;
|
||||
@JSONField(name = "tcp_nopush")
|
||||
private String tcpNopush;
|
||||
@JSONField(name = "tcp_nodelay")
|
||||
private String tcpNodelay;
|
||||
@JSONField(name = "server_tokens")
|
||||
private String serverTokens;
|
||||
@JSONField(name = "access_log")
|
||||
private String accessLog;
|
||||
@JSONField(name = "error_log")
|
||||
private String errorLog;
|
||||
private List<String> options;
|
||||
|
||||
public NginxHttpParam() {}
|
||||
|
||||
public void setOptions(List<String> options) {
|
||||
if (ListTool.isEmpty(options)) {
|
||||
return;
|
||||
}
|
||||
this.options = new ArrayList<>();
|
||||
for (String data : options) {
|
||||
this.options.add(data.replace("\n", " "));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.bocloud.tse.core.domain.common;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.megatron.common.utils.ListTool;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NginxSite {
|
||||
|
||||
private Integer listen;
|
||||
@JSONField(name = "server_name")
|
||||
private String serverName;
|
||||
private String root;
|
||||
private String index;
|
||||
private List<String> location;
|
||||
|
||||
public NginxSite() {}
|
||||
|
||||
public void setLocation(List<String> location) {
|
||||
if (ListTool.isEmpty(location)) {
|
||||
return;
|
||||
}
|
||||
this.location = new ArrayList<>();
|
||||
for (String data : location) {
|
||||
this.location.add(data.replace("\n", " "));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package com.bocloud.tse.core.domain.common;
|
||||
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TomcatInstance {
|
||||
|
||||
private String name;
|
||||
private String user;
|
||||
private String home;
|
||||
private String path;
|
||||
private String group;
|
||||
@JSONField(name = "port_ajp")
|
||||
private Integer portAjp;
|
||||
@JSONField(name = "port_redirect")
|
||||
private Integer portRedirect;
|
||||
@JSONField(name = "port_connector")
|
||||
private Integer portConnector;
|
||||
@JSONField(name = "port_shutdown")
|
||||
private Integer portShutdown;
|
||||
@JSONField(name = "catalina_opts")
|
||||
private String catalinaOpts;
|
||||
@JSONField(name = "service_name")
|
||||
private String serviceName;
|
||||
@JSONField(name = "service_file")
|
||||
private String serviceFile;
|
||||
@JSONField(name = "override_uri_encoding")
|
||||
private String overrideUriEncoding;
|
||||
|
||||
public void setUser(String user) {
|
||||
if (StringUtils.hasText(user)) {
|
||||
this.user = user;
|
||||
}
|
||||
}
|
||||
|
||||
public void setHome(String home) {
|
||||
if (StringUtils.hasText(home)) {
|
||||
this.home = home;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
if (StringUtils.hasText(path)) {
|
||||
this.path = path;
|
||||
}
|
||||
}
|
||||
|
||||
public void setGroup(String group) {
|
||||
if (StringUtils.hasText(group)) {
|
||||
this.group = group;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPortAjp(Integer portAjp) {
|
||||
if (null != portAjp && portAjp > 0) {
|
||||
this.portAjp = portAjp;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPortRedirect(Integer portRedirect) {
|
||||
if (null != portRedirect && portRedirect > 0) {
|
||||
this.portRedirect = portRedirect;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPortConnector(Integer portConnector) {
|
||||
if (null != portConnector && portConnector > 0) {
|
||||
this.portConnector = portConnector;
|
||||
}
|
||||
}
|
||||
|
||||
public void setPortShutdown(Integer portShutdown) {
|
||||
if (null != portShutdown && portShutdown > 0) {
|
||||
this.portShutdown = portShutdown;
|
||||
}
|
||||
}
|
||||
|
||||
public void setCatalinaOpts(String catalinaOpts) {
|
||||
if (StringUtils.hasText(catalinaOpts)) {
|
||||
this.catalinaOpts = catalinaOpts;
|
||||
}
|
||||
}
|
||||
|
||||
public void setServiceName(String serviceName) {
|
||||
if (StringUtils.hasText(serviceName)) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
}
|
||||
|
||||
public void setServiceFile(String serviceFile) {
|
||||
if (StringUtils.hasText(serviceFile)) {
|
||||
this.serviceFile = serviceFile;
|
||||
}
|
||||
}
|
||||
|
||||
public void setOverrideUriEncoding(String overrideUriEncoding) {
|
||||
if (StringUtils.hasText(overrideUriEncoding)) {
|
||||
this.overrideUriEncoding = overrideUriEncoding;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,52 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import com.bocloud.tse.core.utils.DBDriver;
|
||||
import com.megatron.common.model.GeneralResult;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DBFront {
|
||||
|
||||
private String category;
|
||||
private String driver;
|
||||
private String database;
|
||||
private Long scriptId;
|
||||
private List<Long> groupId;
|
||||
private String jdbcUrl;
|
||||
private String username;
|
||||
private String password;
|
||||
private String content;
|
||||
|
||||
public DBFront(String category, String driver, Long scriptId, List<Long> groupId, String jdbcUrl, String username,
|
||||
String password, String content, String database) {
|
||||
this.category = category;
|
||||
this.driver = driver;
|
||||
this.scriptId = scriptId;
|
||||
this.groupId = groupId;
|
||||
this.jdbcUrl = jdbcUrl;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
this.content = content;
|
||||
this.database = database;
|
||||
}
|
||||
|
||||
public DBFront() {}
|
||||
|
||||
public DBDriver getDBDriver() throws Exception {
|
||||
if (StringUtils.isEmpty(database)) {
|
||||
throw new Exception("database driver is null!");
|
||||
}
|
||||
GeneralResult<DBDriver> hasResult = DBDriver.has(database);
|
||||
if (hasResult.isFailed()) {
|
||||
throw new Exception("no specific driver found!");
|
||||
} else {
|
||||
return hasResult.getData();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class FileFront {
|
||||
|
||||
// 文件源路径
|
||||
private String source;
|
||||
// 文件目标路径
|
||||
private String target;
|
||||
|
||||
public FileFront(String source, String target) {
|
||||
this.source = source;
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public FileFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* gaia部署模板参数
|
||||
*
|
||||
* @author weiwei
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class GaiaFront {
|
||||
|
||||
private String name;
|
||||
private JSONObject args;
|
||||
|
||||
public GaiaFront() {}
|
||||
|
||||
public GaiaFront(String name, JSONObject args) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HostAllowFront {
|
||||
|
||||
private List<JSONObject> workers;
|
||||
private String state;
|
||||
|
||||
public HostAllowFront(List<JSONObject> workers, String state) {
|
||||
this.workers = workers;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public HostAllowFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.megatron.common.enums.HttpRequestMethod;
|
||||
import com.megatron.common.enums.PostDataFormat;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class HttpFront {
|
||||
|
||||
private String url;
|
||||
private String body;
|
||||
private PostDataFormat format;
|
||||
private HttpRequestMethod method;
|
||||
private Map<String, Object> headers;
|
||||
private Map<String, Object> params;
|
||||
|
||||
public HttpFront(String url, String body, PostDataFormat format, HttpRequestMethod method,
|
||||
Map<String, Object> headers, Map<String, Object> params) {
|
||||
this.url = url;
|
||||
this.body = body;
|
||||
this.format = format;
|
||||
this.method = method;
|
||||
this.headers = headers;
|
||||
this.params = params;
|
||||
}
|
||||
|
||||
public HttpFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SaltFront {
|
||||
|
||||
// 脚本数据库中的ID
|
||||
private Long scriptId;
|
||||
private String content;
|
||||
private String category;
|
||||
private String params;
|
||||
private String userNo;
|
||||
private String executeUser;
|
||||
private JSONObject saltAuth;
|
||||
private JSONObject ftpAuth;
|
||||
private String remotePath;
|
||||
private String localPath;
|
||||
|
||||
public SaltFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ScriptFront {
|
||||
|
||||
// 脚本执行参数
|
||||
private String params;
|
||||
//
|
||||
private String context;
|
||||
// 脚本信息
|
||||
private List<Map<String, Object>> scripts;
|
||||
|
||||
// -----------内置单脚本(临时使用,后面会优化调)------------
|
||||
// 脚本分组ID
|
||||
private List<Long> groupId;
|
||||
// 脚本数据库中的ID
|
||||
private Long scriptId;
|
||||
// 脚本内容
|
||||
private String content;
|
||||
// 脚本类别:shell|bat 等
|
||||
private String category;
|
||||
//
|
||||
private String code;
|
||||
// 脚本是否异步执行
|
||||
private Boolean async;
|
||||
/**
|
||||
* 脚本执行异步执行超时时间
|
||||
*/
|
||||
private Long asyncTimeout;
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class ScriptLocalFront {
|
||||
|
||||
// 脚本执行参数
|
||||
private String params;
|
||||
//
|
||||
private String context;
|
||||
// 脚本信息
|
||||
private List<Map<String, Object>> scripts;
|
||||
|
||||
// -----------内置单脚本(临时使用,后面会优化调)------------
|
||||
// 脚本分组ID
|
||||
private List<Long> groupId;
|
||||
// 脚本数据库中的ID
|
||||
private Long scriptId;
|
||||
// 脚本内容
|
||||
private String content;
|
||||
// 脚本类别:shell|bat 等
|
||||
private String category;
|
||||
//
|
||||
private String code;
|
||||
// 脚本是否异步执行
|
||||
private Boolean async;
|
||||
/**
|
||||
* 脚本执行异步执行超时时间
|
||||
*/
|
||||
private Long asyncTimeout;
|
||||
|
||||
}
|
|
@ -0,0 +1,20 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ScriptsFront {
|
||||
|
||||
private List<Map<String, Object>> scripts;
|
||||
private List<Object> params;
|
||||
|
||||
public ScriptsFront(List<Map<String, Object>> scripts) {
|
||||
this.scripts = scripts;
|
||||
}
|
||||
|
||||
public ScriptsFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ServiceFront {
|
||||
|
||||
private String name;
|
||||
private String state;
|
||||
private Boolean enabled;
|
||||
private String arguments;
|
||||
@JSONField(name = "start_mode")
|
||||
private String startMode;
|
||||
|
||||
public ServiceFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 模板参数
|
||||
*
|
||||
* @author weiwei
|
||||
*
|
||||
*/
|
||||
@Data
|
||||
public class TemplateFront {
|
||||
|
||||
private String name;
|
||||
private JSONObject args;
|
||||
|
||||
public TemplateFront() {}
|
||||
|
||||
public TemplateFront(String name, JSONObject args) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.args = args;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.bocloud.tse.core.domain.front.maintain;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class UserFront {
|
||||
|
||||
private String type;
|
||||
private Map<String, Object> sudo;
|
||||
private List<Map<String, Object>> users;
|
||||
|
||||
public UserFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActivemqFront {
|
||||
|
||||
private String version;
|
||||
// private List<Map<String, Object>> queue;
|
||||
// private List<Map<String, Object>> topic;
|
||||
// private List<Map<String, Object>> authentication;
|
||||
@JSONField(name = "activemq_admin_user")
|
||||
private List<Map<String, Object>> activemqAdminUser;
|
||||
|
||||
public ActivemqFront() {}
|
||||
|
||||
public ActivemqFront(String version, List<Map<String, Object>> activemqAdminUser) {
|
||||
this.version = version;
|
||||
this.activemqAdminUser = activemqAdminUser;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ApacheFront {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "apache_vhosts")
|
||||
private List<Map<String, Object>> apacheVhosts;
|
||||
|
||||
public ApacheFront() {}
|
||||
|
||||
public ApacheFront(Map<String, Object> softwareConfig, List<Map<String, Object>> apacheVhosts) {
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.apacheVhosts = apacheVhosts;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ElasticsearchFront {
|
||||
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "cluster_type")
|
||||
private String clusterType;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "cluster_name")
|
||||
private String clusterName;
|
||||
|
||||
public ElasticsearchFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class EtcdFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "etcd_secure")
|
||||
private boolean etcdSecure;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "etcd_initial_cluster_token")
|
||||
private String etcdInitialClusterToken;
|
||||
|
||||
public EtcdFront() {}
|
||||
|
||||
public EtcdFront(Map<String, Object> softwareConfig) {
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
|
||||
public EtcdFront(boolean clusterInstall, boolean etcdSecure, Map<String, Object> softwareConfig,
|
||||
String etcdInitialClusterToken) {
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.etcdSecure = etcdSecure;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.etcdInitialClusterToken = etcdInitialClusterToken;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,13 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ExporterFront {
|
||||
|
||||
private String version;
|
||||
private String path;
|
||||
|
||||
public ExporterFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GitlabFront {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "gitlab_root_password")
|
||||
private String gitlabRootPassword;
|
||||
|
||||
public GitlabFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class JdkFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "install_jce")
|
||||
private Boolean installJce;
|
||||
@JSONField(name = "set_java_home")
|
||||
private Boolean setJavaHome;
|
||||
|
||||
public JdkFront(String version, Boolean installJce, Boolean setJavaHome) {
|
||||
this.version = version;
|
||||
this.installJce = installJce;
|
||||
this.setJavaHome = setJavaHome;
|
||||
}
|
||||
|
||||
public JdkFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class JenkinsFront {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "jenkins_admin_username")
|
||||
private String jenkinsAdminUsername;
|
||||
@JSONField(name = "jenkins_admin_password")
|
||||
private String jenkinsAdminPassword;
|
||||
|
||||
public JenkinsFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class K8sFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "container_config")
|
||||
private Map<String, Object> containerConfig;
|
||||
@JSONField(name = "k8s_config")
|
||||
private Map<String, Object> k8sConfig;
|
||||
@JSONField(name = "network_config")
|
||||
private Map<String, Object> networkConfig;
|
||||
@JSONField(name = "storage_config")
|
||||
private Map<String, Object> storageConfig;
|
||||
@JSONField(name = "harbor_config")
|
||||
private Map<String, Object> harborConfig;
|
||||
private List<Group> groups;
|
||||
|
||||
public K8sFront() {}
|
||||
|
||||
public void setHarborConfig(Map<String, Object> harborConfig) {
|
||||
if (null == harborConfig || harborConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.harborConfig = harborConfig;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,90 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class KafkaFront {
|
||||
|
||||
private String version;
|
||||
private List<Group> groups;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "zookeeper")
|
||||
private KafkaZkFront zookeeper;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "jmx_exporter_config")
|
||||
private Map<String, Object> jmxExporterConfig;
|
||||
@JSONField(name = "install_jmx_exporter")
|
||||
private boolean installJmxExporter;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "install_kafka_exporter")
|
||||
private boolean installKafkaExporter;
|
||||
@JSONField(name = "auth_config")
|
||||
private Map<String, Object> authConfig;
|
||||
@JSONField(name = "kafka_server")
|
||||
private Map<String, Object> kafkaServer;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
|
||||
public KafkaFront(String version, List<Group> groups, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
KafkaZkFront zookeeper, Map<String, Object> manageConfig, Map<String, Object> jmxExporterConfig,
|
||||
boolean installJmxExporter, List<Map<String, Object>> mntDisks, boolean installKafkaExporter,
|
||||
Map<String, Object> authConfig, Map<String, Object> kafkaServer, boolean installTelegraf) {
|
||||
this.version = version;
|
||||
this.groups = groups;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.zookeeper = zookeeper;
|
||||
this.manageConfig = manageConfig;
|
||||
this.jmxExporterConfig = jmxExporterConfig;
|
||||
this.installJmxExporter = installJmxExporter;
|
||||
this.mntDisks = mntDisks;
|
||||
this.installKafkaExporter = installKafkaExporter;
|
||||
this.authConfig = authConfig;
|
||||
this.kafkaServer = kafkaServer;
|
||||
this.installTelegraf = installTelegraf;
|
||||
}
|
||||
|
||||
public KafkaFront() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void setJmxExporterConfig(Map<String, Object> jmxExporterConfig) {
|
||||
if (null == jmxExporterConfig || jmxExporterConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.jmxExporterConfig = jmxExporterConfig;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
public void setAuthConfig(Map<String, Object> authConfig) {
|
||||
if (null == authConfig || authConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.authConfig = authConfig;
|
||||
}
|
||||
|
||||
public void setKafkaServer(Map<String, Object> kafkaServer) {
|
||||
if (null == kafkaServer || kafkaServer.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.kafkaServer = kafkaServer;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,27 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class KafkaZkFront extends ZookeeperFront {
|
||||
|
||||
private List<String> hosts;
|
||||
|
||||
public KafkaZkFront(List<String> hosts) {
|
||||
this.hosts = hosts;
|
||||
}
|
||||
|
||||
public KafkaZkFront(String version, List<Group> groups, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
List<String> hosts) {
|
||||
super(version, groups, clusterInstall, softwareConfig);
|
||||
this.hosts = hosts;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,44 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MemcacheFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "magent_config")
|
||||
private Map<String, Object> magentConfig;
|
||||
private List<Group> groups;
|
||||
|
||||
public MemcacheFront(String version, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
Map<String, Object> magentConfig, List<Group> groups) {
|
||||
super();
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.magentConfig = magentConfig;
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
public MemcacheFront() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void setMagentConfig(Map<String, Object> magentConfig) {
|
||||
if (null == magentConfig || magentConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.magentConfig = magentConfig;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,65 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MongodbFront {
|
||||
|
||||
private String version;
|
||||
private List<Group> groups;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "mongodb_users")
|
||||
private List<Map<String, Object>> mongodbUsers;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
|
||||
public MongodbFront(String version, List<Group> groups, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
Map<String, Object> manageConfig, List<Map<String, Object>> mongodbUsers, List<Map<String, Object>> mntDisks,
|
||||
boolean installTelegraf) {
|
||||
this.version = version;
|
||||
this.groups = groups;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.manageConfig = manageConfig;
|
||||
this.mongodbUsers = mongodbUsers;
|
||||
this.mntDisks = mntDisks;
|
||||
this.installTelegraf = installTelegraf;
|
||||
}
|
||||
|
||||
public MongodbFront() {}
|
||||
|
||||
public void setManageConfig(Map<String, Object> manageConfig) {
|
||||
if (null == manageConfig || manageConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.manageConfig = manageConfig;
|
||||
}
|
||||
|
||||
public void setMongodbUsers(List<Map<String, Object>> mongodbUsers) {
|
||||
if (null == mongodbUsers || mongodbUsers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mongodbUsers = mongodbUsers;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MysqlFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "cluster_vip")
|
||||
private String clusterVip;
|
||||
@JSONField(name = "mysql_vip_netmask")
|
||||
private String mysqlVipNetmask;
|
||||
@JSONField(name = "mysql_replication_master")
|
||||
private String mysqlReplicationMaster;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "mysql_databases")
|
||||
private List<Map<String, Object>> mysqlDatabases;
|
||||
@JSONField(name = "mysql_users")
|
||||
private List<Map<String, Object>> mysqlUsers;
|
||||
@JSONField(name = "mysql_replication_user")
|
||||
private Map<String, Object> mysqlReplicationUser;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
private List<Group> groups;
|
||||
/**
|
||||
* mha,mgr,msv主从,msb主备
|
||||
*/
|
||||
@JSONField(name = "cluster_type")
|
||||
private String clusterType;
|
||||
@JSONField(name = "keepalived_virtual_router_id")
|
||||
private Integer keepalivedVirtualRouterId;
|
||||
|
||||
public MysqlFront() {}
|
||||
|
||||
public void setMysqlDatabases(List<Map<String, Object>> mysqlDatabases) {
|
||||
if (null == mysqlDatabases || mysqlDatabases.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mysqlDatabases = mysqlDatabases;
|
||||
}
|
||||
|
||||
public void setMysqlUsers(List<Map<String, Object>> mysqlUsers) {
|
||||
if (null == mysqlUsers || mysqlUsers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mysqlUsers = mysqlUsers;
|
||||
}
|
||||
|
||||
public void setMysqlReplicationUser(Map<String, Object> mysqlReplicationUser) {
|
||||
if (null == mysqlReplicationUser || mysqlReplicationUser.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mysqlReplicationUser = mysqlReplicationUser;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,29 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NfsFront {
|
||||
|
||||
private List<Group> groups;
|
||||
@JSONField(name = "nfs_server")
|
||||
private Map<String, Object> nfsServer;
|
||||
@JSONField(name = "nfs_client")
|
||||
private boolean nfsClient;
|
||||
@JSONField(name = "mount_pointers")
|
||||
private List<Map<String, Object>> mountPointers;
|
||||
|
||||
public NfsFront(Map<String, Object> nfsServer, boolean nfsClient) {
|
||||
this.nfsServer = nfsServer;
|
||||
this.nfsClient = nfsClient;
|
||||
}
|
||||
|
||||
public NfsFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,40 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.common.NginxConfig;
|
||||
import com.bocloud.tse.core.domain.common.NginxHttpParam;
|
||||
import com.bocloud.tse.core.domain.common.NginxSite;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class NginxFront {
|
||||
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall = false;
|
||||
@JSONField(name = "nginx_http_params")
|
||||
private NginxHttpParam nginxHttpParam;
|
||||
@JSONField(name = "nginx_configs")
|
||||
private NginxConfig nginxConfig;
|
||||
@JSONField(name = "nginx_sites")
|
||||
private Map<String, NginxSite> nginxSites;
|
||||
|
||||
public NginxFront() {}
|
||||
|
||||
public void setNginxConfig(NginxConfig nginxConfig) {
|
||||
if (null != nginxConfig && nginxConfig.empty()) {
|
||||
return;
|
||||
}
|
||||
this.nginxConfig = nginxConfig;
|
||||
}
|
||||
|
||||
public void setNginxSites(Map<String, NginxSite> nginxSites) {
|
||||
if (null != nginxSites && nginxSites.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.nginxSites = nginxSites;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class OracleFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
private List<Group> groups;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "oracle_databases")
|
||||
private List<Map<String, Object>> oracleDatabases;
|
||||
@JSONField(name = "asm_diskgroups")
|
||||
private Map<String, List<Map<String, Object>>> asmDiskGroups;
|
||||
@JSONField(name = "host_fs_layout")
|
||||
private List<Map<String, Object>> hostFsLayout;
|
||||
|
||||
public OracleFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,17 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PhpFront {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
|
||||
public PhpFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,117 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PostgresqlFront {
|
||||
|
||||
private String version;
|
||||
private List<Group> groups;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "postgresql_databases")
|
||||
private List<Map<String, Object>> postgresqlDatabases;
|
||||
@JSONField(name = "postgresql_users")
|
||||
private List<Map<String, Object>> postgresqlUsers;
|
||||
@JSONField(name = "postgresql_privileges")
|
||||
private List<Map<String, Object>> postgresqlPrivileges;
|
||||
@JSONField(name = "postgresql_schemas")
|
||||
private List<Map<String, Object>> postgresqlSchemas;
|
||||
@JSONField(name = "postgresql_extensions")
|
||||
private List<Map<String, Object>> postgresqlExtensions;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "etcd_config")
|
||||
private Map<String, Object> etcdConfig;
|
||||
@JSONField(name = "cluster_config")
|
||||
private Map<String, Object> clusterConfig;
|
||||
|
||||
public PostgresqlFront(String version, List<Group> groups, boolean clusterInstall,
|
||||
Map<String, Object> softwareConfig, List<Map<String, Object>> postgresqlDatabases,
|
||||
List<Map<String, Object>> postgresqlUsers, List<Map<String, Object>> postgresqlPrivileges,
|
||||
List<Map<String, Object>> postgresqlSchemas, List<Map<String, Object>> postgresqlExtensions,
|
||||
List<Map<String, Object>> mntDisks, Map<String, Object> etcdConfig, Map<String, Object> clusterConfig) {
|
||||
super();
|
||||
this.version = version;
|
||||
this.groups = groups;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.postgresqlDatabases = postgresqlDatabases;
|
||||
this.postgresqlUsers = postgresqlUsers;
|
||||
this.postgresqlPrivileges = postgresqlPrivileges;
|
||||
this.postgresqlSchemas = postgresqlSchemas;
|
||||
this.postgresqlExtensions = postgresqlExtensions;
|
||||
this.mntDisks = mntDisks;
|
||||
this.etcdConfig = etcdConfig;
|
||||
this.clusterConfig = clusterConfig;
|
||||
}
|
||||
|
||||
public PostgresqlFront() {
|
||||
super();
|
||||
}
|
||||
|
||||
public void setPostgresqlDatabases(List<Map<String, Object>> postgresqlDatabases) {
|
||||
if (null == postgresqlDatabases || postgresqlDatabases.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlDatabases = postgresqlDatabases;
|
||||
}
|
||||
|
||||
public void setPostgresqlUsers(List<Map<String, Object>> postgresqlUsers) {
|
||||
if (null == postgresqlUsers || postgresqlUsers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlUsers = postgresqlUsers;
|
||||
}
|
||||
|
||||
public void setPostgresqlPrivileges(List<Map<String, Object>> postgresqlPrivileges) {
|
||||
if (null == postgresqlPrivileges || postgresqlPrivileges.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlPrivileges = postgresqlPrivileges;
|
||||
}
|
||||
|
||||
public void setPostgresqlSchemas(List<Map<String, Object>> postgresqlSchemas) {
|
||||
if (null == postgresqlSchemas || postgresqlSchemas.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlSchemas = postgresqlSchemas;
|
||||
}
|
||||
|
||||
public void setPostgresqlExtensions(List<Map<String, Object>> postgresqlExtensions) {
|
||||
if (null == postgresqlExtensions || postgresqlExtensions.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.postgresqlExtensions = postgresqlExtensions;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
public void setEtcdConfig(Map<String, Object> etcdConfig) {
|
||||
if (null == etcdConfig || etcdConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.etcdConfig = etcdConfig;
|
||||
}
|
||||
|
||||
public void setClusterConfig(Map<String, Object> clusterConfig) {
|
||||
if (null == clusterConfig || clusterConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.clusterConfig = clusterConfig;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,72 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RabbitmqFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "rabbitmq_users")
|
||||
private List<Map<String, Object>> rabbitmqUsers;
|
||||
@JSONField(name = "rabbitmq_vhosts")
|
||||
private List<Map<String, Object>> rabbitmqVhosts;
|
||||
@JSONField(name = "rabbitmq_plugins")
|
||||
private List<Map<String, Object>> rabbitmqPlugins;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "rabbitmq_admin_user")
|
||||
private String rabbitmqAdminUser;
|
||||
@JSONField(name = "rabbitmq_admin_password")
|
||||
private String rabbitmqAdminPassword;
|
||||
|
||||
public RabbitmqFront(String version, boolean clusterInstall, List<Map<String, Object>> rabbitmqUsers,
|
||||
List<Map<String, Object>> rabbitmqVhosts, List<Map<String, Object>> rabbitmqPlugins,
|
||||
List<Map<String, Object>> mntDisks, String rabbitmqAdminUser, String rabbitmqAdminPassword) {
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.rabbitmqUsers = rabbitmqUsers;
|
||||
this.rabbitmqVhosts = rabbitmqVhosts;
|
||||
this.rabbitmqPlugins = rabbitmqPlugins;
|
||||
this.mntDisks = mntDisks;
|
||||
this.rabbitmqAdminUser = rabbitmqAdminUser;
|
||||
this.rabbitmqAdminPassword = rabbitmqAdminPassword;
|
||||
}
|
||||
|
||||
public RabbitmqFront() {}
|
||||
|
||||
public void setRabbitmqUsers(List<Map<String, Object>> rabbitmqUsers) {
|
||||
if (null == rabbitmqUsers || rabbitmqUsers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.rabbitmqUsers = rabbitmqUsers;
|
||||
}
|
||||
|
||||
public void setRabbitmqVhosts(List<Map<String, Object>> rabbitmqVhosts) {
|
||||
if (null == rabbitmqVhosts || rabbitmqVhosts.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.rabbitmqVhosts = rabbitmqVhosts;
|
||||
}
|
||||
|
||||
public void setRabbitmqPlugins(List<Map<String, Object>> rabbitmqPlugins) {
|
||||
if (null == rabbitmqPlugins || rabbitmqPlugins.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.rabbitmqPlugins = rabbitmqPlugins;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RacIscsiFront {
|
||||
|
||||
private List<Group> groups;
|
||||
@JSONField(name = "iscsi_config")
|
||||
private Map<String, Object> iscsiConfig;
|
||||
|
||||
public RacIscsiFront(Map<String, Object> iscsiConfig) {
|
||||
this.iscsiConfig = iscsiConfig;
|
||||
}
|
||||
|
||||
public RacIscsiFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RedisFront {
|
||||
|
||||
private String version;
|
||||
private List<Group> groups;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "mnt_disks")
|
||||
private List<Map<String, Object>> mntDisks;
|
||||
@JSONField(name = "install_telegraf")
|
||||
private boolean installTelegraf;
|
||||
@JSONField(name = "redis_master_nodes")
|
||||
private List<String> redisMasterNodes;
|
||||
@JSONField(name = "redis_slave_nodes")
|
||||
private List<String> redisSlaveNodes;
|
||||
@JSONField(name = "cluster_type")
|
||||
private String clusterType;
|
||||
|
||||
public RedisFront(String version, List<Group> groups, boolean clusterInstall, Map<String, Object> softwareConfig,
|
||||
Map<String, Object> manageConfig, List<Map<String, Object>> mntDisks, boolean installTelegraf,
|
||||
List<String> redisMasterNodes, List<String> redisSlaveNodes) {
|
||||
this.version = version;
|
||||
this.groups = groups;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.manageConfig = manageConfig;
|
||||
this.mntDisks = mntDisks;
|
||||
this.installTelegraf = installTelegraf;
|
||||
this.redisMasterNodes = redisMasterNodes;
|
||||
this.redisSlaveNodes = redisSlaveNodes;
|
||||
}
|
||||
|
||||
public RedisFront() {}
|
||||
|
||||
public void setManageConfig(Map<String, Object> manageConfig) {
|
||||
if (null == manageConfig || manageConfig.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.manageConfig = manageConfig;
|
||||
}
|
||||
|
||||
public void setMntDisks(List<Map<String, Object>> mntDisks) {
|
||||
if (null == mntDisks || mntDisks.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.mntDisks = mntDisks;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class RocketmqFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "cluster_name")
|
||||
private String clusterName;
|
||||
@JSONField(name = "rocketmq_nameserver_list")
|
||||
private String rocketmqNameserverList;
|
||||
@JSONField(name = "install_rocketmq_exporter")
|
||||
private boolean installRocketmqExporter;
|
||||
// @JSONField(name = "rocketmq_exporter_config")
|
||||
// private Map<String, Object> rocketmqExporterConfig;
|
||||
private List<Group> groups;
|
||||
|
||||
public RocketmqFront(String version, boolean clusterInstall, Map<String, Object> softwareConfig, String clusterName,
|
||||
String rocketmqNameserverList, boolean installRocketmqExporter, List<Group> groups) {
|
||||
super();
|
||||
this.version = version;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.clusterName = clusterName;
|
||||
this.rocketmqNameserverList = rocketmqNameserverList;
|
||||
this.installRocketmqExporter = installRocketmqExporter;
|
||||
this.groups = groups;
|
||||
}
|
||||
|
||||
public RocketmqFront() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SqlserverFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "win_disk")
|
||||
private Map<String, Object> winDisk;
|
||||
|
||||
public SqlserverFront(String version, Map<String, Object> softwareConfig, Map<String, Object> winDisk) {
|
||||
this.version = version;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.winDisk = winDisk;
|
||||
}
|
||||
|
||||
public SqlserverFront() {}
|
||||
|
||||
public void setWinDisk(Map<String, Object> winDisk) {
|
||||
if (null == winDisk || winDisk.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
this.winDisk = winDisk;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.common.TomcatInstance;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class TomcatFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "tomcat_instances")
|
||||
private List<TomcatInstance> tomcatInstances;
|
||||
|
||||
public TomcatFront() {}
|
||||
|
||||
public void setTomcatInstances(List<TomcatInstance> tomcatInstances) {
|
||||
if (null != tomcatInstances && !tomcatInstances.isEmpty()) {
|
||||
this.tomcatInstances = tomcatInstances;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,33 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WeblogicFront {
|
||||
|
||||
private String version;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "manage_config")
|
||||
private Map<String, Object> manageConfig;
|
||||
@JSONField(name = "jdk_version")
|
||||
private String jdkVersion;
|
||||
@JSONField(name = "os_user")
|
||||
private String osUser;
|
||||
|
||||
public WeblogicFront(String version, Map<String, Object> softwareConfig, Map<String, Object> manageConfig,
|
||||
String jdkVersion, String osUser) {
|
||||
this.version = version;
|
||||
this.softwareConfig = softwareConfig;
|
||||
this.manageConfig = manageConfig;
|
||||
this.jdkVersion = jdkVersion;
|
||||
this.osUser = osUser;
|
||||
}
|
||||
|
||||
public WeblogicFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WebsphereFront {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
|
||||
public WebsphereFront(Map<String, Object> softwareConfig) {
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
|
||||
public WebsphereFront() {
|
||||
super();
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,19 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class WebspheremqFront {
|
||||
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
@JSONField(name = "version")
|
||||
private String version;
|
||||
|
||||
public WebspheremqFront() {}
|
||||
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.bocloud.tse.core.domain.front.software;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.alibaba.fastjson.annotation.JSONField;
|
||||
import com.bocloud.tse.core.domain.group.Group;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ZookeeperFront {
|
||||
|
||||
private String version;
|
||||
private List<Group> groups;
|
||||
@JSONField(name = "cluster_install")
|
||||
private boolean clusterInstall;
|
||||
@JSONField(name = "software_config")
|
||||
private Map<String, Object> softwareConfig;
|
||||
|
||||
public ZookeeperFront() {}
|
||||
|
||||
public ZookeeperFront(String version, List<Group> groups, boolean clusterInstall,
|
||||
Map<String, Object> softwareConfig) {
|
||||
this.version = version;
|
||||
this.groups = groups;
|
||||
this.clusterInstall = clusterInstall;
|
||||
this.softwareConfig = softwareConfig;
|
||||
}
|
||||
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue