-
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.
【enhancement】add policy event, report to backend
- Loading branch information
Showing
6 changed files
with
164 additions
and
11 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
67 changes: 67 additions & 0 deletions
67
.../router-common/src/main/java/com/huaweicloud/sermant/router/common/event/PolicyEvent.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,67 @@ | ||
/* | ||
* 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.router.common.event; | ||
|
||
/** | ||
* Policy事件包含四件: | ||
* 1. 关闭policy规则 | ||
* 2.1 相同tag规则匹配生效: 全部可用实例数小于全部实例最小可用阈值,则同TAG优先 | ||
* 2.2 相同tag规则匹配生效: | ||
* 未设置全部实例最小可用阈值,超过同TAG比例阈值,则同TAG优先; | ||
* 设置了全部实例最小可用阈值,但其小于全部TAG可用实例,超过同TAG比例阈值,则同TAG优先 | ||
* 3. 相同tag规则匹配不生效 | ||
* | ||
* @author robotLJW | ||
* @since 2023-04-03 | ||
* | ||
*/ | ||
public enum PolicyEvent { | ||
|
||
/** | ||
* 关闭policy规则 | ||
*/ | ||
CLOSE("Close policy rule"), | ||
|
||
/** | ||
* 符合相同Tag规则匹配:全部可用实例数小于全部实例最小可用阈值,则同TAG优先 | ||
*/ | ||
SAME_TAG_MATCH_LESS_MIN_ALL_INSTANCES("Same tag rule match: less than the minimum available threshold for " | ||
+ "all instances"), | ||
|
||
/** | ||
* 符合相同Tag规则匹配:超过同TAG比例阈值,则同TAG优先 | ||
*/ | ||
SAME_TAG_MATCH_EXCEEDED_TRIGGER_THRESHOLD("Same tag rule match: exceeded trigger threshold"), | ||
|
||
/** | ||
* 相同Tag规则匹配没匹配上 | ||
*/ | ||
SAME_TAG_MISMATCH("Same tag rule mismatch"); | ||
|
||
/** | ||
* 事件描述 | ||
*/ | ||
private String desc; | ||
|
||
PolicyEvent(String desc) { | ||
this.desc = desc; | ||
} | ||
|
||
public String getDesc() { | ||
return this.desc; | ||
} | ||
} |
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
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
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
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