summaryrefslogtreecommitdiffstats
path: root/holmes-actions/src/main
diff options
context:
space:
mode:
authortang peng <tang.peng5@zte.com.cn>2017-09-28 08:34:33 +0000
committerGerrit Code Review <gerrit@onap.org>2017-09-28 08:34:33 +0000
commitff81839411f5dc266c39300d4fe38044e8805cff (patch)
tree7ec51039f115b07129f94d8655f851be0cf85365 /holmes-actions/src/main
parenta5dcabe2ed88747b71997164e201eed865cbc92e (diff)
parent19fb19986d56a5206efabcf20580008219c6bbbf (diff)
Merge "modify push policy message"
Diffstat (limited to 'holmes-actions/src/main')
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/api/stat/VesAlarm.java4
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java6
-rw-r--r--holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java1
3 files changed, 9 insertions, 2 deletions
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/api/stat/VesAlarm.java b/holmes-actions/src/main/java/org/onap/holmes/common/api/stat/VesAlarm.java
index 918ed6c..56a7a11 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/api/stat/VesAlarm.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/api/stat/VesAlarm.java
@@ -52,6 +52,8 @@ public class VesAlarm implements Cloneable, Serializable{
private String specificProblem;
private String vfStatus;
private String parentId;
+ private int alarmIsCleared; //mark as 1 when alarm type is cleared, else mark as 2
+ private int rootFlag; // mark as 1 when alarm is a root alarm , else mark as 2
@Override
public int hashCode() {
@@ -106,6 +108,8 @@ public class VesAlarm implements Cloneable, Serializable{
vesAlarm.setFaultFieldsVersion(this.getFaultFieldsVersion());
vesAlarm.setSpecificProblem(this.getSpecificProblem());
vesAlarm.setVfStatus(this.vfStatus);
+ vesAlarm.setAlarmIsCleared(this.alarmIsCleared);
+ vesAlarm.setRootFlag(this.rootFlag);
return vesAlarm;
}
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
index 79c861b..2b03a8a 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/dmaap/DmaapService.java
@@ -105,7 +105,11 @@ public class DmaapService {
"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=SampleClosedLoop");
policyMsg.setTargetType("VM");
policyMsg.setClosedLoopAlarmStart(1484855);
- policyMsg.setClosedLoopEventStatus(EVENT_STATUS.ONSET);
+ if (vesAlarm.getAlarmIsCleared() == 1) {
+ policyMsg.setClosedLoopEventStatus(EVENT_STATUS.ABATED);
+ } else {
+ policyMsg.setClosedLoopEventStatus(EVENT_STATUS.ONSET);
+ }
policyMsg.setClosedLoopControlName(
"CL-LB-LOW-TRAFFIC-SIG-d925ed73-8231-4d02-9545-db4e101f88f8");
policyMsg.setVersion("1.0.2");
diff --git a/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java b/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java
index 441261f..510491e 100644
--- a/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java
+++ b/holmes-actions/src/main/java/org/onap/holmes/common/utils/HttpsUtils.java
@@ -88,7 +88,6 @@ public class HttpsUtils {
} catch (Exception e) {
throw new CorrelationException("Failed to use post method query data from server");
}
-
return getResponseEntity(httpResponse);
}