[SLICEANALYSIS] Bugfix 91/128691/4 1.1.1-slice-analysis-ms
authordecheng zhang <decheng.zhang@huawei.com>
Thu, 24 Mar 2022 00:46:04 +0000 (20:46 -0400)
committerdecheng zhang <decheng.zhang@huawei.com>
Sat, 16 Apr 2022 03:21:29 +0000 (23:21 -0400)
    - 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>
16 files changed:
components/slice-analysis-ms/ChangeLog.md
components/slice-analysis-ms/src/main/docker/config/sliceanalysisms/config_all.json
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/aai/AaiService.java
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/AaiEventNotificationCallback.java
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicMonitor.java
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/MRTopicParams.java
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/dmaap/VesNotificationCallback.java
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/Configuration.java
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/policy/Payload.java
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/PolicyService.java
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluator.java
components/slice-analysis-ms/src/main/resources/logback.xml
components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/ccvpn/BandwidthEvaluatorTest.java
components/slice-analysis-ms/src/test/resources/aaiEventDmaapMsg.json
components/slice-analysis-ms/src/test/resources/config_all.json
components/slice-analysis-ms/src/test/resources/onsetMessage2.json

index 1528744..d8ef627 100644 (file)
@@ -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
 
index 2e094ee..63a4a97 100644 (file)
         "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"
index 289fedf..ab67c03 100644 (file)
@@ -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>();
     }
 }
