From ad5981f8e4969c41724885c830dda2cef304adf9 Mon Sep 17 00:00:00 2001 From: decheng zhang Date: Wed, 23 Mar 2022 20:46:04 -0400 Subject: [SLICEANALYSIS] Bugfix - 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 Change-Id: I0885035d85c55a6bff985b13f534c9db99e8fd09 Signed-off-by: decheng zhang --- components/slice-analysis-ms/ChangeLog.md | 2 + .../docker/config/sliceanalysisms/config_all.json | 4 +- .../org/onap/slice/analysis/ms/aai/AaiService.java | 11 ++-- .../ms/dmaap/AaiEventNotificationCallback.java | 51 +++++++++++++++--- .../slice/analysis/ms/dmaap/MRTopicMonitor.java | 3 ++ .../slice/analysis/ms/dmaap/MRTopicParams.java | 7 +-- .../analysis/ms/dmaap/VesNotificationCallback.java | 2 + .../slice/analysis/ms/models/Configuration.java | 2 +- .../slice/analysis/ms/models/policy/Payload.java | 21 ++++++-- .../slice/analysis/ms/service/PolicyService.java | 4 +- .../ms/service/ccvpn/BandwidthEvaluator.java | 62 ++++++++++++++++++---- .../src/main/resources/logback.xml | 13 ++--- .../ms/service/ccvpn/BandwidthEvaluatorTest.java | 2 +- .../src/test/resources/aaiEventDmaapMsg.json | 60 ++++++++++++++------- .../src/test/resources/config_all.json | 4 +- .../src/test/resources/onsetMessage2.json | 2 + 16 files changed, 187 insertions(+), 63 deletions(-) (limited to 'components') diff --git a/components/slice-analysis-ms/ChangeLog.md b/components/slice-analysis-ms/ChangeLog.md index 15287441..d8ef6273 100644 --- a/components/slice-analysis-ms/ChangeLog.md +++ b/components/slice-analysis-ms/ChangeLog.md @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [1.1.1] - 2022/04/12 - [DCAEGEN2-3142](https://jira.onap.org/browse/DCAEGEN2-3142) - Filter data from AAI to avoid possible exceptions, remove null parameters in policy payload and add logs + - [DCAEGEN2-3141](https://jira.onap.org/browse/DCAEGEN2-3142) - Bugfix in DCAE-SliceAnalysisMs for IBN user-triggered CCVPN closed-loop + ## [1.1.0] - 2022/3/10 - [DCAEGEN2-3063](https://jira.onap.org/browse/DCAEGEN2-3063) - IBN user-triggered CLoud Leased Line update and CCVPN closed-loop diff --git a/components/slice-analysis-ms/src/main/docker/config/sliceanalysisms/config_all.json b/components/slice-analysis-ms/src/main/docker/config/sliceanalysisms/config_all.json index 2e094ee0..63a4a97a 100644 --- a/components/slice-analysis-ms/src/main/docker/config/sliceanalysisms/config_all.json +++ b/components/slice-analysis-ms/src/main/docker/config/sliceanalysisms/config_all.json @@ -51,13 +51,13 @@ "aaf_password": null, "api_key" : null, "api_secret" : null, - "servers" : ["message-router"], + "servers" : ["message-router:3904"], "consumer_group" : "dcae_ccvpn_cl", "consumer_instance" : "dcae_ccvpn_cl_aaievent", "fetch_timeout" : 15000, "fetch_limit" : 100, "dmaap_info":{ - "topic_url":"https://message-router:3905/events/AAI_EVENT", + "topic_url":"http://message-router:3904/events/AAI-EVENT", "client_role":"org.onap.dcae.aaiSub", "location":"onap", "client_id":"sdnr-sliceanalysis-1" 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 resp = restclient.sendGetRequest(networkPolicyUrl, new ParameterizedTypeReference() { }); + 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(); } } diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/AaiEventNotificationCallback.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/AaiEventNotificationCallback.java index dc2cd775..0259f130 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/AaiEventNotificationCallback.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/AaiEventNotificationCallback.java @@ -29,6 +29,8 @@ import org.onap.slice.analysis.ms.models.Configuration; import org.onap.slice.analysis.ms.service.ccvpn.BandwidthEvaluator; import org.onap.slice.analysis.ms.service.ccvpn.Event; import org.onap.slice.analysis.ms.service.ccvpn.SimpleEvent; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @@ -40,6 +42,7 @@ import javax.annotation.PostConstruct; @Component public class AaiEventNotificationCallback implements NotificationCallback { + private static Logger logger = LoggerFactory.getLogger(AaiEventNotificationCallback.class); private static final String EVENT_HEADER = "event-header"; private static final String ACTION = "action"; private static final String ENTITY_TYPE = "entity-type"; @@ -71,26 +74,60 @@ public class AaiEventNotificationCallback implements NotificationCallback { JsonElement jsonElement = parser.parse(msg); if (jsonElement.isJsonObject()){ //handle a single AAI_EVENT + logger.debug("Handle a single aai-event"); handleMsgJsonObject(jsonElement.getAsJsonObject()); } else if (jsonElement.isJsonArray()){ //handle a series of AAI_EVENT + logger.debug("Handle a series of aai-event"); JsonArray jsonArray = jsonElement.getAsJsonArray(); for (int i=0,e=jsonArray.size(); i(SimpleEvent.Type.ONDEMAND_CHECK, body); - bandwidthEvaluator.post(event); + if (!header.has(ACTION) || !header.get(ACTION).getAsString().equals(aaiNotifTargetAction)){ + return; + } + if (!header.has(ENTITY_TYPE) || !header.get(ENTITY_TYPE).getAsString().equals(aaiNotifTargetEntity)){ + return; + } + if (!header.has(SOURCE_NAME) || !header.get(SOURCE_NAME).getAsString().equals(aaiNotifTargetSource)){ + return; + } + JsonObject entity = jsonObject.get(ENTITY).getAsJsonObject(); + JsonObject body = getNestedJsonObject(entity, aaiNotifTargetEntity); + logger.debug("AAI-EVENT entity object {}", body); + if (body == null){ + return; + } + Event event = new SimpleEvent<>(SimpleEvent.Type.ONDEMAND_CHECK, body); + bandwidthEvaluator.post(event); + } + + private JsonObject getNestedJsonObject(JsonObject obj, String target){ + for (String k: obj.keySet()){ + if (k.equals(target)){ + //Found it; + return obj.getAsJsonArray(k).get(0).getAsJsonObject(); + } + if (obj.get(k).isJsonObject()) { + return getNestedJsonObject(obj.getAsJsonObject(k), target); + } else if (obj.get(k).isJsonArray()){ + JsonElement tmp = obj.getAsJsonArray(k).get(0); + if (tmp.isJsonObject()){ + return getNestedJsonObject(tmp.getAsJsonObject(), target); } } } + return null; } } diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicMonitor.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicMonitor.java index 0c1ac604..aa1bc964 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicMonitor.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicMonitor.java @@ -91,8 +91,11 @@ public class MRTopicMonitor implements Runnable { public void run(){ while (running){ try { + logger.debug("Topic: {} getting new msg...", name); Iterable dmaapMsgs = consumerWrapper.fetch(); for (String msg : dmaapMsgs){ + logger.debug("Received message: {}" + + "\r\n and processing start", msg); process(msg); } } catch (IOException | RuntimeException e){ diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicParams.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicParams.java index 66c27413..e5aaa1e3 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicParams.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicParams.java @@ -321,12 +321,7 @@ public class MRTopicParams { servers.add(jsonArray.get(i).getAsString()); } } - if (jsonObject.has("servers") && !jsonObject.get("servers").isJsonNull()) { - JsonArray jsonArray = jsonObject.get("servers").getAsJsonArray(); - for (int i=0, e=jsonArray.size(); i additionalProperties; private String serviceType; + private String modelInvariantUuid; + private String modelUuid; public String getName() { return name; @@ -95,4 +95,19 @@ public class Payload { this.serviceType = serviceType; } + public String getModelInvariantUuid() { + return modelInvariantUuid; + } + + public void setModelInvariantUuid(String modelInvariantUuid) { + this.modelInvariantUuid = modelInvariantUuid; + } + + public String getModelUuid() { + return modelUuid; + } + + public void setModelUuid(String modelUuid) { + this.modelUuid = modelUuid; + } } diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/PolicyService.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/PolicyService.java index 297683b4..01e2886a 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/PolicyService.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/PolicyService.java @@ -153,6 +153,8 @@ public class PolicyService { payload.setName("cloud-leased-line-101"); payload.setServiceInstanceID(cllId); payload.setAdditionalProperties(additionalProperties); + payload.setModelInvariantUuid("6790ab0e-034f-11eb-adc1-0242ac120002"); + payload.setModelUuid("6790ab0e-034f-11eb-adc1-0242ac120002"); OnsetMessage onsetmsg = new OnsetMessage(); try { @@ -184,7 +186,7 @@ public class PolicyService { String msg = ""; try { msg = objectMapper.writeValueAsString(onsetMessage); - log.info("Policy onset message for ControlLoop-CCVPN-CLL is {}", msg); + log.info("Sending onset message to Onap/Policy for ControlLoop-CCVPN-CLL, the msg: {}", msg); policyDmaapClient.sendNotificationToPolicy(msg); } catch (Exception e) { diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java index a7847b0e..c66122c1 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java @@ -46,6 +46,7 @@ import java.util.concurrent.Future; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; +import java.util.stream.Collectors; import static java.util.concurrent.Executors.newSingleThreadExecutor; @@ -105,7 +106,7 @@ public class BandwidthEvaluator { @Override public void process(Event event) { if (event.type() == SimpleEvent.Type.PERIODIC_CHECK && isPeriodicCheckOn()){ - log.info("Received new periodic check request: {}", event.time()); + log.info("=== Processing new periodic check request: {} ===", event.time()); Map> usedBwMap = ccvpnPmDatastore.getUsedBwMap(); Map candidate = new TreeMap<>(); for(Map.Entry> entry: usedBwMap.entrySet()) { @@ -114,10 +115,12 @@ public class BandwidthEvaluator { if (usedBws == null) { // No enough data for evaluating + log.debug("CCVPN Evaluator Output: service {}, not enough data to evaluate", serviceId); continue; } if (ccvpnPmDatastore.getMaxBwOfSvc(serviceId) == 0) { // Max bandwidth not cached yet + log.debug("CCVPN Evaluator Output: service {}, max bandwidth not cached, wait for next round", serviceId); post(new SimpleEvent(SimpleEvent.Type.AAI_BW_REQ, serviceId)); continue; } @@ -126,48 +129,81 @@ public class BandwidthEvaluator { .summaryStatistics() .getAverage(); if (needAdjust(serviceId, avg, ccvpnPmDatastore.getMaxBwOfSvc(serviceId))) { + log.debug("CCVPN Evaluator Output: service {}, need adjustment, putting into candidate list", serviceId); int newBw = (int) (Math.ceil((avg / threshold) * 1.2 / precision) * precision); candidate.put(serviceId, Math.max(candidate.getOrDefault(serviceId, 0), newBw)); } } + // check svc under maintenance + Map svcUnderMaintenance = getServicesUnderMaintenance(); + for (Map.Entry entry: svcUnderMaintenance.entrySet()){ + candidate.putIfAbsent(entry.getKey(), 0); + } + // fetch the maxbandwidth info if underMaintenance; otherwise send modification request for(Map.Entry entry: candidate.entrySet()) { if (isServiceUnderMaintenance(entry.getKey())) { + if (entry.getValue() == 0){ + log.debug("CCVPN Evaluator Output: service {}," + + " are in maintenance state, fetching bandwidth info from AAI", entry.getKey()); + } else { + log.debug("CCVPN Evaluator Output: candidate {}," + + " need adjustment, but skipped due to maintenance state", entry.getKey()); + } post(new SimpleEvent(SimpleEvent.Type.AAI_BW_REQ, entry.getKey())); continue; } + log.debug("CCVPN Evaluator Output: candidate {}," + + " need adjustment, sending request to policy", entry.getKey()); ccvpnPmDatastore.updateSvcState(entry.getKey(), ServiceState.UNDER_MAINTENANCE); sendModifyRequest(entry.getKey(), entry.getValue(), RequestOwner.DCAE); } + log.info("=== Processing periodic check complete ==="); } else if (event.type() == SimpleEvent.Type.ONDEMAND_CHECK && isOnDemandCheckOn()) { - log.info("Received new on-demand check request: {}", event.time()); + log.info("=== Processing new on-demand check request: {} ===", event.time()); JsonObject payload = (JsonObject) event.subject(); String serviceId = payload.get(SERVICE_INSTANCE_LOCATION_ID).getAsString(); if (!isServiceUnderMaintenance(serviceId)){ int newBandwidth = payload.get(BANDWIDTH_TOTAL).getAsInt(); Map maxBandwidthData = aaiService.fetchMaxBandwidthOfService(serviceId); - int oldBandwidth = maxBandwidthData.get("maxBandwidth"); - if (newBandwidth != oldBandwidth) { + if (maxBandwidthData.get("maxBandwidth") != null + && maxBandwidthData.get("maxBandwidth") != newBandwidth){ + log.debug("CCVPN Evaluator Output: on-demand adjustment request for service: {} processed," + + " sending request to policy", serviceId); ccvpnPmDatastore.updateSvcState(serviceId, ServiceState.UNDER_MAINTENANCE); sendModifyRequest(serviceId, newBandwidth, RequestOwner.UUI); } + } else { + log.debug("CCVPN Evaluator Output: service {}," + + " received on-demand request, but skipped due to maintenance state", serviceId); } + log.info("=== Processing on-demand check complete ==="); } } private void sendModifyRequest(String cllId, Integer newBandwidth, RequestOwner owner) { + log.info("Sending modification request to policy. RequestOwner: {} - Service: {} change to bw: {}", + owner, cllId, newBandwidth); policyService.sendOnsetMessageToPolicy( policyService.formPolicyOnsetMessageForCCVPN(cllId, newBandwidth, owner) ); } private boolean needAdjust(String serivceId, double currentAverageUsage, int maxBandwidth){ + log.debug("CCVPN Service Usage Analysis: usage: {}, threshold: {}, maxbw {}", currentAverageUsage, threshold, maxBandwidth); return currentAverageUsage > threshold * maxBandwidth; } private boolean isServiceUnderMaintenance(String serivceId) { return ccvpnPmDatastore.getStatusOfSvc(serivceId) == ServiceState.UNDER_MAINTENANCE; } + + private Map getServicesUnderMaintenance(){ + return ccvpnPmDatastore.getSvcStatusMap().entrySet() + .stream() + .filter(e -> e.getValue() == ServiceState.UNDER_MAINTENANCE) + .collect(Collectors.toMap(p -> p.getKey(), p -> p.getValue())); + } }; /** @@ -177,18 +213,22 @@ public class BandwidthEvaluator { @Override public void process(Event event) { if (event.type() == SimpleEvent.Type.AAI_BW_REQ){ - log.info("Received new AAI network policy query at: {}", event.time()); + log.info("=== Processing new AAI network policy query at: {} ===", event.time()); String serviceId = (String) event.subject(); Map maxBandwidthData = aaiService.fetchMaxBandwidthOfService(serviceId); - int bwVal = maxBandwidthData.get("maxBandwidth"); - if (maxBandwidthData != null){ + if (maxBandwidthData.get("maxBandwidth") != null){ + log.debug("Successfully retrieved bandwidth info from AAI; service: {}, bandwidth: {}", + serviceId, maxBandwidthData.get("maxBandwidth")); + int bwValue = maxBandwidthData.get("maxBandwidth").intValue(); if (ccvpnPmDatastore.getMaxBwOfSvc(serviceId) == 0){ - ccvpnPmDatastore.updateMaxBw(serviceId, bwVal, true); - } else if (ccvpnPmDatastore.getMaxBwOfSvc(serviceId) != bwVal) { - ccvpnPmDatastore.updateMaxBw(serviceId, bwVal, true); + ccvpnPmDatastore.updateMaxBw(serviceId, bwValue, true); + } else if (ccvpnPmDatastore.getMaxBwOfSvc(serviceId) != bwValue) { + log.debug("Service modification complete; serviceId: {} with new bandwidth: {}", serviceId, bwValue); + ccvpnPmDatastore.updateMaxBw(serviceId, bwValue, true); ccvpnPmDatastore.updateSvcState(serviceId, ServiceState.RUNNING); } } + log.info("=== Processing AAI network policy query complete ==="); } } }; @@ -229,6 +269,8 @@ public class BandwidthEvaluator { * @param event event object */ public void post(@NonNull Event event){ + log.debug("A new event triggered, type: {}, subject: {}, at time: {}", + event.type(), event.subject(), event.time()); if (event.type() == SimpleEvent.Type.AAI_BW_REQ) { aaiEventLoop.add(event); } else if (event.type() == SimpleEvent.Type.PERIODIC_CHECK) { diff --git a/components/slice-analysis-ms/src/main/resources/logback.xml b/components/slice-analysis-ms/src/main/resources/logback.xml index 8d79c4ee..325402b3 100644 --- a/components/slice-analysis-ms/src/main/resources/logback.xml +++ b/components/slice-analysis-ms/src/main/resources/logback.xml @@ -1,27 +1,28 @@ - - +--> + diff --git a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java index c80a1495..f0ce5509 100644 --- a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java +++ b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java @@ -60,7 +60,7 @@ public class BandwidthEvaluatorTest { @Test public void postTest() { - Event evt = mock(SimpleEvent.class); + Event evt = new SimpleEvent(null, "{}"); bandwidthEvaluator.post(evt); Mockito.verify(bandwidthEvaluator, Mockito.atLeastOnce()).post(Mockito.any(Event.class)); } diff --git a/components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json b/components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json index 82faeeb4..d8cb65cd 100644 --- a/components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json +++ b/components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json @@ -1,25 +1,45 @@ { - "cambria.partition":"AAI", - "event-header":{ - "severity":"NORMAL", - "entity-type":"service-instance", - "top-entity-type":"service-instance", - "entity-link":"/aai/v24/business/customers/customer/IBNCustomer/service-subscriptions/service-subscription/IBN/service-instances/service-instance/cll-01", - "event-type":"AAI-EVENT","domain":"dev","action":"UPDATE", - "sequence-number":"0","id":"51a99267-83ec-4f4f-a676-690ba527bf78", - "source-name":"UUI","version":"v23","timestamp":"20210705-15:18:37:452" + "cambria.partition": "AAI", + "event-header": { + "severity": "NORMAL", + "entity-type": "service-instance", + "top-entity-type": "customer", + "entity-link": "/aai/v24/business/customers/customer/IBNCustomer/service-subscriptions/service-subscription/IBN/service-instances/service-instance/test", + "event-type": "AAI-EVENT", + "domain": "dev", + "action": "UPDATE", + "sequence-number": "0", + "id": "48c2016e-12cb-4f9f-ab25-5eaaf8da9fe8", + "source-name": "UUI", + "version": "v24", + "timestamp": "20220406-19:53:41:550" }, "entity":{ - "service-instance-id":"0835fd19-6726-4081-befb-cc8932c47767", - "service-instance-name":"sa1", - "service-instance-location-id" : "cll-01", - "service-type":"embb", - "service-role":"service-profile", - "environment-context":"01-06E442", - "model-invariant-id":"8b94b147-2233-4e9f-b939-55c1b0e618ac", - "model-version-id":"961ec436-7b16-4d71-9d62-9c4ca5dd94bf", - "resource-version":"1645003055191", - "orchestration-status":"deactivated", - "bandwidth-total" : 8000 + "global-customer-id": "IBNCustomer", + "subscriber-name": "IBNCustomer", + "service-subscriptions": { + "service-subscription": [ + { + "service-type": "IBN", + "service-instances": { + "service-instance": [ + { + "model-version-id": "6790ab0e-034f-11eb-adc1-0242ac120002", + "service-instance-id": "test", + "resource-version": "1649274821478", + "service-type": "IBN", + "service-instance-location-id": "460-00", + "service-role": "TN", + "environment-context": "001-100001", + "bandwidth-total": "4000", + "model-invariant-id": "6790ab0e-034f-11eb-adc1-0242ac120002", + "service-instance-name": "decheng-test-001", + "orchestration-status": "allocated" + } + ] + } + } + ] + } } } diff --git a/components/slice-analysis-ms/src/test/resources/config_all.json b/components/slice-analysis-ms/src/test/resources/config_all.json index b2998703..b48ca753 100644 --- a/components/slice-analysis-ms/src/test/resources/config_all.json +++ b/components/slice-analysis-ms/src/test/resources/config_all.json @@ -40,13 +40,13 @@ "aaf_password": null, "api_key" : null, "api_secret" : null, - "servers" : ["message-router"], + "servers" : ["message-router:3904"], "consumer_group" : "dcae_ccvpn_cl", "consumer_instance" : "dcae_ccvpn_cl_aaievent", "fetch_timeout" : 15000, "fetch_limit" : 100, "dmaap_info":{ - "topic_url":"https://message-router:3905/events/AAI_EVENT", + "topic_url":"http://message-router:3904/events/AAI-EVENT", "client_role":"org.onap.dcae.aaiSub", "location":"onap", "client_id":"sdnr-sliceanalysis-1" diff --git a/components/slice-analysis-ms/src/test/resources/onsetMessage2.json b/components/slice-analysis-ms/src/test/resources/onsetMessage2.json index 530c831f..dbcbda4c 100644 --- a/components/slice-analysis-ms/src/test/resources/onsetMessage2.json +++ b/components/slice-analysis-ms/src/test/resources/onsetMessage2.json @@ -1,6 +1,8 @@ { "closedLoopControlName": "ControlLoop-CCVPN-CLL-227e8b00-dbeb-4d03-8719-d0a658fb846c", "closedLoopAlarmStart": 1605691996370, + "modelInvariantUuid": "6790ab0e-034f-11eb-adc1-0242ac120002", + "modelUuid": "6790ab0e-034f-11eb-adc1-0242ac120002", "closedLoopEventClient": "microservice.sliceAnalysisMS", "closedLoopEventStatus": "ONSET", "requestID": "1e946480-1232-46d4-a39b-614ac534400f", -- cgit 1.2.3-korg