diff options
author | 2018-09-12 17:53:17 +0530 | |
---|---|---|
committer | 2018-09-14 03:55:49 +0000 | |
commit | d959be5b9801e86f8c32311ba36622601a3bf7d2 (patch) | |
tree | b494450d447a4a8951f8cdc795a5b5c64cdf8e85 /rules/ccvpn-rule.drl | |
parent | 2ec931c5317ece0edeaa314145a71ddab8978d73 (diff) |
Fixed CCVPN closed loop integration issue
1.Service instance will be single instance not list of instances
Issue-ID: HOLMES-166
Change-Id: Ia69d5966ab759909d77c224bc5eff1edfa40cba9
Signed-off-by: Vidyashree Rama <vidyashree.rama@huawei.com>
Diffstat (limited to 'rules/ccvpn-rule.drl')
-rw-r--r-- | rules/ccvpn-rule.drl | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/rules/ccvpn-rule.drl b/rules/ccvpn-rule.drl index e006dbb..1f2d82d 100644 --- a/rules/ccvpn-rule.drl +++ b/rules/ccvpn-rule.drl @@ -75,28 +75,17 @@ function void updateAaiTpStatus(String networkId, String pnfName, String ifName, } function Map<String, Object> getAdditionalResourceInfo(String networkId, String pnfName, String ifName, String status) { - AaiQuery4Ccvpn aai = AaiQuery4Ccvpn.newInstance(); - JSONArray instances = aai.getServiceInstances(networkId, pnfName, ifName, status); - - Map<String, Object> ret = new HashMap<String, Object>(); - - StringBuilder sbn = new StringBuilder(); - StringBuilder sbi = new StringBuilder(); - for(int i = 0; i < instances.size(); ++i) { - JSONObject o = instances.getJSONObject(i); - String name = o.getString("service-instance-name"); - String id = o.getString("service-instance-id"); - ret.put(id + ".input-parameters", o.getString("input-parameters")); - sbn.append(name).append(","); - sbi.append(id).append(","); - } - ret.put("service-instance.service-instance-name", sbn.substring(0, sbn.length() -1).toString()); - ret.put("service-instance.service-instance-id", sbi.substring(0, sbi.length() -1).toString()); - ret.put("vserver.vserver-name", "TBD"); - ret.put("globalSubscriberId", instances.getJSONObject(0).getString("globalSubscriberId")); - ret.put("serviceType", instances.getJSONObject(0).getString("serviceType")); - - return ret; + AaiQuery4Ccvpn aai = AaiQuery4Ccvpn.newInstance(); + JSONObject instance = aai.getServiceInstance(networkId, pnfName, ifName, status); + + Map<String, Object> ret = new HashMap<String, Object>(); + ret.put("service-instance.service-instance-id", instance.getString("service-instance-id")); + ret.put("vserver.vserver-name", "TBD"); + ret.put("globalSubscriberId", instance.getString("globalSubscriberId")); + ret.put("serviceType", instance.getString("serviceType")); + ret.put("network-information.network-id", networkId); + + return ret; } function PolicyMsg createPolicyMsg(VesAlarm alarm) { @@ -181,4 +170,4 @@ rule "Clear Alarms" retract($a); } -end
\ No newline at end of file +end |