[SLICEANALYSIS] Fix CCVPN CLL Payload to Policy and Suppress Warnings in Compilation. 37/129037/5 1.1.2-slice-analysis-ms
authordecheng zhang <decheng.zhang@huawei.com>
Thu, 21 Apr 2022 20:07:00 +0000 (16:07 -0400)
committerdecheng zhang <decheng.zhang@huawei.com>
Tue, 3 May 2022 15:37:42 +0000 (11:37 -0400)
Fix the message content that SLICEANALYSISMS sends to Policy for CCVPN bw adjustment and suppress exceptions and error in job builder

Issue-ID: DCAEGEN2-3147
Issue-ID: DCAEGEN2-3143
Signed-off-by: decheng zhang <decheng.zhang@huawei.com>
Change-Id: I3c0c2b526960ab0e08945ba47d06aeb8a6471d9f
Signed-off-by: decheng zhang <decheng.zhang@huawei.com>
components/slice-analysis-ms/ChangeLog.md
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/policy/AAI.java
components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/service/PolicyService.java
components/slice-analysis-ms/src/main/resources/logback.xml
components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/PolicyServiceTest.java
components/slice-analysis-ms/src/test/resources/config_all.json
components/slice-analysis-ms/src/test/resources/onsetMessage2.json

index b58a17d..c95884b 100644 (file)
@@ -4,15 +4,19 @@ All notable changes to this project will be documented in this file.
 The format is based on [Keep a Changelog](http://keepachangelog.com/)
 and this project adheres to [Semantic Versioning](http://semver.org/).
 
-## [1.1.2] - 2022/04/28
+## [1.1.2] - 2022/05/01
          - [DCAEGEN2-3145](https://jira.onap.org/browse/DCAEGEN2-3145) - Filter RAN related service instances in AAI
 
          - [DCAEGEN2-3146](https://jira.onap.org/browse/DCAEGEN2-3146) - Fetch CU Cells instead of DU cells data for ML message processing
 
+         - [DCAEGEN2-3147](https://jira.onap.org/browse/DCAEGEN2-3147) - Fix the message content that SLICEANALYSISMS sends to Policy for CCVPN bw adjustment and suppress exceptions and error in job builder
+
+         - [DCAEGEN2-3143](https://jira.onap.org/browse/DCAEGEN2-3143) - Suppress exceptions and ERRORS in slice-analysis-ms job building
+
 ## [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
+         - [DCAEGEN2-3141](https://jira.onap.org/browse/DCAEGEN2-3141) - 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 9083ff4..3d0caa5 100644 (file)
@@ -3,6 +3,7 @@
  *  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.
 
 package org.onap.slice.analysis.ms.models.policy;
 
+import com.fasterxml.jackson.annotation.JsonInclude;
 import com.fasterxml.jackson.annotation.JsonProperty;
 
-/** 
+/**
  * Model class for the AAI Object 
  */
+@JsonInclude(JsonInclude.Include.NON_NULL)
 public class AAI {
-       @JsonProperty("vserver.is-closed-loop-disabled")
-       private String vserverIsClosedLoopDisabled;
-       @JsonProperty("vserver.prov-status")
-       private String vserverProvStatus;
-       @JsonProperty("generic-vnf.vnf-id")
-       private String vServerVNFId;
-
-       public String getVserverIsClosedLoopDisabled() {
-               return vserverIsClosedLoopDisabled;
-       }
-
-       public void setVserverIsClosedLoopDisabled(String vserverIsClosedLoopDisabled) {
-               this.vserverIsClosedLoopDisabled = vserverIsClosedLoopDisabled;
-       }
-
-       public String getVserverProvStatus() {
-               return vserverProvStatus;
-       }
-
-       public void setVserverProvStatus(String vserverProvStatus) {
-               this.vserverProvStatus = vserverProvStatus;
-       }
-
-       public String getvServerVNFId() {
-               return vServerVNFId;
-       }
-
-       public void setvServerVNFId(String vServerVNFId) {
-               this.vServerVNFId = vServerVNFId;
-       }
-       
+    @JsonProperty("vserver.is-closed-loop-disabled")
+    private String vserverIsClosedLoopDisabled;
+    @JsonProperty("vserver.prov-status")
+    private String vserverProvStatus;
+    @JsonProperty("generic-vnf.vnf-id")
+    private String genericVnfVNFId;
+    @JsonProperty("generic-vnf.is-closed-loop-disabled")
+    private String genericVnfIsClosedLoopDisabled;
+    @JsonProperty("generic-vnf.prov-status")
+    private String genericVnfProvStatus;
+    @JsonProperty("generic-vnf.vnf-name")
+    private String genericVnfVnfName;
+
+    public String getVserverIsClosedLoopDisabled() {
+        return vserverIsClosedLoopDisabled;
+    }
+
+    public void setVserverIsClosedLoopDisabled(String vserverIsClosedLoopDisabled) {
+        this.vserverIsClosedLoopDisabled = vserverIsClosedLoopDisabled;
+    }
+
+    public String getVserverProvStatus() {
+        return vserverProvStatus;
+    }
+
+    public void setVserverProvStatus(String vserverProvStatus) {
+        this.vserverProvStatus = vserverProvStatus;
+    }
+
+    public String getGenericVnfVNFId() {
+        return genericVnfVNFId;
+    }
+
+    public void setGenericVnfVNFId(String genericVnfVNFId) {
+        this.genericVnfVNFId = genericVnfVNFId;
+    }
+
+    public String getGenericVnfProvStatus() {
+        return genericVnfProvStatus;
+    }
+
+    public void setGenericVnfProvStatus(String genericVnfProvStatus) {
+        this.genericVnfProvStatus = genericVnfProvStatus;
+    }
+
+    public String getGenericVnfIsClosedLoopDisabled() {
+        return genericVnfIsClosedLoopDisabled;
+    }
+
+    public void setGenericVnfIsClosedLoopDisabled(String genericVnfIsClosedLoopDisabled) {
+        this.genericVnfIsClosedLoopDisabled = genericVnfIsClosedLoopDisabled;
+    }
+
+    public String getGenericVnfVnfName() {
+        return genericVnfVnfName;
+    }
+
+    public void setGenericVnfVnfName(String genericVnfVnfName) {
+        this.genericVnfVnfName = genericVnfVnfName;
+    }
 }
index 01e2886..729fdc5 100644 (file)
@@ -104,7 +104,7 @@ public class PolicyService {
         AAI aai = new AAI();
         aai.setVserverIsClosedLoopDisabled("false");
         aai.setVserverProvStatus("ACTIVE");
-        aai.setvServerVNFId(serviceDetails.get("ranNFNSSIId"));
+        aai.setGenericVnfVNFId(serviceDetails.get("ranNFNSSIId"));
         onsetmsg.setAai(aai);
         return onsetmsg;
     }
@@ -172,7 +172,10 @@ public class PolicyService {
         onsetmsg.setFrom("DCAE");
         onsetmsg.setVersion("1.0.2");
         AAI aai = new AAI();
-        aai.setVserverIsClosedLoopDisabled("true");
+        aai.setGenericVnfIsClosedLoopDisabled("false");
+        aai.setGenericVnfProvStatus("ACTIVE");
+        aai.setGenericVnfVNFId("00000000-0000-0000-0000-000000000000");
+        aai.setGenericVnfVnfName("00000");
         onsetmsg.setAai(aai);
         return onsetmsg;
     }
index 325402b..6d8c6e2 100644 (file)
@@ -22,7 +22,7 @@
  *
  *******************************************************************************/
 -->
-<configuration scan="true">
+<configuration>
 
     <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
         <layout class="ch.qos.logback.classic.PatternLayout">
index d9bf761..7ac92f2 100644 (file)
@@ -93,10 +93,8 @@ public class PolicyServiceTest {
         try {
             output = obj.readValue(new String(Files.readAllBytes(Paths.get("src/test/resources/onsetMessage2.json"))), OnsetMessage.class);
             expected = obj.writeValueAsString(output);
-
-            String msg = obj.writeValueAsString(policyService
+            actual = new Gson().toJson(policyService
                     .formPolicyOnsetMessageForCCVPN(cllId, 3000, RequestOwner.UUI));
-            actual = new Gson().toJson(msg);
         }
         catch (IOException e) {
             e.printStackTrace();
index b48ca75..c24c1f6 100644 (file)
@@ -5,7 +5,7 @@
         "aaf_password": null,
         "type": "message-router",
         "dmaap_info": {
-          "topic_url": "https://message-router.onap.svc.cluster.local:3905/events/unauthenticated.VES_MEASUREMENT_OUTPUT",
+          "topic_url": "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.PERFORMANCE_MEASUREMENTS",
           "client_role": "sliceanalysis-subscriber",
           "location": "onap",
           "client_id": "sdnr-sliceanalysis-1"
         "aaf_password": null,
         "type": "message-router",
         "dmaap_info": {
-          "topic_url": "https://message-router.onap.svc.cluster.local:3905/events/DCAE_CL_RSP",
+          "topic_url": "http://message-router.onap.svc.cluster.local:3904/events/DCAE_CL_RSP",
+          "client_role": "sliceanalysis-subscriber",
+          "location": "onap",
+          "client_id": "sdnr-sliceanalysis-1"
+        },
+        "aaf_username": null
+      },
+      "intelligent_slicing_topic": {
+        "aaf_password": null,
+        "type": "message-router",
+        "dmaap_info": {
+          "topic_url": "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.ML_RESPONSE_TOPIC",
           "client_role": "sliceanalysis-subscriber",
           "location": "onap",
           "client_id": "sdnr-sliceanalysis-1"
@@ -40,7 +51,7 @@
         "aaf_password": null,
         "api_key" : null,
         "api_secret" : null,
-        "servers" : ["message-router:3904"],
+        "servers" : ["dmaap:3904"],
         "consumer_group" : "dcae_ccvpn_cl",
         "consumer_instance" : "dcae_ccvpn_cl_aaievent",
         "fetch_timeout" : 15000,
@@ -58,7 +69,7 @@
         "aaf_password": null,
         "type": "message-router",
         "dmaap_info": {
-          "topic_url": "https://message-router.onap.svc.cluster.local:3905/events/unauthenticated.DCAE_CL_OUTPUT",
+          "topic_url": "http://message-router.onap.svc.cluster.local:3904/events/unauthenticated.DCAE_CL_OUTPUT",
           "client_role": "sliceanalysis-subscriber",
           "location": "onap",
           "client_id": "sdnr-sliceanalysis-1"
index dbcbda4..eb64eff 100644 (file)
@@ -1,8 +1,6 @@
 {
   "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",
@@ -12,9 +10,9 @@
   "version": "1.0.2",
   "target_type": "VNF",
   "AAI": {
-    "generic-vnf.is-closed-loop-disabled": "true",
+    "generic-vnf.is-closed-loop-disabled": "false",
     "generic-vnf.prov-status": "ACTIVE",
-    "generic-vnf.vnf-id": "3f2f23fa-c567-4dd8-8f15-f95ae3e6fd82",
+    "generic-vnf.vnf-id": "e51a9b12-f313-11ea-adc1-0242ac120003",
     "generic-vnf.vnf-name": "76543"
   }
 }