summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);
}