-
Notifications
You must be signed in to change notification settings - Fork 994
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[alerter] optimize the encoding of how to add Extern Alarm Manage API(#…
- Loading branch information
Showing
7 changed files
with
244 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
alerter/src/main/java/org/dromara/hertzbeat/alert/dto/CloudAlertReportAbstract.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
package org.dromara.hertzbeat.alert.dto; | ||
|
||
import com.fasterxml.jackson.annotation.JsonIgnore; | ||
|
||
import java.util.Map; | ||
|
||
/** | ||
* 云服务告警信息的抽象父类 | ||
* {@link org.dromara.hertzbeat.common.entity.dto.AlertReport} - 方法与该类参数一一对应,方法含义详情请看该类 | ||
*/ | ||
public abstract class CloudAlertReportAbstract { | ||
|
||
/** | ||
* 云告警转为内部告警时的告警名称 | ||
*/ | ||
@JsonIgnore | ||
public abstract String getAlertName() throws Exception; | ||
|
||
/** | ||
* 云告警转为内部告警时的告警间隔 | ||
*/ | ||
@JsonIgnore | ||
public abstract Integer getAlertDuration() throws Exception; | ||
|
||
/** | ||
* 云告警转为内部告警时的告警时间 | ||
*/ | ||
@JsonIgnore | ||
public abstract long getAlertTime() throws Exception; | ||
|
||
/** | ||
* 云告警转为内部告警时的告警严重程度 | ||
*/ | ||
@JsonIgnore | ||
public abstract Integer getPriority() throws Exception; | ||
|
||
/** | ||
* 云告警转为内部告警时的告警类型 | ||
*/ | ||
@JsonIgnore | ||
public abstract Integer getReportType() throws Exception; | ||
|
||
/** | ||
* 云告警转为内部告警时的告警标签信息 | ||
*/ | ||
@JsonIgnore | ||
public abstract Map<String, String> getLabels() throws Exception; | ||
|
||
/** | ||
* 云告警转为内部告警时的告警标注 | ||
*/ | ||
@JsonIgnore | ||
public abstract Map<String, String> getAnnotations() throws Exception; | ||
|
||
/** | ||
* 云告警转为内部告警时的告警内容 | ||
*/ | ||
@JsonIgnore | ||
public abstract String getContent() throws Exception; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...ter/src/main/java/org/dromara/hertzbeat/alert/enums/CloudServiceAlarmInformationEnum.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package org.dromara.hertzbeat.alert.enums; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.dromara.hertzbeat.alert.dto.CloudAlertReportAbstract; | ||
import org.dromara.hertzbeat.alert.dto.TenCloudAlertReport; | ||
|
||
import java.util.Arrays; | ||
|
||
/** | ||
* 云服务告警枚举 | ||
*/ | ||
@AllArgsConstructor | ||
@Getter | ||
public enum CloudServiceAlarmInformationEnum { | ||
|
||
TencentCloud("tencloud", TenCloudAlertReport.class); | ||
|
||
/** | ||
* 云服务名称 | ||
*/ | ||
private final String cloudServiceName; | ||
|
||
/** | ||
* 云服务对应的请求实体 | ||
*/ | ||
private final Class<? extends CloudAlertReportAbstract> cloudServiceAlarmInformationEntity; | ||
|
||
public static CloudServiceAlarmInformationEnum getEnumFromCloudServiceName(String name) { | ||
return Arrays.stream(CloudServiceAlarmInformationEnum.values()) | ||
.filter(cloudService -> cloudService.cloudServiceName.equals(name)) | ||
.findFirst() | ||
.orElse(null); | ||
} | ||
|
||
} |
16 changes: 0 additions & 16 deletions
16
alerter/src/main/java/org/dromara/hertzbeat/alert/service/AlertConvertService.java
This file was deleted.
Oops, something went wrong.
64 changes: 0 additions & 64 deletions
64
...c/main/java/org/dromara/hertzbeat/alert/service/impl/AlertConvertTenCloudServiceImpl.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.