diff options
author | Sirisha_Manchikanti <sirisha.manchikanti@est.tech> | 2022-02-28 17:10:36 +0000 |
---|---|---|
committer | Sirisha_Manchikanti <sirisha.manchikanti@est.tech> | 2022-03-02 12:12:49 +0000 |
commit | 7ec767641505f52cd8ecf8b9a76fa35afe32635e (patch) | |
tree | 90dde20bbe7d13b2ee253a7b21ea1cb18f94194e | |
parent | ee04ffd34d67563f1b33a4fbb1eb17e948725d0f (diff) |
Rename ControlLoop to AutomationCompsition
Issue-ID: POLICY-3938
Signed-off-by: Sirisha_Manchikanti <sirisha.manchikanti@est.tech>
Change-Id: I63188fa9bc5d634d3aeb7e2d7051c4d67b5a202c
29 files changed, 302 insertions, 295 deletions
diff --git a/main/src/test/resources/parameters/TestConfigParams.json b/main/src/test/resources/parameters/TestConfigParams.json index 0bb50d65..8bd957a1 100644 --- a/main/src/test/resources/parameters/TestConfigParams.json +++ b/main/src/test/resources/parameters/TestConfigParams.json @@ -2,7 +2,7 @@ "name":"SDCDistributionGroup", "restServerParameters":{ "host":"0.0.0.0", - "port":54290, + "port":50654, "userName":"healthcheck", "password":"zb!XztG34" }, diff --git a/packages/policy-distribution-tarball/src/main/resources/etc/defaultConfig.json b/packages/policy-distribution-tarball/src/main/resources/etc/defaultConfig.json index 4c14f75b..5cdb99ec 100644 --- a/packages/policy-distribution-tarball/src/main/resources/etc/defaultConfig.json +++ b/packages/policy-distribution-tarball/src/main/resources/etc/defaultConfig.json @@ -20,10 +20,10 @@ "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.PolicyDecoderFileInCsarToPolicy", "decoderConfigurationName": "toscaPolicyDecoderConfiguration" }, - "ToscaControlLoopDecoder": { - "decoderType": "ToscaControlLoopDecoder", - "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsar", - "decoderConfigurationName": "toscaControlLoopDecoderConfiguration" + "ToscaAutomationCompositionDecoder": { + "decoderType": "ToscaAutomationCompositionDecoder", + "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.AutomationCompositionDecoderFileInCsar", + "decoderConfigurationName": "toscaAutomationCompositionDecoderConfiguration" } }, "policyForwarders": { @@ -32,10 +32,10 @@ "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiPolicyForwarder", "forwarderConfigurationName": "lifecycleApiPolicyConfiguration" }, - "LifeCycleApiControlLoopForwarder": { - "forwarderType": "LifeCycleControlLoopAPI", - "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarder", - "forwarderConfigurationName": "lifecycleApiControlLoopConfiguration" + "LifeCycleApiAutomationCompositionForwarder": { + "forwarderType": "LifeCycleAutomationCompositionAPI", + "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiAutomationCompositionForwarder", + "forwarderConfigurationName": "lifecycleApiAutomationCompositionConfiguration" } } } @@ -76,10 +76,10 @@ "policyTypeFileName": "tosca_policy_type" } }, - "toscaControlLoopDecoderConfiguration": { - "parameterClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsarParameterGroup", + "toscaAutomationCompositionDecoderConfiguration": { + "parameterClassName": "org.onap.policy.distribution.reception.decoding.policy.file.AutomationCompositionDecoderFileInCsarParameterGroup", "parameters": { - "controlLoopType": "controlloop" + "automationCompositionType": "acm" } } }, @@ -106,12 +106,12 @@ "deployPolicies": true } }, - "lifecycleApiControlLoopConfiguration": { - "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarderParameters", + "lifecycleApiAutomationCompositionConfiguration": { + "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiAutomationCompositionForwarderParameters", "parameters": { - "controlLoopRuntimeParameters": { - "clientName": "policy-clamp-cl-runtime", - "hostname": "policy-clamp-cl-runtime", + "automationCompositionRuntimeParameters": { + "clientName": "policy-clamp-runtime-acm", + "hostname": "policy-clamp-runtime-acm", "port": 6969, "useHttps": true, "userName": "policyadmin", diff --git a/packages/policy-distribution-tarball/src/main/resources/etc/s3pConfig.json b/packages/policy-distribution-tarball/src/main/resources/etc/s3pConfig.json index cea48547..2a057c80 100644 --- a/packages/policy-distribution-tarball/src/main/resources/etc/s3pConfig.json +++ b/packages/policy-distribution-tarball/src/main/resources/etc/s3pConfig.json @@ -18,10 +18,10 @@ "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.PolicyDecoderFileInCsarToPolicy", "decoderConfigurationName": "toscaPolicyDecoderConfiguration" }, - "ToscaControlLoopDecoder": { - "decoderType": "ToscaControlLoopDecoder", - "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsar", - "decoderConfigurationName": "toscaControlLoopDecoderConfiguration" + "ToscaAutomationCompositionDecoder": { + "decoderType": "ToscaAutomationCompositionDecoder", + "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.AutomationCompositionDecoderFileInCsar", + "decoderConfigurationName": "toscaAutomationCompositionDecoderConfiguration" } }, "policyForwarders": { @@ -30,10 +30,10 @@ "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiPolicyForwarder", "forwarderConfigurationName": "lifecycleApiPolicyConfiguration" }, - "LifeCycleApiControlLoopForwarder": { - "forwarderType": "LifeCycleControlLoopAPI", - "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarder", - "forwarderConfigurationName": "lifecycleApiControlLoopConfiguration" + "LifeCycleApiAutomationCompositionForwarder": { + "forwarderType": "LifeCycleAutomationCompositionAPI", + "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiAutomationCompositionForwarder", + "forwarderConfigurationName": "lifecycleApiAutomationCompositionConfiguration" } } } @@ -55,10 +55,10 @@ "policyTypeFileName": "tosca_policy_type" } }, - "toscaControlLoopDecoderConfiguration": { - "parameterClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsarParameterGroup", + "toscaAutomationCompositionDecoderConfiguration": { + "parameterClassName": "org.onap.policy.distribution.reception.decoding.policy.file.AutomationCompositionDecoderFileInCsarParameterGroup", "parameters": { - "controlLoopType": "controlloop" + "automationCompositionType": "acm" } } }, @@ -85,12 +85,12 @@ "deployPolicies": true } }, - "lifecycleApiControlLoopConfiguration": { - "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarderParameters", + "lifecycleApiAutomationCompositionConfiguration": { + "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiAutomationCompositionForwarderParameters", "parameters": { - "controlLoopRuntimeParameters": { - "clientName": "policy-clamp-cl-runtime", - "hostname": "policy-clamp-cl-runtime", + "automationCompositionRuntimeParameters": { + "clientName": "policy-clamp-runtime-acm", + "hostname": "policy-clamp-runtime-acm", "port": 6969, "useHttps": true, "userName": "policyadmin", diff --git a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiControlLoopForwarder.java b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiAutomationCompositionForwarder.java index 605c68cd..99615f50 100644 --- a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiControlLoopForwarder.java +++ b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiAutomationCompositionForwarder.java @@ -43,17 +43,17 @@ import org.slf4j.LoggerFactory; /** * This class provides an implementation of {@link PolicyForwarder} interface for forwarding the - * controlloop design template to the life cycle api's of controlloop components. + * automationComposition design template to the life cycle api's of automationComposition components. * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ -public class LifecycleApiControlLoopForwarder implements PolicyForwarder { +public class LifecycleApiAutomationCompositionForwarder implements PolicyForwarder { - private static final String COMMISSION_CONTROLLOOP_URI = "/onap/controlloop/v2/commission"; - private static final Logger LOGGER = LoggerFactory.getLogger(LifecycleApiControlLoopForwarder.class); + private static final String COMMISSION_AUTOMATION_COMPOSITION_URI = "/onap/acm/v2/commission"; + private static final Logger LOGGER = LoggerFactory.getLogger(LifecycleApiAutomationCompositionForwarder.class); - private LifecycleApiControlLoopForwarderParameters forwarderParameters; - private HttpClient controlLoopClient; + private LifecycleApiAutomationCompositionForwarderParameters forwarderParameters; + private HttpClient automationCompositionClient; /** * {@inheritDoc}. @@ -62,8 +62,8 @@ public class LifecycleApiControlLoopForwarder implements PolicyForwarder { public void configure(final String parameterGroupName) throws HttpClientConfigException { forwarderParameters = ParameterService.get(parameterGroupName); - controlLoopClient = HttpClientFactoryInstance.getClientFactory().build( - forwarderParameters.getControlLoopRuntimeParameters()); + automationCompositionClient = HttpClientFactoryInstance.getClientFactory().build( + forwarderParameters.getAutomationCompositionRuntimeParameters()); } /** @@ -88,7 +88,7 @@ public class LifecycleApiControlLoopForwarder implements PolicyForwarder { if (null != toscaServiceTemplate.getToscaTopologyTemplate() && null != toscaServiceTemplate.getNodeTypes() && null != toscaServiceTemplate.getDataTypes()) { - commissionControlLoop(toscaServiceTemplate); + commissionAutomationComposition(toscaServiceTemplate); } } else { throw new PolicyForwardingException("The entity is not of type ToscaServiceTemplate - " + entity); @@ -99,15 +99,15 @@ public class LifecycleApiControlLoopForwarder implements PolicyForwarder { } } - private Response commissionControlLoop(final ToscaServiceTemplate toscaServiceTemplate) + private Response commissionAutomationComposition(final ToscaServiceTemplate toscaServiceTemplate) throws PolicyForwardingException { return invokeHttpClient(Entity.entity(toscaServiceTemplate, MediaType.APPLICATION_JSON), - COMMISSION_CONTROLLOOP_URI); + COMMISSION_AUTOMATION_COMPOSITION_URI); } private Response invokeHttpClient(final Entity<?> entity, final String path) throws PolicyForwardingException { - var response = controlLoopClient.post(path, entity, Map.of(HttpHeaders.ACCEPT, + var response = automationCompositionClient.post(path, entity, Map.of(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON, HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON)); if (response.getStatus() / 100 != 2) { LOGGER.error( diff --git a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiControlLoopForwarderParameters.java b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiAutomationCompositionForwarderParameters.java index d1abce71..be7c5263 100644 --- a/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiControlLoopForwarderParameters.java +++ b/plugins/forwarding-plugins/src/main/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiAutomationCompositionForwarderParameters.java @@ -29,19 +29,20 @@ import org.onap.policy.common.parameters.annotations.Valid; import org.onap.policy.distribution.main.parameters.PolicyForwarderConfigurationParameterGroup; /** - * Holds the parameters for the {@link LifecycleApiControlLoopForwarder}. + * Holds the parameters for the {@link LifecycleApiAutomationCompositionForwarder}. * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ @Getter @NotNull @NotBlank -public class LifecycleApiControlLoopForwarderParameters extends PolicyForwarderConfigurationParameterGroup { - public static final String CONTROLLOOP_FORWARDER_PLUGIN_CLASS = LifecycleApiControlLoopForwarder.class.getName(); +public class LifecycleApiAutomationCompositionForwarderParameters extends PolicyForwarderConfigurationParameterGroup { + public static final String AUTOMATION_COMPOSITION_FORWARDER_PLUGIN_CLASS = + LifecycleApiAutomationCompositionForwarder.class.getName(); - private @Valid RestClientParameters controlLoopRuntimeParameters; + private @Valid RestClientParameters automationCompositionRuntimeParameters; - public LifecycleApiControlLoopForwarderParameters() { - super(LifecycleApiControlLoopForwarderParameters.class.getSimpleName()); + public LifecycleApiAutomationCompositionForwarderParameters() { + super(LifecycleApiAutomationCompositionForwarderParameters.class.getSimpleName()); } } diff --git a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiControlLoopForwarderParametersTest.java b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiAutomationCompositionForwarderParametersTest.java index ba8d9bfb..2ad522fb 100644 --- a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiControlLoopForwarderParametersTest.java +++ b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiAutomationCompositionForwarderParametersTest.java @@ -31,37 +31,37 @@ import org.onap.policy.common.parameters.ValidationStatus; import org.onap.policy.distribution.forwarding.testclasses.CommonTestData; /** - * Class to perform unit test of {@link LifecycleApiControlLoopForwarderParameters}. + * Class to perform unit test of {@link LifecycleApiAutomationCompositionForwarderParameters}. * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ -public class LifecycleApiControlLoopForwarderParametersTest { +public class LifecycleApiAutomationCompositionForwarderParametersTest { - private static final String CONTROLLOOP_RUNTIME_HOST_NAME = "0.0.0.0"; - private static final int CONTROLLOOP_RUNTIME_PORT = 6969; - private static final String CONTROLLOOP_RUNTIME_USER = "policyadmin"; - private static final String CONTROLLOOP_RUNTIME_PASSWORD = "zb!XztG34"; + private static final String AUTOMATION_COMPOSITION_RUNTIME_HOST_NAME = "0.0.0.0"; + private static final int AUTOMATION_COMPOSITION_RUNTIME_PORT = 6969; + private static final String AUTOMATION_COMPOSITION_RUNTIME_USER = "policyadmin"; + private static final String AUTOMATION_COMPOSITION_RUNTIME_PASSWORD = "zb!XztG34"; @Test public void testValidParameters() { - final LifecycleApiControlLoopForwarderParameters configurationParameters = + final LifecycleApiAutomationCompositionForwarderParameters configurationParameters = CommonTestData.getPolicyForwarderParameters( - "src/test/resources/parameters/LifecycleApiControlLoopForwarderParameters.json", - LifecycleApiControlLoopForwarderParameters.class); + "src/test/resources/parameters/LifecycleApiAutomationCompositionForwarderParameters.json", + LifecycleApiAutomationCompositionForwarderParameters.class); - assertEquals(LifecycleApiControlLoopForwarderParameters.class.getSimpleName(), + assertEquals(LifecycleApiAutomationCompositionForwarderParameters.class.getSimpleName(), configurationParameters.getName()); - assertEquals(CONTROLLOOP_RUNTIME_HOST_NAME, - configurationParameters.getControlLoopRuntimeParameters().getHostname()); - assertEquals(CONTROLLOOP_RUNTIME_PORT, - configurationParameters.getControlLoopRuntimeParameters().getPort()); - assertFalse(configurationParameters.getControlLoopRuntimeParameters().isUseHttps()); - assertEquals(CONTROLLOOP_RUNTIME_USER, - configurationParameters.getControlLoopRuntimeParameters().getUserName()); - assertEquals(CONTROLLOOP_RUNTIME_PASSWORD, - configurationParameters.getControlLoopRuntimeParameters().getPassword()); + assertEquals(AUTOMATION_COMPOSITION_RUNTIME_HOST_NAME, + configurationParameters.getAutomationCompositionRuntimeParameters().getHostname()); + assertEquals(AUTOMATION_COMPOSITION_RUNTIME_PORT, + configurationParameters.getAutomationCompositionRuntimeParameters().getPort()); + assertFalse(configurationParameters.getAutomationCompositionRuntimeParameters().isUseHttps()); + assertEquals(AUTOMATION_COMPOSITION_RUNTIME_USER, + configurationParameters.getAutomationCompositionRuntimeParameters().getUserName()); + assertEquals(AUTOMATION_COMPOSITION_RUNTIME_PASSWORD, + configurationParameters.getAutomationCompositionRuntimeParameters().getPassword()); assertThat(configurationParameters.validate().getResult()).isNull(); assertEquals(ValidationStatus.CLEAN, configurationParameters.validate().getStatus()); diff --git a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiControlLoopForwarderTest.java b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiAutomationCompositionForwarderTest.java index 047482ef..672cb6bf 100644 --- a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiControlLoopForwarderTest.java +++ b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/lifecycle/api/LifecycleApiAutomationCompositionForwarderTest.java @@ -37,20 +37,22 @@ import org.onap.policy.common.utils.network.NetworkUtil; import org.onap.policy.common.utils.resources.ResourceUtils; import org.onap.policy.distribution.forwarding.PolicyForwardingException; import org.onap.policy.distribution.forwarding.testclasses.CommonTestData; -import org.onap.policy.distribution.forwarding.testclasses.LifecycleApiControlLoopSimulatorMain; +import org.onap.policy.distribution.forwarding.testclasses.LifecycleApiAutomationCompositionSimulatorMain; import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; /** - * Class to perform unit test of {@link LifecycleApiControlLoopForwarder}. + * Class to perform unit test of {@link LifecycleApiAutomationCompositionForwarder}. * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ -public class LifecycleApiControlLoopForwarderTest { +public class LifecycleApiAutomationCompositionForwarderTest { - private static final String CONTROL_LOOP = "src/test/resources/parameters/sample_control_loop.json"; + private static final String AUTOMATION_COMPOSITION = + "src/test/resources/parameters/sample_automation_composition.json"; private final StandardCoder standardCoder = new StandardCoder(); - private static final LifecycleApiControlLoopSimulatorMain simulator = new LifecycleApiControlLoopSimulatorMain(); + private static final LifecycleApiAutomationCompositionSimulatorMain simulator = + new LifecycleApiAutomationCompositionSimulatorMain(); /** * Set up. @@ -62,8 +64,8 @@ public class LifecycleApiControlLoopForwarderTest { @BeforeClass public static void setUp() throws PolicyForwardingException, CoderException, InterruptedException { final ParameterGroup parameterGroup = CommonTestData.getPolicyForwarderParameters( - "src/test/resources/parameters/LifecycleApiControlLoopForwarderParameters.json", - LifecycleApiControlLoopForwarderParameters.class); + "src/test/resources/parameters/LifecycleApiAutomationCompositionForwarderParameters.json", + LifecycleApiAutomationCompositionForwarderParameters.class); ParameterService.register(parameterGroup); simulator.startLifecycycleApiSimulator(); if (!NetworkUtil.isTcpPortOpen("0.0.0.0", 6969, 50, 200L)) { @@ -76,40 +78,42 @@ public class LifecycleApiControlLoopForwarderTest { */ @AfterClass public static void tearDown() { - ParameterService.deregister(LifecycleApiControlLoopForwarderParameters.class.getSimpleName()); + ParameterService.deregister(LifecycleApiAutomationCompositionForwarderParameters.class.getSimpleName()); simulator.stopLifecycycleApiSimulator(); } @Test - public void testForwardControlLoopUsingSimulator() throws Exception { + public void testForwardAutomationCompositionUsingSimulator() throws Exception { assertThatCode(() -> { - final ToscaServiceTemplate toscaServiceTemplate = - standardCoder.decode(ResourceUtils.getResourceAsString(CONTROL_LOOP), ToscaServiceTemplate.class); + final ToscaServiceTemplate toscaServiceTemplate = standardCoder.decode( + ResourceUtils.getResourceAsString(AUTOMATION_COMPOSITION), ToscaServiceTemplate.class); - final LifecycleApiControlLoopForwarder forwarder = new LifecycleApiControlLoopForwarder(); - forwarder.configure(LifecycleApiControlLoopForwarderParameters.class.getSimpleName()); + final LifecycleApiAutomationCompositionForwarder forwarder = + new LifecycleApiAutomationCompositionForwarder(); + forwarder.configure(LifecycleApiAutomationCompositionForwarderParameters.class.getSimpleName()); - final Collection<ToscaEntity> controlLoopList = new ArrayList<>(); - controlLoopList.add(toscaServiceTemplate); + final Collection<ToscaEntity> automationCompositionList = new ArrayList<>(); + automationCompositionList.add(toscaServiceTemplate); - forwarder.forward(controlLoopList); + forwarder.forward(automationCompositionList); }).doesNotThrowAnyException(); } @Test - public void testForwardControlLoopFailureUsingSimulator() throws Exception { + public void testForwardAutomationCompositionFailureUsingSimulator() throws Exception { final ToscaEntity toscaEntity = new ToscaEntity(); toscaEntity.setName("FailureCase"); - final LifecycleApiControlLoopForwarder forwarder = new LifecycleApiControlLoopForwarder(); - forwarder.configure(LifecycleApiControlLoopForwarderParameters.class.getSimpleName()); + final LifecycleApiAutomationCompositionForwarder forwarder = new LifecycleApiAutomationCompositionForwarder(); + forwarder.configure(LifecycleApiAutomationCompositionForwarderParameters.class.getSimpleName()); - final Collection<ToscaEntity> controlLoopList = new ArrayList<>(); - controlLoopList.add(toscaEntity); + final Collection<ToscaEntity> automationCompositionList = new ArrayList<>(); + automationCompositionList.add(toscaEntity); - assertThatThrownBy(() -> forwarder.forward(controlLoopList)).isInstanceOf(PolicyForwardingException.class) + assertThatThrownBy(() -> forwarder.forward(automationCompositionList)) + .isInstanceOf(PolicyForwardingException.class) .hasMessageContaining("Failed forwarding the following entities:"); } } diff --git a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycleApiControlLoopSimulatorEndpoint.java b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycleApiAutomationCompositionSimulatorEndpoint.java index d361d166..00b017ba 100644 --- a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycleApiControlLoopSimulatorEndpoint.java +++ b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycleApiAutomationCompositionSimulatorEndpoint.java @@ -30,25 +30,25 @@ import javax.ws.rs.core.Response; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; /** - * Class to provide rest end points for LifecycleApiControlLoopSimulator. + * Class to provide rest end points for LifecycleApiAutomationCompositionSimulator. * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ @Path("/onap") @Produces(MediaType.APPLICATION_JSON) -public class LifecycleApiControlLoopSimulatorEndpoint { +public class LifecycleApiAutomationCompositionSimulatorEndpoint { /** - * ControlLoop commissioning end-point. + * AutomationComposition commissioning end-point. * * @param body the post body * @return the response object */ @POST - @Path("/controlloop/v2/commission") + @Path("/acm/v2/commission") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) - public Response commissionControlLoop(final ToscaServiceTemplate body) { + public Response commissionAutomationComposition(final ToscaServiceTemplate body) { return Response.status(Response.Status.OK).entity(body).build(); } } diff --git a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycleApiControlLoopSimulatorMain.java b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycleApiAutomationCompositionSimulatorMain.java index a60fda1d..98615af0 100644 --- a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycleApiControlLoopSimulatorMain.java +++ b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycleApiAutomationCompositionSimulatorMain.java @@ -27,15 +27,15 @@ import org.onap.policy.common.utils.coder.CoderException; import org.onap.policy.common.utils.coder.StandardCoder; import org.onap.policy.common.utils.resources.ResourceUtils; import org.onap.policy.distribution.forwarding.PolicyForwardingException; -import org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarder; +import org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiAutomationCompositionForwarder; import org.onap.policy.distribution.main.rest.aaf.AafDistributionFilter; /** - * The class for starting/stopping simulator for testing {@link LifecycleApiControlLoopForwarder} . + * The class for starting/stopping simulator for testing {@link LifecycleApiAutomationCompositionForwarder} . * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ -public class LifecycleApiControlLoopSimulatorMain { +public class LifecycleApiAutomationCompositionSimulatorMain { private RestServer restServer; /** @@ -50,7 +50,7 @@ public class LifecycleApiControlLoopSimulatorMain { ResourceUtils.getResourceAsString("src/test/resources/parameters/RestServerParameters.json"), RestServerParameters.class); restServer = new RestServer(restServerParameters, AafDistributionFilter.class, - LifecycleApiControlLoopSimulatorEndpoint.class); + LifecycleApiAutomationCompositionSimulatorEndpoint.class); if (!restServer.start()) { throw new PolicyForwardingException("Failed to start rest simulator. Check log for more details..."); } diff --git a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycycleApiSimulatorEndpoint.java b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycycleApiSimulatorEndpoint.java index 4a881cb0..22aeff2f 100644 --- a/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycycleApiSimulatorEndpoint.java +++ b/plugins/forwarding-plugins/src/test/java/org/onap/policy/distribution/forwarding/testclasses/LifecycycleApiSimulatorEndpoint.java @@ -71,7 +71,7 @@ public class LifecycycleApiSimulatorEndpoint { public Response createPolicies(@PathParam("policyTypeId") final String policyTypeId, @PathParam("policyTypeVersion") final String policyTypeVersion, @ApiParam(value = "Entity body of policy", required = true) final ToscaServiceTemplate body) { - if ("onap.policies.controlloop.operational.ApexFailure".equals(policyTypeId)) { + if ("onap.policies.acm.operational.ApexFailure".equals(policyTypeId)) { return Response.status(Response.Status.NOT_FOUND).build(); } else { return Response.status(Response.Status.OK).entity(body).build(); diff --git a/plugins/forwarding-plugins/src/test/resources/parameters/LifecycleApiControlLoopForwarderParameters.json b/plugins/forwarding-plugins/src/test/resources/parameters/LifecycleApiAutomationCompositionForwarderParameters.json index 1eef9773..d9d6dbb1 100644 --- a/plugins/forwarding-plugins/src/test/resources/parameters/LifecycleApiControlLoopForwarderParameters.json +++ b/plugins/forwarding-plugins/src/test/resources/parameters/LifecycleApiAutomationCompositionForwarderParameters.json @@ -1,6 +1,6 @@ { - "controlLoopRuntimeParameters": { - "clientName": "policy-clamp-cl-runtime", + "automationCompositionRuntimeParameters": { + "clientName": "policy-clamp-runtime-acm", "hostname": "0.0.0.0", "port": 6969, "useHttps": false, diff --git a/plugins/forwarding-plugins/src/test/resources/parameters/LifecycleApiControlLoopForwarderParametersInvalid.json b/plugins/forwarding-plugins/src/test/resources/parameters/LifecycleApiAutomationCompositionForwarderParametersInvalid.json index 5ac0c4ee..a98d2827 100644 --- a/plugins/forwarding-plugins/src/test/resources/parameters/LifecycleApiControlLoopForwarderParametersInvalid.json +++ b/plugins/forwarding-plugins/src/test/resources/parameters/LifecycleApiAutomationCompositionForwarderParametersInvalid.json @@ -1,6 +1,6 @@ { - "controlLoopRuntimeParameters": { - "clientName": "policy-clamp-cl-runtime", + "automationCompositionRuntimeParameters": { + "clientName": "policy-clamp-runtime-acm", "hostname": "", "port": 6969, "useHttps": false, diff --git a/plugins/forwarding-plugins/src/test/resources/parameters/sample_control_loop.json b/plugins/forwarding-plugins/src/test/resources/parameters/sample_automation_composition.json index 20dedc50..32e62335 100644 --- a/plugins/forwarding-plugins/src/test/resources/parameters/sample_control_loop.json +++ b/plugins/forwarding-plugins/src/test/resources/parameters/sample_automation_composition.json @@ -14,9 +14,9 @@ } } }, - "onap.datatype.controlloop.Target": { + "onap.datatype.acm.Target": { "derived_from": "tosca.datatypes.Root", - "description": "Definition for a entity in A&AI to perform a control loop operation on", + "description": "Definition for a entity in A&AI to perform a acm operation on", "properties": { "targetType": { "type": "string", @@ -46,7 +46,7 @@ } } }, - "onap.datatype.controlloop.Actor": { + "onap.datatype.acm.Actor": { "derived_from": "tosca.datatypes.Root", "description": "An actor/operation/target definition", "properties": { @@ -67,7 +67,7 @@ "required": true }, "target": { - "type": "onap.datatype.controlloop.Target", + "type": "onap.datatype.acm.Target", "description": "The resource the operation should be performed on.", "required": true }, @@ -84,7 +84,7 @@ } } }, - "onap.datatype.controlloop.Operation": { + "onap.datatype.acm.Operation": { "derived_from": "tosca.datatypes.Root", "description": "An operation supported by an actor", "properties": { @@ -99,7 +99,7 @@ "required": false }, "operation": { - "type": "onap.datatype.controlloop.Actor", + "type": "onap.datatype.acm.Actor", "description": "The definition of the operation to be performed.", "required": true }, @@ -439,7 +439,7 @@ "derived_from": "tosca.datatypes.Root", "metadata": {} }, - "org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest": { + "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest": { "version": "1.0.0", "derived_from": "tosca.datatypes.Root", "properties": { @@ -481,7 +481,7 @@ "description": "THe expected HTTP status code for the REST request" } }, - "org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.ConfigurationEntity": { + "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity": { "version": "1.0.0", "derived_from": "tosca.datatypes.Root", "properties": { @@ -489,12 +489,12 @@ "type": "onap.datatypes.ToscaConceptIdentifier", "typeVersion": "1.0.0", "required": true, - "description": "The name and version of a Configuration Entity to be handled by the HTTP Control Loop Element" + "description": "The name and version of a Configuration Entity to be handled by the HTTP Automation Composition Element" }, "restSequence": { "type": "list", "entry_schema": { - "type": "org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.RestRequest", + "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.RestRequest", "typeVersion": "1.0.0" }, "description": "A sequence of REST commands to send to the REST endpoint" @@ -504,7 +504,7 @@ } }, "node_types": { - "org.onap.policy.clamp.controlloop.Participant": { + "org.onap.policy.clamp.acm.Participant": { "version": "1.0.1", "derived_from": "tosca.nodetypes.Root", "properties": { @@ -514,7 +514,7 @@ } } }, - "org.onap.policy.clamp.controlloop.ControlLoopElement": { + "org.onap.policy.clamp.acm.AutomationCompositionElement": { "version": "1.0.1", "derived_from": "tosca.nodetypes.Root", "properties": { @@ -524,7 +524,7 @@ "metadata": { "common": true }, - "description": "Specifies the organization that provides the control loop element" + "description": "Specifies the organization that provides the acm element" }, "participant_id": { "type": "onap.datatypes.ToscaConceptIdentifier", @@ -539,7 +539,7 @@ "metadata": { "common": true }, - "description": "The identity of the participant type that hosts this type of Control Loop Element" + "description": "The identity of the participant type that hosts this type of Automation Composition Element" }, "startPhase": { "type": "integer", @@ -552,7 +552,7 @@ "metadata": { "common": true }, - "description": "A value indicating the start phase in which this control loop element will be started, the first start phase is zero. Control Loop Elements are started in their start_phase order and stopped in reverse start phase order. Control Loop Elements with the same start phase are started and stopped simultaneously" + "description": "A value indicating the start phase in which this acm element will be started, the first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped in reverse start phase order. Automation Composition Elements with the same start phase are started and stopped simultaneously" }, "uninitializedToPassiveTimeout": { "type": "integer", @@ -612,7 +612,7 @@ } } }, - "org.onap.policy.clamp.controlloop.ControlLoop": { + "org.onap.policy.clamp.acm.AutomationComposition": { "version": "1.0.1", "derived_from": "tosca.nodetypes.Root", "properties": { @@ -622,7 +622,7 @@ "metadata": { "common": true }, - "description": "Specifies the organization that provides the control loop element" + "description": "Specifies the organization that provides the acm element" }, "elements": { "type": "list", @@ -633,13 +633,13 @@ "entry_schema": { "type": "onap.datatypes.ToscaConceptIdentifier" }, - "description": "Specifies a list of control loop element definitions that make up this control loop definition" + "description": "Specifies a list of acm element definitions that make up this acm definition" } } }, - "org.onap.policy.clamp.controlloop.PolicyControlLoopElement": { + "org.onap.policy.clamp.acm.PolicyAutomationCompositionElement": { "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement", + "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement", "properties": { "policy_type_id": { "type": "onap.datatypes.ToscaConceptIdentifier", @@ -651,9 +651,9 @@ } } }, - "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement": { + "org.onap.policy.clamp.acm.DerivedPolicyAutomationCompositionElement": { "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", + "derived_from": "org.onap.policy.clamp.acm.PolicyAutomationCompositionElement", "properties": { "policy_type_id": { "type": "onap.datatypes.ToscaConceptIdentifier", @@ -665,9 +665,9 @@ } } }, - "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement": { + "org.onap.policy.clamp.acm.DerivedDerivedPolicyAutomationCompositionElement": { "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", + "derived_from": "org.onap.policy.clamp.acm.DerivedPolicyAutomationCompositionElement", "properties": { "policy_type_id": { "type": "onap.datatypes.ToscaConceptIdentifier", @@ -679,9 +679,9 @@ } } }, - "org.onap.policy.clamp.controlloop.CDSControlLoopElement": { + "org.onap.policy.clamp.acm.CDSAutomationCompositionElement": { "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement", + "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement", "properties": { "cds_blueprint_id": { "type": "onap.datatypes.ToscaConceptIdentifier", @@ -689,9 +689,9 @@ } } }, - "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement": { + "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement": { "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement", + "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement", "properties": { "chart": { "type": "string", @@ -716,9 +716,9 @@ } } }, - "org.onap.policy.clamp.controlloop.HttpControlLoopElement": { + "org.onap.policy.clamp.acm.HttpAutomationCompositionElement": { "version": "1.0.1", - "derived_from": "org.onap.policy.clamp.controlloop.ControlLoopElement", + "derived_from": "org.onap.policy.clamp.acm.AutomationCompositionElement", "properties": { "baseUrl": { "type": "string", @@ -737,10 +737,10 @@ "type": "map", "required": true, "entry_schema": { - "type": "org.onap.datatypes.policy.clamp.controlloop.httpControlLoopElement.ConfigurationEntity", + "type": "org.onap.datatypes.policy.clamp.acm.httpAutomationCompositionElement.ConfigurationEntity", "typeVersion": "1.0.0" }, - "description": "The connfiguration entities the Control Loop Element is managing and their associated REST requests" + "description": "The connfiguration entities the Automation Composition Element is managing and their associated REST requests" } } } @@ -765,20 +765,20 @@ } }, "node_templates": { - "org.onap.policy.controlloop.PolicyControlLoopParticipant": { + "org.onap.policy.acm.PolicyAutomationCompositionParticipant": { "version": "2.3.1", - "type": "org.onap.policy.clamp.controlloop.Participant", + "type": "org.onap.policy.clamp.acm.Participant", "type_version": "1.0.1", "description": "Participant for DCAE microservices", "properties": { "provider": "ONAP" } }, - "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement": { + "org.onap.domain.pmsh.PMSH_MonitoringPolicyAutomationCompositionElement": { "version": "1.2.3", - "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", + "type": "org.onap.policy.clamp.acm.PolicyAutomationCompositionElement", "type_version": "1.0.0", - "description": "Control loop element for the monitoring policy for Performance Management Subscription Handling", + "description": "Automation Composition element for the monitoring policy for Performance Management Subscription Handling", "properties": { "provider": "Ericsson", "participant_id": { @@ -786,7 +786,7 @@ "version": "1.0.0" }, "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", + "name": "org.onap.policy.acm.PolicyAutomationCompositionParticipant", "version": "2.3.1" }, "policy_type_id": { @@ -798,11 +798,11 @@ } } }, - "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement": { + "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement": { "version": "1.2.3", - "type": "org.onap.policy.clamp.controlloop.PolicyControlLoopElement", + "type": "org.onap.policy.clamp.acm.PolicyAutomationCompositionElement", "type_version": "1.0.0", - "description": "Control loop element for the operational policy for Performance Management Subscription Handling", + "description": "Automation Composition element for the operational policy for Performance Management Subscription Handling", "properties": { "provider": "Ericsson", "participant_id": { @@ -810,7 +810,7 @@ "version": "1.0.0" }, "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", + "name": "org.onap.policy.acm.PolicyAutomationCompositionParticipant", "version": "2.3.1" }, "policy_type_id": { @@ -822,15 +822,15 @@ } } }, - "org.onap.domain.pmsh.DerivedPolicyControlLoopElement": { + "org.onap.domain.pmsh.DerivedPolicyAutomationCompositionElement": { "version": "1.2.3", - "type": "org.onap.policy.clamp.controlloop.DerivedPolicyControlLoopElement", + "type": "org.onap.policy.clamp.acm.DerivedPolicyAutomationCompositionElement", "type_version": "1.0.0", - "description": "Control loop for Performance Management Subscription Handling", + "description": "Automation Composition for Performance Management Subscription Handling", "properties": { "provider": "Ericsson", "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", + "name": "org.onap.policy.acm.PolicyAutomationCompositionParticipant", "version": "2.3.1" }, "participant_id": { @@ -839,15 +839,15 @@ } } }, - "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement": { + "org.onap.domain.pmsh.DerivedDerivedPolicyAutomationCompositionElement": { "version": "1.2.3", - "type": "org.onap.policy.clamp.controlloop.DerivedDerivedPolicyControlLoopElement", + "type": "org.onap.policy.clamp.acm.DerivedDerivedPolicyAutomationCompositionElement", "type_version": "1.0.0", - "description": "Control loop for Performance Management Subscription Handling", + "description": "Automation Composition for Performance Management Subscription Handling", "properties": { "provider": "Ericsson", "participantType": { - "name": "org.onap.policy.controlloop.PolicyControlLoopParticipant", + "name": "org.onap.policy.acm.PolicyAutomationCompositionParticipant", "version": "2.3.1" }, "participant_id": { @@ -856,20 +856,20 @@ } } }, - "org.onap.k8s.controlloop.K8SControlLoopParticipant": { + "org.onap.k8s.acm.K8SAutomationCompositionParticipant": { "version": "2.3.4", - "type": "org.onap.policy.clamp.controlloop.Participant", + "type": "org.onap.policy.clamp.acm.Participant", "type_version": "1.0.1", "description": "Participant for K8S", "properties": { "provider": "ONAP" } }, - "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement": { + "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement": { "version": "1.2.3", - "type": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", + "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement", "type_version": "1.0.0", - "description": "Control loop element for the K8S microservice for PMSH", + "description": "Automation Composition element for the K8S microservice for PMSH", "properties": { "provider": "ONAP", "participant_id": { @@ -877,7 +877,7 @@ "version": "1.0.0" }, "participantType": { - "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant", + "name": "org.onap.k8s.acm.K8SAutomationCompositionParticipant", "version": "2.3.4" }, "chart": { @@ -901,11 +901,11 @@ } } }, - "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement": { + "org.onap.domain.database.Local_K8SMicroserviceAutomationCompositionElement": { "version": "1.2.3", - "type": "org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement", + "type": "org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement", "type_version": "1.0.0", - "description": "Control loop element for the K8S microservice for local chart", + "description": "Automation Composition element for the K8S microservice for local chart", "properties": { "provider": "ONAP", "participant_id": { @@ -913,7 +913,7 @@ "version": "1.0.0" }, "participantType": { - "name": "org.onap.k8s.controlloop.K8SControlLoopParticipant", + "name": "org.onap.k8s.acm.K8SAutomationCompositionParticipant", "version": "2.3.4" }, "chart": { @@ -926,20 +926,20 @@ } } }, - "org.onap.controlloop.HttpControlLoopParticipant": { + "org.onap.acm.HttpAutomationCompositionParticipant": { "version": "2.3.4", - "type": "org.onap.policy.clamp.controlloop.Participant", + "type": "org.onap.policy.clamp.acm.Participant", "type_version": "1.0.1", "description": "Participant for Http requests", "properties": { "provider": "ONAP" } }, - "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement": { + "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement": { "version": "1.2.3", - "type": "org.onap.policy.clamp.controlloop.HttpControlLoopElement", + "type": "org.onap.policy.clamp.acm.HttpAutomationCompositionElement", "type_version": "1.0.1", - "description": "Control loop element for the http requests of PMSH microservice", + "description": "Automation Composition element for the http requests of PMSH microservice", "properties": { "provider": "ONAP", "participant_id": { @@ -947,7 +947,7 @@ "version": "1.0.0" }, "participantType": { - "name": "org.onap.k8s.controlloop.HttpControlLoopParticipant", + "name": "org.onap.k8s.acm.HttpAutomationCompositionParticipant", "version": "2.3.4" }, "uninitializedToPassiveTimeout": 180, @@ -970,7 +970,7 @@ }, "httpMethod": "PUT", "path": "v1/kv/dcae-pmsh2", - "body": "{ \"control_loop_name\":\"pmsh-control-loop\", \"operational_policy_name\":\"pmsh-operational-policy\", \"aaf_password\":\"demo123456!\", \"aaf_identity\":\"dcae@dcae.onap.org\", \"cert_path\":\"/opt/app/pmsh/etc/certs/cert.pem\", \"key_path\":\"/opt/app/pmsh/etc/certs/key.pem\", \"ca_cert_path\":\"/opt/app/pmsh/etc/certs/cacert.pem\", \"enable_tls\":\"true\", \"pmsh_policy\":{ \"subscription\":{ \"subscriptionName\":\"ExtraPM-All-gNB-R2B\", \"administrativeState\":\"UNLOCKED\", \"fileBasedGP\":15, \"fileLocation\":\"\\/pm\\/pm.xml\", \"nfFilter\":{ \"nfNames\":[ \"^pnf.*\", \"^vnf.*\" ], \"modelInvariantIDs\":[ ], \"modelVersionIDs\":[ ], \"modelNames\":[ ] }, \"measurementGroups\":[ { \"measurementGroup\":{ \"measurementTypes\":[ { \"measurementType\":\"countera\" }, { \"measurementType\":\"counterb\" } ], \"managedObjectDNsBasic\":[ { \"DN\":\"dna\" }, { \"DN\":\"dnb\" } ] } }, { \"measurementGroup\":{ \"measurementTypes\":[ { \"measurementType\":\"counterc\" }, { \"measurementType\":\"counterd\" } ], \"managedObjectDNsBasic\":[ { \"DN\":\"dnc\" }, { \"DN\":\"dnd\" } ] } } ] } }, \"streams_subscribes\":{ \"aai_subscriber\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/AAI_EVENT\", \"client_role\":\"org.onap.dcae.aaiSub\", \"location\":\"san-francisco\", \"client_id\":\"1575976809466\" } }, \"policy_pm_subscriber\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS\", \"client_role\":\"org.onap.dcae.pmSubscriber\", \"location\":\"san-francisco\", \"client_id\":\"1575876809456\" } } }, \"streams_publishes\":{ \"policy_pm_publisher\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS\", \"client_role\":\"org.onap.dcae.pmPublisher\", \"location\":\"san-francisco\", \"client_id\":\"1475976809466\" } }, \"other_publisher\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/org.onap.dmaap.mr.SOME_OTHER_TOPIC\", \"client_role\":\"org.onap.dcae.pmControlPub\", \"location\":\"san-francisco\", \"client_id\":\"1875976809466\" } } } }", + "body": "{ \"automation_composition_name\":\"pmsh-automation_composition\", \"operational_policy_name\":\"pmsh-operational-policy\", \"aaf_password\":\"demo123456!\", \"aaf_identity\":\"dcae@dcae.onap.org\", \"cert_path\":\"/opt/app/pmsh/etc/certs/cert.pem\", \"key_path\":\"/opt/app/pmsh/etc/certs/key.pem\", \"ca_cert_path\":\"/opt/app/pmsh/etc/certs/cacert.pem\", \"enable_tls\":\"true\", \"pmsh_policy\":{ \"subscription\":{ \"subscriptionName\":\"ExtraPM-All-gNB-R2B\", \"administrativeState\":\"UNLOCKED\", \"fileBasedGP\":15, \"fileLocation\":\"\\/pm\\/pm.xml\", \"nfFilter\":{ \"nfNames\":[ \"^pnf.*\", \"^vnf.*\" ], \"modelInvariantIDs\":[ ], \"modelVersionIDs\":[ ], \"modelNames\":[ ] }, \"measurementGroups\":[ { \"measurementGroup\":{ \"measurementTypes\":[ { \"measurementType\":\"countera\" }, { \"measurementType\":\"counterb\" } ], \"managedObjectDNsBasic\":[ { \"DN\":\"dna\" }, { \"DN\":\"dnb\" } ] } }, { \"measurementGroup\":{ \"measurementTypes\":[ { \"measurementType\":\"counterc\" }, { \"measurementType\":\"counterd\" } ], \"managedObjectDNsBasic\":[ { \"DN\":\"dnc\" }, { \"DN\":\"dnd\" } ] } } ] } }, \"streams_subscribes\":{ \"aai_subscriber\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/AAI_EVENT\", \"client_role\":\"org.onap.dcae.aaiSub\", \"location\":\"san-francisco\", \"client_id\":\"1575976809466\" } }, \"policy_pm_subscriber\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS\", \"client_role\":\"org.onap.dcae.pmSubscriber\", \"location\":\"san-francisco\", \"client_id\":\"1575876809456\" } } }, \"streams_publishes\":{ \"policy_pm_publisher\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/org.onap.dmaap.mr.PM_SUBSCRIPTIONS\", \"client_role\":\"org.onap.dcae.pmPublisher\", \"location\":\"san-francisco\", \"client_id\":\"1475976809466\" } }, \"other_publisher\":{ \"type\":\"message_router\", \"dmaap_info\":{ \"topic_url\":\"https://10.152.183.151:3905/events/org.onap.dmaap.mr.SOME_OTHER_TOPIC\", \"client_role\":\"org.onap.dcae.pmControlPub\", \"location\":\"san-francisco\", \"client_id\":\"1875976809466\" } } } }", "expectedResponse": 200 } ] @@ -978,40 +978,40 @@ ] } }, - "org.onap.domain.sample.GenericK8s_ControlLoopDefinition": { + "org.onap.domain.sample.GenericK8s_AutomationCompositionDefinition": { "version": "1.2.3", - "type": "org.onap.policy.clamp.controlloop.ControlLoop", + "type": "org.onap.policy.clamp.acm.AutomationComposition", "type_version": "1.0.0", - "description": "Control loop for Hello World", + "description": "Automation Composition for Hello World", "properties": { "provider": "ONAP", "elements": [ { - "name": "org.onap.domain.database.PMSH_K8SMicroserviceControlLoopElement", + "name": "org.onap.domain.database.PMSH_K8SMicroserviceAutomationCompositionElement", "version": "1.2.3" }, { - "name": "org.onap.domain.database.Local_K8SMicroserviceControlLoopElement", + "name": "org.onap.domain.database.Local_K8SMicroserviceAutomationCompositionElement", "version": "1.2.3" }, { - "name": "org.onap.domain.database.Http_PMSHMicroserviceControlLoopElement", + "name": "org.onap.domain.database.Http_PMSHMicroserviceAutomationCompositionElement", "version": "1.2.3" }, { - "name": "org.onap.domain.pmsh.DerivedPolicyControlLoopElement", + "name": "org.onap.domain.pmsh.DerivedPolicyAutomationCompositionElement", "version": "1.2.3" }, { - "name": "org.onap.domain.pmsh.DerivedDerivedPolicyControlLoopElement", + "name": "org.onap.domain.pmsh.DerivedDerivedPolicyAutomationCompositionElement", "version": "1.2.3" }, { - "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyControlLoopElement", + "name": "org.onap.domain.pmsh.PMSH_MonitoringPolicyAutomationCompositionElement", "version": "1.2.3" }, { - "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyControlLoopElement", + "name": "org.onap.domain.pmsh.PMSH_OperationalPolicyAutomationCompositionElement", "version": "1.2.3" } ] diff --git a/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy.json b/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy.json index d8651ce4..adbf12a2 100644 --- a/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy.json +++ b/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy.json @@ -4,12 +4,12 @@ "policies": [ { "operational.sampledomain": { - "type": "onap.policies.controlloop.operational.Apex", + "type": "onap.policies.acm.operational.Apex", "typeVersion": "1.0.0", - "name": "onap.policies.controlloop.operational.apex.Sampledomain", + "name": "onap.policies.acm.operational.apex.Sampledomain", "version": "1.0.0", "metadata": { - "policy-id": "onap.policies.controlloop.operational.apex.Sampledomain" + "policy-id": "onap.policies.acm.operational.apex.Sampledomain" }, "properties": { "content": { @@ -37,7 +37,7 @@ "jsonAdapters": { "Instant": { "adaptedClass": "java.time.Instant", - "adaptorClass": "org.onap.policy.controlloop.util.Serialization$GsonInstantAdapter" + "adaptorClass": "org.onap.policy.acm.util.Serialization$GsonInstantAdapter" }, "APPC_LCM_REQUEST": { "adaptedClass": "org.onap.policy.appclcm.LcmRequest", @@ -98,4 +98,4 @@ } ] } -}
\ No newline at end of file +} diff --git a/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy_failure.json b/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy_failure.json index 1d30f08b..08ba6997 100644 --- a/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy_failure.json +++ b/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy_failure.json @@ -4,12 +4,12 @@ "policies": [ { "operational.sampledomain": { - "type": "onap.policies.controlloop.operational.ApexFailure", + "type": "onap.policies.acm.operational.ApexFailure", "typeVersion": "1.0.0", - "name": "onap.policies.controlloop.operational.apex.Sampledomain", + "name": "onap.policies.acm.operational.apex.Sampledomain", "version": "1.0.0", "metadata": { - "policy-id": "onap.policies.controlloop.operational.apex.Sampledomain" + "policy-id": "onap.policies.acm.operational.apex.Sampledomain" }, "properties": { "content": { @@ -37,7 +37,7 @@ "jsonAdapters": { "Instant": { "adaptedClass": "java.time.Instant", - "adaptorClass": "org.onap.policy.controlloop.util.Serialization$GsonInstantAdapter" + "adaptorClass": "org.onap.policy.acm.util.Serialization$GsonInstantAdapter" }, "APPC_LCM_REQUEST": { "adaptedClass": "org.onap.policy.appclcm.LcmRequest", @@ -98,4 +98,4 @@ } ] } -}
\ No newline at end of file +} diff --git a/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy_type.json b/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy_type.json index 810d970d..6aead75c 100644 --- a/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy_type.json +++ b/plugins/forwarding-plugins/src/test/resources/parameters/sample_policy_type.json @@ -1,40 +1,40 @@ { "tosca_definitions_version": "tosca_simple_yaml_1_0_0", "policy_types": { - "onap.policies.controlloop.operational.Apex": { + "onap.policies.acm.operational.Apex": { "version": "1.0.0", - "description": "Operational Policy for Control Loops using the APEX PDP", + "description": "Operational Policy for Automation Compositions using the APEX PDP", "properties": { "engine_service": { - "type": "onap.datatypes.policies.controlloop.operational.apex.EngineService", + "type": "onap.datatypes.policies.acm.operational.apex.EngineService", "description": "APEX Engine Service Parameters" }, "inputs": { "type": "map", "description": "Inputs for handling events coming into the APEX engine", "entry_schema": { - "type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler" + "type": "onap.datatypes.policies.acm.operational.apex.EventHandler" } }, "outputs": { "type": "map", "description": "Outputs for handling events going out of the APEX engine", "entry_schema": { - "type": "onap.datatypes.policies.controlloop.operational.apex.EventHandler" + "type": "onap.datatypes.policies.acm.operational.apex.EventHandler" } }, "environment": { "type": "list", "description": "Envioronmental parameters for the APEX engine", "entry_schema": { - "type": "onap.datatypes.policies.controlloop.operational.apex.Environment" + "type": "onap.datatypes.policies.acm.operational.apex.Environment" } } } } }, "data_types": { - "onap.datatypes.policies.controlloop.operational.apex.EngineService": { + "onap.datatypes.policies.acm.operational.apex.EngineService": { "derived_from": "tosca.datatypes.Root", "properties": { "name": { @@ -84,13 +84,13 @@ "default": 0 }, "engine": { - "type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine", + "type": "onap.datatypes.policies.acm.operational.apex.engineservice.Engine", "description": "The parameters for all engines in the APEX engine service", "required": true } } }, - "onap.datatypes.policies.controlloop.operational.apex.EventHandler": { + "onap.datatypes.policies.acm.operational.apex.EventHandler": { "derived_from": "tosca.datatypes.Root", "properties": { "name": { @@ -99,12 +99,12 @@ "required": false }, "carrier_technology": { - "type": "onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology", + "type": "onap.datatypes.policies.acm.operational.apex.CarrierTechnology", "description": "Specifies the carrier technology of the event handler (such as REST/Web Socket/Kafka)", "required": true }, "event_protocol": { - "type": "onap.datatypes.policies.controlloop.operational.apex.EventProtocol", + "type": "onap.datatypes.policies.acm.operational.apex.EventProtocol", "description": "Specifies the event protocol of events for the event handler (such as Yaml/JSON/XML/POJO)", "required": true }, @@ -156,7 +156,7 @@ } } }, - "onap.datatypes.policies.controlloop.operational.apex.CarrierTechnology": { + "onap.datatypes.policies.acm.operational.apex.CarrierTechnology": { "derived_from": "tosca.datatypes.Root", "properties": { "label": { @@ -171,7 +171,7 @@ } } }, - "onap.datatypes.policies.controlloop.operational.apex.EventProtocol": { + "onap.datatypes.policies.acm.operational.apex.EventProtocol": { "derived_from": "tosca.datatypes.Root", "properties": { "label": { @@ -186,7 +186,7 @@ } } }, - "onap.datatypes.policies.controlloop.operational.apex.Environmental": { + "onap.datatypes.policies.acm.operational.apex.Environmental": { "derived_from": "tosca.datatypes.Root", "properties": { "name": { @@ -201,11 +201,11 @@ } } }, - "onap.datatypes.policies.controlloop.operational.apex.engineservice.Engine": { + "onap.datatypes.policies.acm.operational.apex.engineservice.Engine": { "derived_from": "tosca.datatypes.Root", "properties": { "context": { - "type": "onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context", + "type": "onap.datatypes.policies.acm.operational.apex.engineservice.engine.Context", "description": "The properties for handling context in APEX engines, defaults to using Java maps for context", "required": false }, @@ -220,11 +220,11 @@ } } }, - "onap.datatypes.policies.controlloop.operational.apex.engineservice.engine.Context": { + "onap.datatypes.policies.acm.operational.apex.engineservice.engine.Context": { "derived_from": "tosca.datatypes.Root", "properties": { "distributor": { - "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin", + "type": "onap.datatypes.policies.acm.operational.apex.Plugin", "description": "The plugin to be used for distributing context between APEX PDPs at runtime", "required": false }, @@ -233,22 +233,22 @@ "description": "The plugins for context schemas available in APEX PDPs such as Java and Avro", "required": false, "entry_schema": { - "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin" + "type": "onap.datatypes.policies.acm.operational.apex.Plugin" } }, "locking": { - "type": "onap.datatypes.policies.controlloop.operational.apex.plugin", + "type": "onap.datatypes.policies.acm.operational.apex.plugin", "description": "The plugin to be used for locking context in and between APEX PDPs at runtime", "required": false }, "persistence": { - "type": "onap.datatypes.policies.controlloop.operational.apex.Plugin", + "type": "onap.datatypes.policies.acm.operational.apex.Plugin", "description": "The plugin to be used for persisting context for APEX PDPs at runtime", "required": false } } }, - "onap.datatypes.policies.controlloop.operational.apex.Plugin": { + "onap.datatypes.policies.acm.operational.apex.Plugin": { "derived_from": "tosca.datatypes.Root", "properties": { "name": { @@ -263,4 +263,4 @@ } } } -}
\ No newline at end of file +} diff --git a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsar.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsar.java index 96db632c..7bfcb0f9 100644 --- a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsar.java +++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsar.java @@ -38,13 +38,13 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity; import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate; /** - * This class extracts controlloop information from a CSAR file. + * This class extracts acm information from a CSAR file. * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ -public class ControlLoopDecoderFileInCsar implements PolicyDecoder<Csar, ToscaEntity> { +public class AutomationCompositionDecoderFileInCsar implements PolicyDecoder<Csar, ToscaEntity> { - private ControlLoopDecoderFileInCsarParameterGroup decoderParameters; + private AutomationCompositionDecoderFileInCsarParameterGroup decoderParameters; private static final String NODE_TYPES = "nodes.yml"; private static final String DATA_TYPES = "data.yml"; @@ -69,7 +69,7 @@ public class ControlLoopDecoderFileInCsar implements PolicyDecoder<Csar, ToscaEn */ @Override public Collection<ToscaEntity> decode(final Csar csar) throws PolicyDecodingException { - final Collection<ToscaEntity> controlLoopList = new ArrayList<>(); + final Collection<ToscaEntity> automationCompositionList = new ArrayList<>(); ToscaServiceTemplate nodeTypes = null; ToscaServiceTemplate dataTypes = null; @@ -94,24 +94,24 @@ public class ControlLoopDecoderFileInCsar implements PolicyDecoder<Csar, ToscaEn dataTypes = ReceptionUtil.decodeFile(zipFile, entry); } - if (entryName.contains(decoderParameters.getControlLoopType())) { + if (entryName.contains(decoderParameters.getAutomationCompositionType())) { ReceptionUtil.validateZipEntry(entryName, csar.getCsarFilePath(), entry.getSize()); - final ToscaServiceTemplate controlLoop = ReceptionUtil.decodeFile(zipFile, entry); - if (null != controlLoop.getToscaTopologyTemplate()) { + final ToscaServiceTemplate automationComposition = ReceptionUtil.decodeFile(zipFile, entry); + if (null != automationComposition.getToscaTopologyTemplate()) { if (null != nodeTypes) { - controlLoop.setNodeTypes(nodeTypes.getNodeTypes()); + automationComposition.setNodeTypes(nodeTypes.getNodeTypes()); } if (null != dataTypes) { - controlLoop.setDataTypes(dataTypes.getDataTypes()); + automationComposition.setDataTypes(dataTypes.getDataTypes()); } - controlLoopList.add(controlLoop); + automationCompositionList.add(automationComposition); } } } } catch (final IOException | CoderException exp) { - throw new PolicyDecodingException("Failed decoding the controlloop", exp); + throw new PolicyDecodingException("Failed decoding the acm", exp); } - return controlLoopList; + return automationCompositionList; } } diff --git a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarParameterGroup.java b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarParameterGroup.java index 358b1f87..a3efaa28 100644 --- a/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarParameterGroup.java +++ b/plugins/reception-plugins/src/main/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarParameterGroup.java @@ -27,18 +27,18 @@ import org.onap.policy.common.parameters.annotations.NotNull; import org.onap.policy.distribution.reception.parameters.PolicyDecoderConfigurationParameterGroup; /** - * Holds the parameters for the{@link ControlLoopDecoderFileInCsar}. + * Holds the parameters for the{@link AutomationCompositionDecoderFileInCsar}. * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ @Getter @NotNull @NotBlank -public class ControlLoopDecoderFileInCsarParameterGroup extends PolicyDecoderConfigurationParameterGroup { +public class AutomationCompositionDecoderFileInCsarParameterGroup extends PolicyDecoderConfigurationParameterGroup { - private String controlLoopType; + private String automationCompositionType; - public ControlLoopDecoderFileInCsarParameterGroup() { - super(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName()); + public AutomationCompositionDecoderFileInCsarParameterGroup() { + super(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName()); } } diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarParameterGroupTest.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarParameterGroupTest.java index 16f80096..ea844e4e 100644 --- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarParameterGroupTest.java +++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarParameterGroupTest.java @@ -28,39 +28,40 @@ import org.onap.policy.common.parameters.ValidationStatus; import org.onap.policy.distribution.reception.handling.sdc.CommonTestData; /** - * Class to perform unit test of {@link ControlLoopDecoderFileInCsarParameterGroup}. + * Class to perform unit test of {@link AutomationCompositionDecoderFileInCsarParameterGroup}. * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ -public class ControlLoopDecoderFileInCsarParameterGroupTest { +public class AutomationCompositionDecoderFileInCsarParameterGroupTest { @Test public void testValidParameters() { - final ControlLoopDecoderFileInCsarParameterGroup configurationParameters = CommonTestData - .getPolicyDecoderParameters("src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json", - ControlLoopDecoderFileInCsarParameterGroup.class); + final AutomationCompositionDecoderFileInCsarParameterGroup configurationParameters = CommonTestData + .getPolicyDecoderParameters( + "src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json", + AutomationCompositionDecoderFileInCsarParameterGroup.class); - assertEquals(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName(), + assertEquals(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName(), configurationParameters.getName()); - assertEquals("controlloop", configurationParameters.getControlLoopType()); + assertEquals("acm", configurationParameters.getAutomationCompositionType()); assertEquals(ValidationStatus.CLEAN, configurationParameters.validate().getStatus()); } @Test public void testInvalidParameters() { - final ControlLoopDecoderFileInCsarParameterGroup configurationParameters = + final AutomationCompositionDecoderFileInCsarParameterGroup configurationParameters = CommonTestData.getPolicyDecoderParameters( - "src/test/resources/parameters/FileInCsarControlLoopDecoderParametersInvalid.json", - ControlLoopDecoderFileInCsarParameterGroup.class); + "src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParametersInvalid.json", + AutomationCompositionDecoderFileInCsarParameterGroup.class); assertEquals(ValidationStatus.INVALID, configurationParameters.validate().getStatus()); } @Test public void testEmptyParameters() { - final ControlLoopDecoderFileInCsarParameterGroup configurationParameters = + final AutomationCompositionDecoderFileInCsarParameterGroup configurationParameters = CommonTestData.getPolicyDecoderParameters("src/test/resources/parameters/EmptyParameters.json", - ControlLoopDecoderFileInCsarParameterGroup.class); + AutomationCompositionDecoderFileInCsarParameterGroup.class); assertEquals(ValidationStatus.INVALID, configurationParameters.validate().getStatus()); } diff --git a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarTest.java b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarTest.java index e452a7ce..80c520a4 100644 --- a/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/ControlLoopDecoderFileInCsarTest.java +++ b/plugins/reception-plugins/src/test/java/org/onap/policy/distribution/reception/decoding/policy/file/AutomationCompositionDecoderFileInCsarTest.java @@ -39,22 +39,23 @@ import org.onap.policy.distribution.reception.handling.sdc.CommonTestData; import org.onap.policy.models.tosca.authorative.concepts.ToscaEntity; /** - * Class to perform unit test of {@link ControlLoopDecoderFileInCsar}. + * Class to perform unit test of {@link AutomationCompositionDecoderFileInCsar}. * * @author Sirisha Manchikanti (sirisha.manchikanti@est.tech) */ @RunWith(MockitoJUnitRunner.class) -public class ControlLoopDecoderFileInCsarTest { +public class AutomationCompositionDecoderFileInCsarTest { /** * Set up. */ @BeforeClass public static void setUp() { - final ControlLoopDecoderFileInCsarParameterGroup configurationParameters = CommonTestData - .getPolicyDecoderParameters("src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json", - ControlLoopDecoderFileInCsarParameterGroup.class); - configurationParameters.setName(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName()); + final AutomationCompositionDecoderFileInCsarParameterGroup configurationParameters = CommonTestData + .getPolicyDecoderParameters( + "src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json", + AutomationCompositionDecoderFileInCsarParameterGroup.class); + configurationParameters.setName(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName()); ParameterService.register(configurationParameters); } @@ -63,34 +64,34 @@ public class ControlLoopDecoderFileInCsarTest { */ @AfterClass public static void tearDown() { - ParameterService.deregister(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName()); + ParameterService.deregister(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName()); } @Test - public void testDecodeControlLoop() throws PolicyDecodingException { + public void testDecodeAutomationComposition() throws PolicyDecodingException { - final ControlLoopDecoderFileInCsar decoder = new ControlLoopDecoderFileInCsar(); - decoder.configure(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName()); + final AutomationCompositionDecoderFileInCsar decoder = new AutomationCompositionDecoderFileInCsar(); + decoder.configure(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName()); - final File file = new File("src/test/resources/service-Sampleservice-controlloop.csar"); + final File file = new File("src/test/resources/service-Sampleservice-acm.csar"); final Csar csar = new Csar(file.getAbsolutePath()); assertTrue(decoder.canHandle(csar)); - final Collection<ToscaEntity> controlLoopHolders = decoder.decode(csar); - assertEquals(1, controlLoopHolders.size()); + final Collection<ToscaEntity> automationCompositionHolders = decoder.decode(csar); + assertEquals(1, automationCompositionHolders.size()); } @Test - public void testDecodeControlLoopZipError() { + public void testDecodeAutomationCompositionZipError() { - final ControlLoopDecoderFileInCsar decoder = new ControlLoopDecoderFileInCsar(); - decoder.configure(ControlLoopDecoderFileInCsarParameterGroup.class.getSimpleName()); + final AutomationCompositionDecoderFileInCsar decoder = new AutomationCompositionDecoderFileInCsar(); + decoder.configure(AutomationCompositionDecoderFileInCsarParameterGroup.class.getSimpleName()); final File file = new File("unknown.csar"); final Csar csar = new Csar(file.getAbsolutePath()); assertTrue(decoder.canHandle(csar)); assertThatThrownBy(() -> decoder.decode(csar)).isInstanceOf(PolicyDecodingException.class) - .hasMessageContaining("Failed decoding the controlloop"); + .hasMessageContaining("Failed decoding the acm"); } } diff --git a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json new file mode 100644 index 00000000..672a6677 --- /dev/null +++ b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParameters.json @@ -0,0 +1,3 @@ +{ + "automationCompositionType": "acm" +} diff --git a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParametersInvalid.json b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParametersInvalid.json new file mode 100644 index 00000000..ef58553a --- /dev/null +++ b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarAutomationCompositionDecoderParametersInvalid.json @@ -0,0 +1,3 @@ +{ + "acm": "" +} diff --git a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json deleted file mode 100644 index ca112388..00000000 --- a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParameters.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "controlLoopType": "controlloop" -} diff --git a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParametersInvalid.json b/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParametersInvalid.json deleted file mode 100644 index 9d33896e..00000000 --- a/plugins/reception-plugins/src/test/resources/parameters/FileInCsarControlLoopDecoderParametersInvalid.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "controlLoop": "" -} diff --git a/plugins/reception-plugins/src/test/resources/service-Sampleservice-controlloop.csar b/plugins/reception-plugins/src/test/resources/service-Sampleservice-acm.csar Binary files differindex 03e29366..226ab158 100644 --- a/plugins/reception-plugins/src/test/resources/service-Sampleservice-controlloop.csar +++ b/plugins/reception-plugins/src/test/resources/service-Sampleservice-acm.csar diff --git a/testsuites/stability/src/main/resources/setup/config/jsonConfigs/apiConfigFile.json b/testsuites/stability/src/main/resources/setup/config/jsonConfigs/apiConfigFile.json index e6f076ab..63e0c4c6 100644 --- a/testsuites/stability/src/main/resources/setup/config/jsonConfigs/apiConfigFile.json +++ b/testsuites/stability/src/main/resources/setup/config/jsonConfigs/apiConfigFile.json @@ -36,20 +36,20 @@ "policytypes/onap.policies.optimization.service.SubscriberPolicy.yaml", "policytypes/onap.policies.optimization.resource.Vim_fit.yaml", "policytypes/onap.policies.optimization.resource.VnfPolicy.yaml", - "policytypes/onap.policies.controlloop.guard.Common.yaml", - "policytypes/onap.policies.controlloop.guard.common.Blacklist.yaml", - "policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter.yaml", - "policytypes/onap.policies.controlloop.guard.common.MinMax.yaml", - "policytypes/onap.policies.controlloop.guard.common.Filter.yaml", - "policytypes/onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml", + "policytypes/onap.policies.acm.guard.Common.yaml", + "policytypes/onap.policies.acm.guard.common.Blacklist.yaml", + "policytypes/onap.policies.acm.guard.common.FrequencyLimiter.yaml", + "policytypes/onap.policies.acm.guard.common.MinMax.yaml", + "policytypes/onap.policies.acm.guard.common.Filter.yaml", + "policytypes/onap.policies.acm.guard.coordination.FirstBlocksSecond.yaml", "policytypes/onap.policies.Naming.yaml", "policytypes/onap.policies.Match.yaml", "policytypes/onap.policies.native.Drools.yaml", "policytypes/onap.policies.native.Xacml.yaml", "policytypes/onap.policies.native.Apex.yaml", - "policytypes/onap.policies.controlloop.operational.Common.yaml", - "policytypes/onap.policies.controlloop.operational.common.Apex.yaml", - "policytypes/onap.policies.controlloop.operational.common.Drools.yaml" + "policytypes/onap.policies.acm.operational.Common.yaml", + "policytypes/onap.policies.acm.operational.common.Apex.yaml", + "policytypes/onap.policies.acm.operational.common.Drools.yaml" ], "preloadPolicies" : [ "policies/sdnc.policy.naming.input.tosca.yaml" diff --git a/testsuites/stability/src/main/resources/setup/config/jsonConfigs/pdpSimConfig.json b/testsuites/stability/src/main/resources/setup/config/jsonConfigs/pdpSimConfig.json index 396b9f7a..ee832326 100644 --- a/testsuites/stability/src/main/resources/setup/config/jsonConfigs/pdpSimConfig.json +++ b/testsuites/stability/src/main/resources/setup/config/jsonConfigs/pdpSimConfig.json @@ -6,7 +6,7 @@ "pdpType":"apex", "description":"Pdp Heartbeat", "supportedPolicyTypes":[ - {"name":"onap.policies.controlloop.operational.common.Apex","version":"1.0.0"}, + {"name":"onap.policies.acm.operational.common.Apex","version":"1.0.0"}, {"name":"onap.policies.native.Apex","version":"1.0.0"} ] }, diff --git a/testsuites/stability/src/main/resources/setup/distribution/etc/defaultConfig.json b/testsuites/stability/src/main/resources/setup/distribution/etc/defaultConfig.json index 2b3078ac..8a5b769e 100644 --- a/testsuites/stability/src/main/resources/setup/distribution/etc/defaultConfig.json +++ b/testsuites/stability/src/main/resources/setup/distribution/etc/defaultConfig.json @@ -18,10 +18,10 @@ "decoderClassName":"org.onap.policy.distribution.reception.decoding.policy.file.PolicyDecoderFileInCsarToPolicy", "decoderConfigurationName": "toscaPolicyDecoderConfiguration" }, - "ToscaControlLoopDecoder": { - "decoderType": "ToscaControlLoopDecoder", - "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsar", - "decoderConfigurationName": "toscaControlLoopDecoderConfiguration" + "ToscaAutomationCompositionDecoder": { + "decoderType": "ToscaAutomationCompositionDecoder", + "decoderClassName": "org.onap.policy.distribution.reception.decoding.policy.file.AutomationCompositionDecoderFileInCsar", + "decoderConfigurationName": "toscaAutomationCompositionDecoderConfiguration" } }, "policyForwarders": { @@ -30,10 +30,10 @@ "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiPolicyForwarder", "forwarderConfigurationName": "lifecycleApiPolicyConfiguration" }, - "LifeCycleApiControlLoopForwarder": { - "forwarderType": "LifeCycleControlLoopAPI", - "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarder", - "forwarderConfigurationName": "lifecycleApiControlLoopConfiguration" + "LifeCycleApiAutomationCompositionForwarder": { + "forwarderType": "LifeCycleAutomationCompositionAPI", + "forwarderClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiAutomationCompositionForwarder", + "forwarderConfigurationName": "lifecycleApiAutomationCompositionConfiguration" } } } @@ -56,10 +56,10 @@ "policyTypeFileName": "tosca_policy_type" } }, - "toscaControlLoopDecoderConfiguration": { - "parameterClassName": "org.onap.policy.distribution.reception.decoding.policy.file.ControlLoopDecoderFileInCsarParameterGroup", + "toscaAutomationCompositionDecoderConfiguration": { + "parameterClassName": "org.onap.policy.distribution.reception.decoding.policy.file.AutomationCompositionDecoderFileInCsarParameterGroup", "parameters": { - "controlLoopType": "controlloop" + "automationCompositionType": "acm" } } }, @@ -87,12 +87,12 @@ "deployPolicies": true } }, - "lifecycleApiControlLoopConfiguration": { - "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiControlLoopForwarderParameters", + "lifecycleApiAutomationCompositionConfiguration": { + "parameterClassName": "org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiAutomationCompositionForwarderParameters", "parameters": { - "controlLoopRuntimeParameters": { - "clientName": "policy-clamp-cl-runtime", - "hostname": "policy-clamp-cl-runtime", + "automationCompositionRuntimeParameters": { + "clientName": "policy-clamp-runtime-acm", + "hostname": "policy-clamp-runtime-acm", "port": 6969, "useHttps": true, "userName": "policyadmin", diff --git a/testsuites/stability/src/main/resources/testplans/stability.jmx b/testsuites/stability/src/main/resources/testplans/stability.jmx index 9182a97d..8022d607 100644 --- a/testsuites/stability/src/main/resources/testplans/stability.jmx +++ b/testsuites/stability/src/main/resources/testplans/stability.jmx @@ -364,7 +364,7 @@ <hashTree> <JSONPathAssertion guiclass="JSONPathAssertionGui" testclass="JSONPathAssertion" testname="Assert Policy Type" enabled="true"> <stringProp name="JSON_PATH">$[:2].policy-type</stringProp> - <stringProp name="EXPECTED_VALUE">onap.policies.controlloop.operational.common.Apex</stringProp> + <stringProp name="EXPECTED_VALUE">onap.policies.acm.operational.common.Apex</stringProp> <boolProp name="JSONVALIDATION">true</boolProp> <boolProp name="EXPECT_NULL">false</boolProp> <boolProp name="INVERT">false</boolProp> |