index dc2cd77..0259f13 100644 (file)
@@ -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<e; i++){
-                handleMsgJsonObject(jsonArray.get(i).getAsJsonObject());
+                if (jsonArray.get(i).isJsonPrimitive()){
+                    // Deal with a batch of event message
+                    handleNotification(jsonArray.get(i).getAsString());
+                } else {
+                    handleMsgJsonObject(jsonArray.get(i).getAsJsonObject());
+                }
+
             }
         }
     }
 
     private void handleMsgJsonObject(JsonObject jsonObject){
         JsonObject header = jsonObject.get(EVENT_HEADER).getAsJsonObject();
-        if (header.has(ACTION) && header.get(ACTION).getAsString().equals(aaiNotifTargetAction)) {
-            if (header.has(ENTITY_TYPE) && header.get(ENTITY_TYPE).getAsString().equals(aaiNotifTargetEntity)){
-                if (header.has(SOURCE_NAME) && header.get(SOURCE_NAME).getAsString().equals(aaiNotifTargetSource)) {
-                    JsonObject body = jsonObject.get(ENTITY).getAsJsonObject();
-                    Event event = new SimpleEvent<>(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;
     }
 }
index 0c1ac60..aa1bc96 100644 (file)
@@ -91,8 +91,11 @@ public class MRTopicMonitor implements Runnable {
     public void run(){
         while (running){
             try {
+                logger.debug("Topic: {} getting new msg...", name);
                 Iterable<String> dmaapMsgs = consumerWrapper.fetch();
                 for (String msg : dmaapMsgs){
+                    logger.debug("Received message: {}" +
+                            "\r\n and processing start", msg);
                     process(msg);
                 }
             } catch (IOException | RuntimeException e){
index 66c2741..e5aaa1e 100644 (file)
@@ -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<e; i++){
-                    servers.add(jsonArray.get(i).getAsString());
-                }
-            }
+
             String topicUrl = jsonObject.get("dmaap_info").getAsJsonObject().get("topic_url").getAsString();
             if (topicUrl.startsWith("https")){
                 useHttps = true;
index 83bfcdb..584da7b 100644 (file)
@@ -104,6 +104,8 @@ public class VesNotificationCallback implements NotificationCallback {
             log.error("Error converting VES msg to object, {}", e.getMessage());
         }
         if (cllId != null && uniId != null && bw != null){
+            log.info("Saving new CCVPN service usage data into ccvpnPmDatastore");
+            log.debug("new bandwidth data -- serviceId: {}, uniId: {}, bw: {}", cllId, uniId, bw);
             ccvpnPmDatastore.addUsedBwToEndpoint(cllId, uniId, bw);
         }
 
index d5aeb7b..2a509aa 100644 (file)
@@ -162,7 +162,7 @@ public class Configuration {
 
         aaiNotifTargetAction = jsonObject.get("sliceanalysisms.aaiNotif.targetAction").getAsString();
         aaiNotifTargetSource = jsonObject.get("sliceanalysisms.aaiNotif.targetSource").getAsString();
-        aaiNotifTargetSource = jsonObject.get("sliceanalysisms.aaiNotif.targetEntity").getAsString();
+        aaiNotifTargetEntity = jsonObject.get("sliceanalysisms.aaiNotif.targetEntity").getAsString();
         ccvpnEvalInterval = jsonObject.get("sliceanalysisms.ccvpnEvalInterval").getAsInt();
         ccvpnEvalThreshold = jsonObject.get("sliceanalysisms.ccvpnEvalThreshold").getAsDouble();
         ccvpnEvalPrecision = jsonObject.get("sliceanalysisms.ccvpnEvalPrecision").getAsDouble();
index ceaeb73..e046040 100644 (file)
 package org.onap.slice.analysis.ms.models.policy;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
-import com.fasterxml.jackson.annotation.JsonInclude.Include;
-import com.fasterxml.jackson.annotation.JsonProperty;
 
 /**
  * Model class for the Paylaod Object
  */
-@JsonInclude(Include.NON_NULL)
+@JsonInclude(JsonInclude.Include.NON_NULL)
 public class Payload {
 
     private String name;
@@ -38,6 +36,8 @@ public class Payload {
     private String networkType;
     private AdditionalProperties<?> 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;
+    }
 }
index 297683b..01e2886 100644 (file)
@@ -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) {
index a7847b0..c66122c 100644 (file)
@@ -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<Endpointkey, CCVPNPmDatastore.EvictingQueue<Integer>> usedBwMap = ccvpnPmDatastore.getUsedBwMap();
                     Map<String, Integer> candidate = new TreeMap<>();
                     for(Map.Entry<Endpointkey, CCVPNPmDatastore.EvictingQueue<Integer>> 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<String , ServiceState> svcUnderMaintenance = getServicesUnderMaintenance();
+                    for (Map.Entry<String, ServiceState> entry: svcUnderMaintenance.entrySet()){
+                        candidate.putIfAbsent(entry.getKey(), 0);
+                    }
+                    // fetch the maxbandwidth info if underMaintenance; otherwise send modification request
                     for(Map.Entry<String, Integer> 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<String, Integer> 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<String, ServiceState> 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<String, Integer> 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) {
index 8d79c4e..325402b 100644 (file)
@@ -1,27 +1,28 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- 
+<!--
 /*******************************************************************************
  *  ============LICENSE_START=======================================================
  *  slice-analysis-ms
  *  ================================================================================
  *   Copyright (C) 2020 Wipro Limited.
+ *   Copyright (C) 2022 Huawei Canada Limited.
  *   ==============================================================================
  *     Licensed under the Apache License, Version 2.0 (the "License");
  *     you may not use this file except in compliance with the License.
  *     You may obtain a copy of the License at
- *  
+ *
  *          http://www.apache.org/licenses/LICENSE-2.0
- *  
+ *
  *     Unless required by applicable law or agreed to in writing, software
  *     distributed under the License is distributed on an "AS IS" BASIS,
  *     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  *     See the License for the specific language governing permissions and
  *     limitations under the License.
  *     ============LICENSE_END=========================================================
- *  
+ *
  *******************************************************************************/
-  -->
-       <configuration>
+-->
+<configuration scan="true">
 
     <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
         <layout class="ch.qos.logback.classic.PatternLayout">
index c80a149..f0ce550 100644 (file)
@@ -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));
     }
index 82faeeb..d8cb65c 100644 (file)
@@ -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"
+              }
+            ]
+          }
+        }
+      ]
+    }
   }
 }
index b299870..b48ca75 100644 (file)
         "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"
index 530c831..dbcbda4 100644 (file)
@@ -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",