diff options
author | 2017-09-28 15:03:35 +0800 | |
---|---|---|
committer | 2017-09-28 16:18:44 +0800 | |
commit | 19fb19986d56a5206efabcf20580008219c6bbbf (patch) | |
tree | df53bd3c0f961c339675a579f1d907bb0dbc7a1d /holmes-actions/src/main | |
parent | 43e1dfbcdb2a84d5e69a8b038f76fa626718e5d7 (diff) |
modify push policy message
Issue-ID: HOLMES-44
Change-Id: I2e3f58ad763cd643d4d1f6d36c6ea3aa2456a37f
Signed-off-by: Shiwei Tian <tian.shiwei@zte.com.cn>
Diffstat (limited to 'holmes-actions/src/main')
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); } |