diff options
author | 2022-03-23 20:46:04 -0400 | |
---|---|---|
committer | 2022-04-15 23:21:29 -0400 | |
commit | ad5981f8e4969c41724885c830dda2cef304adf9 (patch) | |
tree | 486c291810101b2a325dab77c0c87b85a52e6f0c /components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/aai | |
parent | b5ffdfa0e652e7d7b6c320d28fc78eded8a0763a (diff) |
[SLICEANALYSIS] Bugfix1.1.1-slice-analysis-ms
- Add two attributes in policy payload: modelInvariantUuid and modelUuid
- Fix MrTopicParams builder bug
- Fix aai-subscriber server configuration and AAI-EVENT topic name
- Add safeguard for processing network-policy-list
- Fix AAI-EVENT entity format changes
- Add debug log lines
- Turn on scan in logback setting
Issue-ID: DCAEGEN2-3141
Signed-off-by: decheng zhang <decheng.zhang@huawei.com>
Change-Id: I0885035d85c55a6bff985b13f534c9db99e8fd09
Signed-off-by: decheng zhang <decheng.zhang@huawei.com>
Diffstat (limited to 'components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/aai')
-rw-r--r-- | components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/aai/AaiService.java | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/aai/AaiService.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/aai/AaiService.java index 289fedfd..ab67c031 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/aai/AaiService.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/aai/AaiService.java @@ -367,21 +367,24 @@ public class AaiService implements AaiInterface { try { ResponseEntity<String> resp = restclient.sendGetRequest(networkPolicyUrl, new ParameterizedTypeReference<String>() { }); + log.debug("AaiService received {} : {}", resp.getStatusCodeValue(), resp.getBody()); if (resp.getStatusCodeValue() == 200){ String networkPolicy = resp.getBody(); JSONObject networkPolicyJson = new JSONObject(networkPolicy); JSONArray networkPolicyList = networkPolicyJson.optJSONArray("network-policy"); - if (networkPolicyList != null){ + if (networkPolicyList != null && networkPolicyList.length() > 0){ JSONObject networkPolicyOjb = networkPolicyList.getJSONObject(0); result.put("maxBandwidth", networkPolicyOjb.getInt("max-bandwidth")); + log.info("Successfully retrieved max bandwidth for service {}: {}", + serviceId, result.get("maxBandwidth")); return result; } - log.info("Successfully fetched max bandwidth {}: {}", serviceId, result); } + log.warn("Failed to retrieve max bandwidth for service {}, no such network-policy or no valid max-bandwidth " + + "associated", serviceId); } catch (Exception e){ log.warn("Error encountered when fetching maxbandwidth: " + e); - } - return null; + return new HashMap<String, Integer>(); } } |