From 662afdf33cb5934737e35ae991a4624d438a836a Mon Sep 17 00:00:00 2001 From: decheng zhang Date: Thu, 21 Apr 2022 16:07:00 -0400 Subject: [SLICEANALYSIS] Fix CCVPN CLL Payload to Policy and Suppress Warnings in Compilation. 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 Change-Id: I3c0c2b526960ab0e08945ba47d06aeb8a6471d9f Signed-off-by: decheng zhang --- components/slice-analysis-ms/ChangeLog.md | 8 +- .../onap/slice/analysis/ms/models/policy/AAI.java | 96 ++++++++++++++-------- .../slice/analysis/ms/service/PolicyService.java | 7 +- .../src/main/resources/logback.xml | 2 +- .../analysis/ms/service/PolicyServiceTest.java | 4 +- .../src/test/resources/config_all.json | 19 ++++- .../src/test/resources/onsetMessage2.json | 6 +- 7 files changed, 94 insertions(+), 48 deletions(-) diff --git a/components/slice-analysis-ms/ChangeLog.md b/components/slice-analysis-ms/ChangeLog.md index b58a17dd..c95884bb 100644 --- a/components/slice-analysis-ms/ChangeLog.md +++ b/components/slice-analysis-ms/ChangeLog.md @@ -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 diff --git a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/policy/AAI.java b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/policy/AAI.java index 9083ff40..3d0caa57 100644 --- a/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/policy/AAI.java +++ b/components/slice-analysis-ms/src/main/java/org/onap/slice/analysis/ms/models/policy/AAI.java @@ -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. @@ -21,41 +22,72 @@ 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; + } } 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 01e2886a..729fdc5a 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 @@ -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; } diff --git a/components/slice-analysis-ms/src/main/resources/logback.xml b/components/slice-analysis-ms/src/main/resources/logback.xml index 325402b3..6d8c6e22 100644 --- a/components/slice-analysis-ms/src/main/resources/logback.xml +++ b/components/slice-analysis-ms/src/main/resources/logback.xml @@ -22,7 +22,7 @@ * *******************************************************************************/ --> - + diff --git a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/PolicyServiceTest.java b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/PolicyServiceTest.java index d9bf7617..7ac92f29 100644 --- a/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/PolicyServiceTest.java +++ b/components/slice-analysis-ms/src/test/java/org/onap/slice/analysis/ms/service/PolicyServiceTest.java @@ -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(); 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 b48ca753..c24c1f6f 100644 --- a/components/slice-analysis-ms/src/test/resources/config_all.json +++ b/components/slice-analysis-ms/src/test/resources/config_all.json @@ -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" @@ -16,7 +16,18 @@ "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" diff --git a/components/slice-analysis-ms/src/test/resources/onsetMessage2.json b/components/slice-analysis-ms/src/test/resources/onsetMessage2.json index dbcbda4c..eb64eff2 100644 --- a/components/slice-analysis-ms/src/test/resources/onsetMessage2.json +++ b/components/slice-analysis-ms/src/test/resources/onsetMessage2.json @@ -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" } } -- cgit 1.2.3-korg