-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e999e47
commit 1d88fe3
Showing
8 changed files
with
367 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
sermant-backend/src/main/java/com/huaweicloud/sermant/backend/entity/ClusterEntity.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,32 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.backend.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* 集群实体 | ||
* | ||
* @author xuezechao | ||
* @since 2023-03-02 | ||
*/ | ||
@Getter | ||
@Setter | ||
public class ClusterEntity { | ||
String cluster; | ||
} |
32 changes: 32 additions & 0 deletions
32
sermant-backend/src/main/java/com/huaweicloud/sermant/backend/entity/EnvironmentEntity.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,32 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.backend.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* 环境实体 | ||
* | ||
* @author xuezechao | ||
* @since 2023-03-02 | ||
*/ | ||
@Getter | ||
@Setter | ||
public class EnvironmentEntity { | ||
String env; | ||
} |
60 changes: 60 additions & 0 deletions
60
sermant-backend/src/main/java/com/huaweicloud/sermant/backend/entity/EventInfoEntity.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,60 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.backend.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* 事件实体 | ||
* | ||
* @since 2023-03-02 | ||
* @author xuezechao | ||
*/ | ||
@Getter | ||
@Setter | ||
public class EventInfoEntity { | ||
/** | ||
* 实例元数据hash | ||
*/ | ||
private String meta; | ||
|
||
/** | ||
* 触发时间 | ||
*/ | ||
private long time; | ||
|
||
/** | ||
* 事件区域 | ||
*/ | ||
private String scope; | ||
|
||
/** | ||
* 事件等级 | ||
*/ | ||
private EventLevel level; | ||
|
||
/** | ||
* 事件类型 | ||
*/ | ||
private EventType type; | ||
|
||
/** | ||
* 事件信息 | ||
*/ | ||
private EventMessageEntity info; | ||
} |
51 changes: 51 additions & 0 deletions
51
sermant-backend/src/main/java/com/huaweicloud/sermant/backend/entity/EventLevel.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,51 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.backend.entity; | ||
|
||
/** | ||
* 事件等级 | ||
* | ||
* @author xuezechao | ||
* @since 2023-03-02 | ||
*/ | ||
public enum EventLevel { | ||
|
||
/** | ||
* 紧急 | ||
*/ | ||
EMERGENCY(300), | ||
|
||
/** | ||
* 重要 | ||
*/ | ||
IMPORTANT(200), | ||
|
||
/** | ||
* 一般 | ||
*/ | ||
NORMAL(100); | ||
|
||
private final int levelThreshold; | ||
|
||
EventLevel(int levelThreshold) { | ||
this.levelThreshold = levelThreshold; | ||
} | ||
|
||
public int getLevelThreshold() { | ||
return levelThreshold; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
sermant-backend/src/main/java/com/huaweicloud/sermant/backend/entity/EventMessageEntity.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,33 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.backend.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* 事件信息 | ||
* | ||
* @author xuezechao | ||
* @since 2023-03-02 | ||
*/ | ||
@Getter | ||
@Setter | ||
public class EventMessageEntity { | ||
private String name; | ||
private String description; | ||
} |
57 changes: 57 additions & 0 deletions
57
sermant-backend/src/main/java/com/huaweicloud/sermant/backend/entity/EventType.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,57 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.backend.entity; | ||
|
||
/** | ||
* 事件类型 | ||
* | ||
* @author xuezechao | ||
* @since 2023-03-02 | ||
*/ | ||
public enum EventType { | ||
/** | ||
* 运行事件 | ||
*/ | ||
OPERATION(0, "operation"), | ||
|
||
/** | ||
* 治理事件 | ||
*/ | ||
GOVERNANCE(1, "governance"), | ||
|
||
/** | ||
* 日志事件 | ||
*/ | ||
LOG(2, "log"); | ||
|
||
private final int type; | ||
|
||
private final String description; | ||
|
||
EventType(int type, String description) { | ||
this.type = type; | ||
this.description = description; | ||
} | ||
|
||
public int getType() { | ||
return type; | ||
} | ||
|
||
public String getDescription() { | ||
return description; | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
sermant-backend/src/main/java/com/huaweicloud/sermant/backend/entity/InstanceMeta.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,66 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.backend.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* 事件元数据 | ||
* | ||
* @author xuezechao | ||
* @since 2023-03-02 | ||
*/ | ||
@Getter | ||
@Setter | ||
public class InstanceMeta { | ||
|
||
/** | ||
* 实例原数据哈希 | ||
*/ | ||
private String metaHash; | ||
|
||
/** | ||
* 实例ID | ||
*/ | ||
private String instanceId; | ||
|
||
/** | ||
* 应用 | ||
*/ | ||
private String application; | ||
|
||
/** | ||
* 节点 | ||
*/ | ||
private NodeEntity node; | ||
|
||
/** | ||
* 集群 | ||
*/ | ||
private ClusterEntity cluster; | ||
|
||
/** | ||
* 环境 | ||
*/ | ||
private EnvironmentEntity environment; | ||
|
||
/** | ||
* 可用区 | ||
*/ | ||
private String az; | ||
} |
36 changes: 36 additions & 0 deletions
36
sermant-backend/src/main/java/com/huaweicloud/sermant/backend/entity/NodeEntity.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 @@ | ||
/* | ||
* Copyright (C) 2023-2023 Huawei Technologies Co., Ltd. All rights reserved. | ||
* | ||
* Licensed 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 com.huaweicloud.sermant.backend.entity; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
|
||
/** | ||
* 实例节点数据 | ||
* | ||
* @author xuezechao | ||
* @since 2023-03-02 | ||
*/ | ||
@Getter | ||
@Setter | ||
public class NodeEntity { | ||
|
||
/** | ||
* 实例ip | ||
*/ | ||
private String ip; | ||
} |