diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/ClusterConfigurationDTO.java b/dinky-admin/src/main/java/org/dinky/data/dto/ClusterConfigurationDTO.java index c380952db8b..1ce17a8b818 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/ClusterConfigurationDTO.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/ClusterConfigurationDTO.java @@ -29,6 +29,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import cn.hutool.core.bean.BeanUtil; +import cn.hutool.json.JSONUtil; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -88,7 +89,7 @@ public static ClusterConfigurationDTO fromBean(ClusterConfiguration bean) { public ClusterConfiguration toBean() { ClusterConfiguration clusterConfiguration = new ClusterConfiguration(); BeanUtil.copyProperties(this, clusterConfiguration); - clusterConfiguration.setConfigJson(this.getConfig()); + clusterConfiguration.setConfigJson(JSONUtil.toJsonStr(this.getConfig())); return clusterConfiguration; } } diff --git a/dinky-admin/src/main/java/org/dinky/data/dto/JobDataDto.java b/dinky-admin/src/main/java/org/dinky/data/dto/JobDataDto.java index 0368370afd9..ae6bf3647f6 100644 --- a/dinky-admin/src/main/java/org/dinky/data/dto/JobDataDto.java +++ b/dinky-admin/src/main/java/org/dinky/data/dto/JobDataDto.java @@ -73,7 +73,7 @@ public class JobDataDto { @ApiModelProperty(value = "Checkpoints Config Object", notes = "Object representing checkpoints configuration") private CheckpointConfigInfo checkpointsConfig; - @ApiModelProperty(value = "FlinkJobConfigInfo", notes = "FlinkJobConfigInfo representing job configuration") + @ApiModelProperty(value = "JobConfigInfo", notes = "JobConfigInfo representing job configuration") private JobConfigInfo config; @ApiModelProperty(value = "Jar Object", notes = "Object representing the JAR used in the job") diff --git a/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/AbstractAlertInstanceConfig.java b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/AbstractAlertInstanceConfig.java new file mode 100644 index 00000000000..660da0b8cb2 --- /dev/null +++ b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/AbstractAlertInstanceConfig.java @@ -0,0 +1,22 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.dinky.data.model.alert.instance.parser; + +public class AbstractAlertInstanceConfig {} diff --git a/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/DingTalkConfigParser.java b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/DingTalkConfigParser.java new file mode 100644 index 00000000000..bbedb3a22f7 --- /dev/null +++ b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/DingTalkConfigParser.java @@ -0,0 +1,128 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.dinky.data.model.alert.instance.parser.types; + +import org.dinky.data.model.alert.instance.parser.AbstractAlertInstanceConfig; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * the full config is: + *
+ * {"webhook":"https:///111","keyword":"111","secret":"1111","isEnableProxy":true,"isAtAll":false,"proxy":"1121","port":2121,"user":"2121","password":"2121","atMobiles":"2121"} + */ +@Data +@NoArgsConstructor +@ApiModel(value = "DingTalkConfigParser", description = "DingTalk Config Parser") +public class DingTalkConfigParser extends AbstractAlertInstanceConfig implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty( + value = "webhook url", + required = true, + dataType = "String", + example = "https://oapi.dingtalk.com/robot/send?access_token=xxx") + @JsonProperty("webhook") + private String webhook; + + @ApiModelProperty(value = "keyword", required = true, dataType = "String", example = "111") + @JsonProperty("keyword") + private String keyword; + + @ApiModelProperty(value = "secret", required = true, dataType = "String", example = "1111") + @JsonProperty("secret") + private String secret; + + @ApiModelProperty(value = "isEnableProxy", required = true, dataType = "Boolean", example = "true") + @JsonProperty("isEnableProxy") + private boolean isEnableProxy; + + @ApiModelProperty(value = "isAtAll", required = true, dataType = "Boolean", example = "false") + @JsonProperty("isAtAll") + private boolean isAtAll; + + @ApiModelProperty(value = "atMobiles", required = true, dataType = "String", example = "2121") + @JsonProperty("atMobiles") + private String atMobiles; + + @ApiModelProperty(value = "proxy ip / host", required = true, dataType = "String", example = "1121") + @JsonProperty("proxy") + private String proxy; + + @ApiModelProperty(value = "proxy port", required = true, dataType = "Integer", example = "2121") + @JsonProperty("port") + private int port; + + @ApiModelProperty(value = "proxy user", required = true, dataType = "String", example = "2121") + @JsonProperty("user") + private String user; + + @ApiModelProperty(value = "proxy password", required = true, dataType = "String", example = "2121") + @JsonProperty("password") + private String password; + + @JsonCreator + public DingTalkConfigParser( + @JsonProperty("webhook") String webhook, + @JsonProperty("keyword") String keyword, + @JsonProperty("secret") String secret, + @JsonProperty("isEnableProxy") boolean isEnableProxy, + @JsonProperty("isAtAll") boolean isAtAll, + @JsonProperty("atMobiles") String atMobiles, + @JsonProperty("proxy") String proxy, + @JsonProperty("port") int port, + @JsonProperty("user") String user, + @JsonProperty("password") String password) { + this.webhook = webhook; + this.keyword = keyword; + this.secret = secret; + this.isEnableProxy = isEnableProxy; + this.isAtAll = isAtAll; + this.atMobiles = atMobiles; + this.proxy = proxy; + this.port = port; + this.user = user; + this.password = password; + } + + @JsonCreator + public DingTalkConfigParser( + @JsonProperty("webhook") String webhook, + @JsonProperty("keyword") String keyword, + @JsonProperty("secret") String secret, + @JsonProperty("isEnableProxy") boolean isEnableProxy, + @JsonProperty("isAtAll") boolean isAtAll, + @JsonProperty("atMobiles") String atMobiles) { + this.webhook = webhook; + this.keyword = keyword; + this.secret = secret; + this.isEnableProxy = isEnableProxy; + this.isAtAll = isAtAll; + this.atMobiles = atMobiles; + } +} diff --git a/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/EmailConfigParser.java b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/EmailConfigParser.java new file mode 100644 index 00000000000..bfc407ab7dd --- /dev/null +++ b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/EmailConfigParser.java @@ -0,0 +1,106 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.dinky.data.model.alert.instance.parser.types; + +import org.dinky.data.model.alert.instance.parser.AbstractAlertInstanceConfig; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * the full config is: + *
+ * {"serverHost":"121","serverPort":1212,"sender":"212121","receivers":"2121","receiverCcs":"2121","enableSmtpAuth":true,"starttlsEnable":true,"sslEnable":true,"User":"212","Password":"121","smtpSslTrust":"2121"} + */ +@Data +@NoArgsConstructor +@ApiModel(value = "EmailConfigParser", description = "Email Config Parser") +public class EmailConfigParser extends AbstractAlertInstanceConfig implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "server Host", required = true, dataType = "String", example = "121") + private String serverHost; + + @ApiModelProperty(value = "server Port", required = true, dataType = "Integer", example = "1212") + private Integer serverPort; + + @ApiModelProperty(value = "sender", required = true, dataType = "String", example = "212121") + private String sender; + + @ApiModelProperty(value = "receivers", required = true, dataType = "String", example = "2121") + private String receivers; + + @ApiModelProperty(value = "receiver Ccs", required = true, dataType = "String", example = "2121") + private String receiverCcs; + + @ApiModelProperty(value = "enable Smtp Auth", required = true, dataType = "Boolean", example = "true") + private boolean enableSmtpAuth; + + @ApiModelProperty(value = "starttls Enable", required = true, dataType = "Boolean", example = "true") + private boolean starttlsEnable; + + @ApiModelProperty(value = "ssl Enable", required = true, dataType = "Boolean", example = "true") + private boolean sslEnable; + + @ApiModelProperty(value = "User", required = true, dataType = "String", example = "212") + @JsonProperty("User") + private String user; + + @ApiModelProperty(value = "Password", required = true, dataType = "String", example = "121") + @JsonProperty("Password") + private String password; + + @ApiModelProperty(value = "smtp Ssl Trust", required = true, dataType = "String", example = "2121") + @JsonProperty("smtpSslTrust") + private String smtpSslTrust; + + @JsonCreator + public EmailConfigParser( + @JsonProperty("serverHost") String serverHost, + @JsonProperty("serverPort") Integer serverPort, + @JsonProperty("sender") String sender, + @JsonProperty("receivers") String receivers, + @JsonProperty("receiverCcs") String receiverCcs, + @JsonProperty("enableSmtpAuth") boolean enableSmtpAuth, + @JsonProperty("starttlsEnable") boolean starttlsEnable, + @JsonProperty("sslEnable") boolean sslEnable, + @JsonProperty("User") String user, + @JsonProperty("Password") String password, + @JsonProperty("smtpSslTrust") String smtpSslTrust) { + this.serverHost = serverHost; + this.serverPort = serverPort; + this.sender = sender; + this.receivers = receivers; + this.receiverCcs = receiverCcs; + this.enableSmtpAuth = enableSmtpAuth; + this.starttlsEnable = starttlsEnable; + this.sslEnable = sslEnable; + this.user = user; + this.password = password; + this.smtpSslTrust = smtpSslTrust; + } +} diff --git a/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/FeiShuConfigParser.java b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/FeiShuConfigParser.java new file mode 100644 index 00000000000..0e51afc7710 --- /dev/null +++ b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/FeiShuConfigParser.java @@ -0,0 +1,128 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.dinky.data.model.alert.instance.parser.types; + +import org.dinky.data.model.alert.instance.parser.AbstractAlertInstanceConfig; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * the full config is: + *
+ * {"webhook":"12121","keyword":"212121","secret":"321312321","isEnableProxy":true,"isAtAll":false,"proxy":"31312","port":312321,"user":"321312","password":"3312321","users":"312321321"} + */ +@Data +@NoArgsConstructor +@ApiModel(value = "FeiShuConfigParser", description = " FeiShu Config Parser") +public class FeiShuConfigParser extends AbstractAlertInstanceConfig implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty( + value = "webhook url", + required = true, + dataType = "String", + example = "https://oapi.feushu.com/robot/send?access_token=xxx") + @JsonProperty("webhook") + private String webhook; + + @ApiModelProperty(value = "keyword", required = true, dataType = "String", example = "111") + @JsonProperty("keyword") + private String keyword; + + @ApiModelProperty(value = "secret", required = true, dataType = "String", example = "1111") + @JsonProperty("secret") + private String secret; + + @ApiModelProperty(value = "isEnableProxy", required = true, dataType = "Boolean", example = "true") + @JsonProperty("isEnableProxy") + private boolean isEnableProxy; + + @ApiModelProperty(value = "isAtAll", required = true, dataType = "Boolean", example = "false") + @JsonProperty("isAtAll") + private boolean isAtAll; + + @ApiModelProperty(value = "proxy ip / host", required = true, dataType = "String", example = "1121") + @JsonProperty("proxy") + private String proxy; + + @ApiModelProperty(value = "proxy port", required = true, dataType = "Integer", example = "2121") + @JsonProperty("port") + private int port; + + @ApiModelProperty(value = "proxy user", required = true, dataType = "String", example = "2121") + @JsonProperty("user") + private String user; + + @ApiModelProperty(value = "proxy password", required = true, dataType = "String", example = "2121") + @JsonProperty("password") + private String password; + + @ApiModelProperty(value = "users", required = true, dataType = "String", example = "2121") + @JsonProperty("users") + private String users; + + @JsonCreator + public FeiShuConfigParser( + @JsonProperty("webhook") String webhook, + @JsonProperty("keyword") String keyword, + @JsonProperty("secret") String secret, + @JsonProperty("isEnableProxy") boolean isEnableProxy, + @JsonProperty("isAtAll") boolean isAtAll, + @JsonProperty("proxy") String proxy, + @JsonProperty("port") int port, + @JsonProperty("user") String user, + @JsonProperty("password") String password, + @JsonProperty("users") String users) { + this.webhook = webhook; + this.keyword = keyword; + this.secret = secret; + this.isEnableProxy = isEnableProxy; + this.isAtAll = isAtAll; + this.proxy = proxy; + this.port = port; + this.user = user; + this.password = password; + this.users = users; + } + + @JsonCreator + public FeiShuConfigParser( + @JsonProperty("webhook") String webhook, + @JsonProperty("keyword") String keyword, + @JsonProperty("secret") String secret, + @JsonProperty("isEnableProxy") boolean isEnableProxy, + @JsonProperty("isAtAll") boolean isAtAll, + @JsonProperty("users") String users) { + this.webhook = webhook; + this.keyword = keyword; + this.secret = secret; + this.isEnableProxy = isEnableProxy; + this.isAtAll = isAtAll; + this.users = users; + } +} diff --git a/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/WeChatAppConfigParser.java b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/WeChatAppConfigParser.java new file mode 100644 index 00000000000..afc4e7aeaaa --- /dev/null +++ b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/WeChatAppConfigParser.java @@ -0,0 +1,78 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.dinky.data.model.alert.instance.parser.types; + +import org.dinky.data.model.alert.instance.parser.AbstractAlertInstanceConfig; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * the full config is: + *
+ * {"sendType":"app","corpId":"12121","secret":"2121","agentId":2121,"users":"212121"} + */ +@Data +@NoArgsConstructor +@ApiModel(value = "WeChatAppConfigParser", description = "WeChat App Config Parser") +public class WeChatAppConfigParser extends AbstractAlertInstanceConfig implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "send Type", required = true, dataType = "String", example = "app") + @JsonProperty("sendType") + private String sendType; + + @ApiModelProperty(value = "corpId", required = true, dataType = "String", example = "12121") + @JsonProperty("corpId") + private String corpId; + + @ApiModelProperty(value = "secret", required = true, dataType = "String", example = "2121") + @JsonProperty("secret") + private String secret; + + @ApiModelProperty(value = "agentId", required = true, dataType = "Integer", example = "2121") + @JsonProperty("agentId") + private Integer agentId; + + @ApiModelProperty(value = "users", required = true, dataType = "String", example = "212121") + @JsonProperty("users") + private String users; + + @JsonCreator + public WeChatAppConfigParser( + @JsonProperty("sendType") String sendType, + @JsonProperty("corpId") String corpId, + @JsonProperty("secret") String secret, + @JsonProperty("agentId") Integer agentId, + @JsonProperty("users") String users) { + this.sendType = sendType; + this.corpId = corpId; + this.secret = secret; + this.agentId = agentId; + this.users = users; + } +} diff --git a/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/WeChatChatConfigParser.java b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/WeChatChatConfigParser.java new file mode 100644 index 00000000000..b5ca75d247f --- /dev/null +++ b/dinky-admin/src/main/java/org/dinky/data/model/alert/instance/parser/types/WeChatChatConfigParser.java @@ -0,0 +1,78 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.dinky.data.model.alert.instance.parser.types; + +import org.dinky.data.model.alert.instance.parser.AbstractAlertInstanceConfig; + +import java.io.Serializable; + +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonProperty; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.NoArgsConstructor; + +/** + * the full config is: + *
+ * {"sendType":"wechat","isAtAll":false,"webhook":"212121","keyword":"212121","users":"21212" ,} + */ +@Data +@NoArgsConstructor +@ApiModel(value = "WeChatChatConfigParser", description = "WeChat Chat Config Parser") +public class WeChatChatConfigParser extends AbstractAlertInstanceConfig implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "send Type", required = true, dataType = "String", example = "wechat") + @JsonProperty("sendType") + private String sendType; + + @ApiModelProperty(value = "isAtAll", required = true, dataType = "Boolean", example = "false") + @JsonProperty("isAtAll") + private boolean isAtAll; + + @ApiModelProperty(value = "webhook", required = true, dataType = "String", example = "212121") + @JsonProperty("webhook") + private String webhook; + + @ApiModelProperty(value = "keyword", required = true, dataType = "String", example = "212121") + @JsonProperty("keyword") + private String keyword; + + @ApiModelProperty(value = "users", required = true, dataType = "String", example = "21212") + @JsonProperty("users") + private String users; + + @JsonCreator + public WeChatChatConfigParser( + @JsonProperty("sendType") String sendType, + @JsonProperty("isAtAll") boolean isAtAll, + @JsonProperty("webhook") String webhook, + @JsonProperty("keyword") String keyword, + @JsonProperty("users") String users) { + this.sendType = sendType; + this.isAtAll = isAtAll; + this.webhook = webhook; + this.keyword = keyword; + this.users = users; + } +} diff --git a/dinky-admin/src/main/java/org/dinky/data/model/ClusterConfiguration.java b/dinky-admin/src/main/java/org/dinky/data/model/cluster/ClusterConfiguration.java similarity index 93% rename from dinky-admin/src/main/java/org/dinky/data/model/ClusterConfiguration.java rename to dinky-admin/src/main/java/org/dinky/data/model/cluster/ClusterConfiguration.java index 5a110c9c770..382f607ba03 100644 --- a/dinky-admin/src/main/java/org/dinky/data/model/ClusterConfiguration.java +++ b/dinky-admin/src/main/java/org/dinky/data/model/cluster/ClusterConfiguration.java @@ -17,7 +17,7 @@ * */ -package org.dinky.data.model; +package org.dinky.data.model.cluster; import org.dinky.mybatis.model.SuperEntity; @@ -58,6 +58,8 @@ public class ClusterConfiguration extends SuperEntity { dataType = "String", example = "test", notes = "cluster config json") + // todo: handler + // @TableField(typeHandler = ClusterConfigTypeHandler.class, jdbcType = JdbcType.VARCHAR) private String configJson; @ApiModelProperty( diff --git a/dinky-admin/src/main/java/org/dinky/data/model/cluster/parser/ClusterConfigJsonParser.java b/dinky-admin/src/main/java/org/dinky/data/model/cluster/parser/ClusterConfigJsonParser.java new file mode 100644 index 00000000000..3a594889fc1 --- /dev/null +++ b/dinky-admin/src/main/java/org/dinky/data/model/cluster/parser/ClusterConfigJsonParser.java @@ -0,0 +1,56 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.dinky.data.model.cluster.parser; + +import org.dinky.data.model.cluster.parser.configs.ApplicationConfigParser; +import org.dinky.data.model.cluster.parser.configs.HighPriorityConfigParser; +import org.dinky.data.model.cluster.parser.configs.K8sConfigParser; +import org.dinky.data.model.cluster.parser.configs.YarnConfigParser; + +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "ClusterConfigJsonParser", description = "Cluster Config Json Parser of serialized data") +public class ClusterConfigJsonParser implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "Yarn config", dataType = "YarnConfigParser", notes = "Yarn config") + private YarnConfigParser yarnConfig; + + @ApiModelProperty(value = "K8s config", dataType = "K8sConfigParser", notes = "K8s config") + private K8sConfigParser k8sConfig; + + @ApiModelProperty( + value = "High priority config", + dataType = "HighPriorityConfigParser", + notes = "High priority config") + private HighPriorityConfigParser highPriorityConfig; + + @ApiModelProperty(value = "Application config", dataType = "ApplicationConfigParser", notes = "Application config") + private ApplicationConfigParser applicationConfig; +} diff --git a/dinky-admin/src/main/java/org/dinky/data/model/cluster/parser/configs/ApplicationConfigParser.java b/dinky-admin/src/main/java/org/dinky/data/model/cluster/parser/configs/ApplicationConfigParser.java new file mode 100644 index 00000000000..77f897ff390 --- /dev/null +++ b/dinky-admin/src/main/java/org/dinky/data/model/cluster/parser/configs/ApplicationConfigParser.java @@ -0,0 +1,43 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.dinky.data.model.cluster.parser.configs; + +import java.io.Serializable; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "ApplicationConfigParser", description = "Application Config Parser of serialized data") +public class ApplicationConfigParser implements Serializable { + private static final long serialVersionUID = 1L; + + @ApiModelProperty( + value = "user jar path", + dataType = "String", + example = "/opt/flink/examples/streaming/WordCount.jar", + notes = "user jar path") + private String userJarPath; +} diff --git a/dinky-admin/src/main/java/org/dinky/data/model/cluster/parser/configs/HighPriorityConfigParser.java b/dinky-admin/src/main/java/org/dinky/data/model/cluster/parser/configs/HighPriorityConfigParser.java new file mode 100644 index 00000000000..39ee6c1fbc8 --- /dev/null +++ b/dinky-admin/src/main/java/org/dinky/data/model/cluster/parser/configs/HighPriorityConfigParser.java @@ -0,0 +1,47 @@ +/* + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +package org.dinky.data.model.cluster.parser.configs; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +@ApiModel(value = "HighPriorityConfigParser", description = "High Priority Config Parser of serialized data") +public class HighPriorityConfigParser implements Serializable { + private static final long serialVersionUID = 1L; + + private List