From 4b5cbc8b1bc57316dd1cad554fad98235d361053 Mon Sep 17 00:00:00 2001 From: jhh Date: Fri, 4 Nov 2022 11:53:50 -0500 Subject: Support A1 PMS Actor for SON use case Issue-ID: POLICY-4444 Signed-off-by: jhh Change-Id: I1811b79513616aab813b6d97823d6c1d2bbbee47 Signed-off-by: jhh --- controlloop/common/controller-usecases/pom.xml | 8 +++++++- .../test/resources/config/event-manager.properties | 6 +++++- .../config/usecases-controller.properties | 10 ++++++--- controlloop/common/eventmanager/pom.xml | 8 +++++++- .../common/feature-controlloop-management/pom.xml | 11 ++++++++++ .../main/feature/config/A1-P-RSP-topic.properties | 21 +++++++++++++++++++ .../src/main/feature/config/A1-P-topic.properties | 23 +++++++++++++++++++++ .../main/feature/config/event-manager.properties | 6 +++++- .../controlloop/common/rules/test/BaseTest.java | 24 ++++++++++++++-------- .../resources/vsonh/v5G.son.A1.sdnr.success.json | 2 +- 10 files changed, 103 insertions(+), 16 deletions(-) create mode 100644 controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties create mode 100644 controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties (limited to 'controlloop/common') diff --git a/controlloop/common/controller-usecases/pom.xml b/controlloop/common/controller-usecases/pom.xml index c9e52b723..e063b09e3 100644 --- a/controlloop/common/controller-usecases/pom.xml +++ b/controlloop/common/controller-usecases/pom.xml @@ -3,7 +3,7 @@ ============LICENSE_START======================================================= ONAP ================================================================================ - Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2020-2022 AT&T Intellectual Property. All rights reserved. ================================================================================ Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -152,6 +152,12 @@ ${policy.models.version} provided + + org.onap.policy.models.policy-models-interactions.model-actors + actor.a1p + ${policy.models.version} + provided + org.onap.policy.models.policy-models-interactions.model-actors actor.so diff --git a/controlloop/common/controller-usecases/src/test/resources/config/event-manager.properties b/controlloop/common/controller-usecases/src/test/resources/config/event-manager.properties index 076d6077a..5ec8c578f 100644 --- a/controlloop/common/controller-usecases/src/test/resources/config/event-manager.properties +++ b/controlloop/common/controller-usecases/src/test/resources/config/event-manager.properties @@ -2,7 +2,7 @@ # ============LICENSE_START====================================================== # ONAP # =============================================================================== -# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2020-2022 AT&T Intellectual Property. All rights reserved. # =============================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -69,6 +69,10 @@ actor.service.SDNR.sinkTopic=SDNR-CL actor.service.SDNR.sourceTopic=SDNR-CL-RSP actor.service.SDNR.operations.any.placeholder= +actor.service.A1P.sinkTopic=A1-P +actor.service.A1P.sourceTopic=A1-P-RSP +actor.service.A1P.operations.any.placeholder= + actor.service.SO.clientName=SO actor.service.SO.pollPath=orchestrationRequests/v5/ actor.service.SO.maxPolls=20 diff --git a/controlloop/common/controller-usecases/src/test/resources/config/usecases-controller.properties b/controlloop/common/controller-usecases/src/test/resources/config/usecases-controller.properties index f90b1d18c..dd1d35fca 100644 --- a/controlloop/common/controller-usecases/src/test/resources/config/usecases-controller.properties +++ b/controlloop/common/controller-usecases/src/test/resources/config/usecases-controller.properties @@ -2,7 +2,7 @@ # ============LICENSE_START======================================================= # ONAP # ================================================================================ -# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2020,2022 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ rules.groupId=org.onap.policy.controlloop rules.artifactId=usecases rules.version=1.1.0 -noop.source.topics=DCAE_TOPIC,APPC-CL,APPC-LCM-WRITE,SDNR-CL-RSP,POLICY-CL-MGT,APPC-LCM-READ +noop.source.topics=DCAE_TOPIC,APPC-CL,APPC-LCM-WRITE,SDNR-CL-RSP,POLICY-CL-MGT,APPC-LCM-READ,A1-P-RSP noop.source.topics.DCAE_TOPIC.events=\ org.onap.policy.controlloop.CanonicalOnset,org.onap.policy.controlloop.CanonicalAbated @@ -47,13 +47,17 @@ noop.source.topics.SDNR-CL-RSP.events=org.onap.policy.sdnr.PciResponseWrapper noop.source.topics.SDNR-CL-RSP.events.org.onap.policy.sdnr.PciResponseWrapper.filter=[?($.type == 'response')] noop.source.topics.SDNR-CL-RSP.events.custom.gson=org.onap.policy.sdnr.util.Serialization,gson +noop.source.topics.A1-P-RSP.events=org.onap.policy.sdnr.PciResponseWrapper +noop.source.topics.A1-P-RSP.events.org.onap.policy.sdnr.PciResponseWrapper.filter=[?($.type == 'response')] +noop.source.topics.A1-P-RSP.events.custom.gson=org.onap.policy.sdnr.util.Serialization,gson + noop.source.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification noop.source.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty noop.source.topics.APPC-LCM-READ.events=org.onap.policy.appclcm.AppcLcmDmaapWrapper noop.source.topics.APPC-LCM-READ.events.custom.gson=org.onap.policy.appclcm.util.Serialization,gson -noop.sink.topics=APPC-CL,APPC-LCM-READ,POLICY-CL-MGT,SDNR-CL,DCAE_CL_RSP +noop.sink.topics=APPC-CL,APPC-LCM-READ,POLICY-CL-MGT,SDNR-CL,DCAE_CL_RSP,A1-P noop.sink.topics.POLICY-CL-MGT.events=org.onap.policy.controlloop.VirtualControlLoopNotification noop.sink.topics.POLICY-CL-MGT.events.custom.gson=org.onap.policy.controlloop.util.Serialization,gsonPretty diff --git a/controlloop/common/eventmanager/pom.xml b/controlloop/common/eventmanager/pom.xml index c2ae3e5ae..f5be00449 100644 --- a/controlloop/common/eventmanager/pom.xml +++ b/controlloop/common/eventmanager/pom.xml @@ -2,7 +2,7 @@ ============LICENSE_START======================================================= eventmanager ================================================================================ - Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. + Copyright (C) 2017-2022 AT&T Intellectual Property. All rights reserved. Modifications Copyright (C) 2019 Nordix Foundation. Modifications Copyright (C) 2019-2020 Bell Canada. ================================================================================ @@ -60,6 +60,12 @@ ${policy.models.version} provided + + org.onap.policy.models.policy-models-interactions.model-actors + actor.a1p + ${policy.models.version} + provided + org.onap.policy.models.policy-models-interactions.model-actors actor.appc diff --git a/controlloop/common/feature-controlloop-management/pom.xml b/controlloop/common/feature-controlloop-management/pom.xml index 3c48b489b..460921dac 100644 --- a/controlloop/common/feature-controlloop-management/pom.xml +++ b/controlloop/common/feature-controlloop-management/pom.xml @@ -208,6 +208,17 @@ + + org.onap.policy.models.policy-models-interactions.model-actors + actor.a1p + ${policy.models.version} + + + guava + com.google.guava + + + org.onap.policy.models.policy-models-interactions.model-actors actor.so diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties new file mode 100644 index 000000000..adf2b23a4 --- /dev/null +++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-RSP-topic.properties @@ -0,0 +1,21 @@ +# ============LICENSE_START======================================================= +# ONAP +# ================================================================================ +# Copyright (C) 2022 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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========================================================= + +dmaap.source.topics=A1-P-RSP +dmaap.source.topics.A1-P-RSP.servers=${envd:DMAAP_SERVERS} +dmaap.source.topics.A1-P-RSP.https=${envd:DMAAP_HTTPS:true} diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties new file mode 100644 index 000000000..646d5a08a --- /dev/null +++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/A1-P-topic.properties @@ -0,0 +1,23 @@ +# ============LICENSE_START======================================================= +# ONAP +# ================================================================================ +# Copyright (C) 2022 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# 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========================================================= + +dmaap.sink.topics=A1-P + +dmaap.sink.topics.A1-P.servers=${envd:DMAAP_SERVERS} +dmaap.sink.topics.A1-P.https=${envd:DMAAP_HTTPS:true} + diff --git a/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties b/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties index 097d4fd02..de3537aee 100644 --- a/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties +++ b/controlloop/common/feature-controlloop-management/src/main/feature/config/event-manager.properties @@ -2,7 +2,7 @@ # ============LICENSE_START====================================================== # ONAP # =============================================================================== -# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2020-2022 AT&T Intellectual Property. All rights reserved. # Modifications Copyright (C) 2022 CTC, Inc. and others. # =============================================================================== # Licensed under the Apache License, Version 2.0 (the "License"); @@ -71,6 +71,10 @@ actor.service.SDNR.sinkTopic=SDNR-CL actor.service.SDNR.sourceTopic=SDNR-CL-RSP actor.service.SDNR.operations.any.placeholder= +actor.service.A1P.sinkTopic=A1-P +actor.service.A1P.sourceTopic=A1-P-RSP +actor.service.A1P.operations.any.placeholder= + actor.service.SO.clientName=SO actor.service.SO.pollPath=orchestrationRequests/v5/ actor.service.SO.maxPolls=20 diff --git a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java index 2b81fda7d..d2fe57f8f 100644 --- a/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java +++ b/controlloop/common/rules-test/src/main/java/org/onap/policy/controlloop/common/rules/test/BaseTest.java @@ -72,6 +72,8 @@ public abstract class BaseTest { protected static final String APPC_CL_TOPIC = "APPC-CL"; protected static final String SDNR_CL_TOPIC = "SDNR-CL"; protected static final String SDNR_CL_RSP_TOPIC = "SDNR-CL-RSP"; + protected static final String A1P_CL_TOPIC = "A1-P"; + protected static final String A1P_CL_RSP_TOPIC = "A1-P-RSP"; /* * Constants for each test case. @@ -129,7 +131,7 @@ public abstract class BaseTest { private static final String V5G_SON_A1_TOSCA_POLICY = "policies/v5gSonA1.policy.operational.input.tosca.json"; private static final String V5G_SON_A1_ONSET = "vsonh/v5G.son.A1.onset.json"; private static final String V5G_SON_A1_SDNR_SUCCESS = "vsonh/v5G.son.A1.sdnr.success.json"; - private static final String MODIFY_A1_POLICY_OPERATION = "ModifyA1Policy"; + private static final String PUT_A1_POLICY_OPERATION = "PutA1Policy"; /* * Coders used to decode requests and responses. */ @@ -367,7 +369,8 @@ public abstract class BaseTest { */ @Test public void testVpciSunnyDayCompliant() { - sdnrSunnyDay(VPCI_TOSCA_COMPLIANT_POLICY, VPCI_ONSET, VPCI_SDNR_SUCCESS, SDNR_MODIFY_CONFIG_OP); + sdnrSunnyDay(VPCI_TOSCA_COMPLIANT_POLICY, VPCI_ONSET, VPCI_SDNR_SUCCESS, + SDNR_MODIFY_CONFIG_OP, SDNR_CL_TOPIC, SDNR_CL_RSP_TOPIC); } // VSONH @@ -377,7 +380,8 @@ public abstract class BaseTest { */ @Test public void testVsonhSunnyDayCompliant() { - sdnrSunnyDay(VSONH_TOSCA_COMPLIANT_POLICY, VSONH_ONSET, VSONH_SDNR_SUCCESS, SNDR_MODIFY_CONFIG_ANR_OP); + sdnrSunnyDay(VSONH_TOSCA_COMPLIANT_POLICY, VSONH_ONSET, VSONH_SDNR_SUCCESS, + SNDR_MODIFY_CONFIG_ANR_OP, SDNR_CL_TOPIC, SDNR_CL_RSP_TOPIC); } /** @@ -385,7 +389,8 @@ public abstract class BaseTest { */ @Test public void test5gSonO1SunnyDayCompliant() { - sdnrSunnyDay(V5G_SON_O1_TOSCA_POLICY, V5G_SON_O1_ONSET, V5G_SON_O1_SDNR_SUCCESS, MODIFY_O1_CONFIG_OPERATION); + sdnrSunnyDay(V5G_SON_O1_TOSCA_POLICY, V5G_SON_O1_ONSET, V5G_SON_O1_SDNR_SUCCESS, + MODIFY_O1_CONFIG_OPERATION, SDNR_CL_TOPIC, SDNR_CL_RSP_TOPIC); } /** @@ -393,7 +398,8 @@ public abstract class BaseTest { */ @Test public void test5gSonA1SunnyDayCompliant() { - sdnrSunnyDay(V5G_SON_A1_TOSCA_POLICY, V5G_SON_A1_ONSET, V5G_SON_A1_SDNR_SUCCESS, MODIFY_A1_POLICY_OPERATION); + sdnrSunnyDay(V5G_SON_A1_TOSCA_POLICY, V5G_SON_A1_ONSET, V5G_SON_A1_SDNR_SUCCESS, + PUT_A1_POLICY_OPERATION, A1P_CL_TOPIC, A1P_CL_RSP_TOPIC); } /** @@ -572,9 +578,11 @@ public abstract class BaseTest { * @param onsetFile file containing the ONSET to be injected * @param operation expected SDNR operation request */ - protected void sdnrSunnyDay(String policyFile, String onsetFile, String successFile, String operation) { + protected void sdnrSunnyDay(String policyFile, String onsetFile, + String successFile, String operation, + String requestTopic, String responseTopic) { policyClMgt = createNoficationTopicListener(); - sdnrClSink = topics.createListener(SDNR_CL_TOPIC, PciMessage.class, SDNR_CODER); + sdnrClSink = topics.createListener(requestTopic, PciMessage.class, SDNR_CODER); policy = checkPolicy(policyFile); @@ -592,7 +600,7 @@ public abstract class BaseTest { /* * Inject response. */ - topics.inject(SDNR_CL_RSP_TOPIC, successFile, pcireq.getBody().getInput().getCommonHeader().getSubRequestId()); + topics.inject(responseTopic, successFile, pcireq.getBody().getInput().getCommonHeader().getSubRequestId()); /* --- Operation Completed --- */ diff --git a/controlloop/common/rules-test/src/main/resources/vsonh/v5G.son.A1.sdnr.success.json b/controlloop/common/rules-test/src/main/resources/vsonh/v5G.son.A1.sdnr.success.json index 12cfbc626..186241f5a 100644 --- a/controlloop/common/rules-test/src/main/resources/vsonh/v5G.son.A1.sdnr.success.json +++ b/controlloop/common/rules-test/src/main/resources/vsonh/v5G.son.A1.sdnr.success.json @@ -17,7 +17,7 @@ } }, "version": "1.0", - "rpc-name": "ModifyA1Policy", + "rpc-name": "puta1policy", "correlation-id": "82feb01e-4f3e-40e2-b8df-683adabae893", "type": "response" } -- cgit 1.2.3-korg