aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main
diff options
context:
space:
mode:
authorliamfallon <liam.fallon@est.tech>2022-01-25 19:55:43 +0000
committerliamfallon <liam.fallon@est.tech>2022-02-18 15:54:40 +0000
commit43098043c4ef31d9d5dead66568d7d9482a6b165 (patch)
tree6f6ea4812ff93d65e7c64e12a3ec6ab4462a64e2 /common/src/main
parentf401b5099bcb64f3e21de608d0207dd69d8043cd (diff)
Rename TOSCA Control Loop to ACM
This commit renames the TOSCA Control Loop functionality in CLAMP to Automation Composition Management. This review is a direct renaming review and, as everything is renamed together it is large. Issue-ID: POLICY-3939 Change-Id: I28f0a6dd889bf3570a4c1365ae9e71fc58db6d6c Signed-off-by: liamfallon <liam.fallon@est.tech>
Diffstat (limited to 'common/src/main')
-rw-r--r--common/src/main/java/org/onap/policy/clamp/common/acm/exception/AutomationCompositionException.java (renamed from common/src/main/java/org/onap/policy/clamp/controlloop/common/exception/ControlLoopException.java)23
-rw-r--r--common/src/main/java/org/onap/policy/clamp/common/acm/exception/AutomationCompositionRuntimeException.java (renamed from common/src/main/java/org/onap/policy/clamp/controlloop/common/exception/ControlLoopRuntimeException.java)38
-rw-r--r--common/src/main/java/org/onap/policy/clamp/common/acm/rest/CoderHttpMesageConverter.java (renamed from common/src/main/java/org/onap/policy/clamp/controlloop/common/rest/CoderHttpMesageConverter.java)8
-rw-r--r--common/src/main/java/org/onap/policy/clamp/common/acm/rest/RequestResponseLoggingFilter.java (renamed from common/src/main/java/org/onap/policy/clamp/controlloop/common/rest/RequestResponseLoggingFilter.java)2
-rw-r--r--common/src/main/java/org/onap/policy/clamp/common/acm/startstop/CommonCommandLineArguments.java (renamed from common/src/main/java/org/onap/policy/clamp/controlloop/common/startstop/CommonCommandLineArguments.java)35
-rw-r--r--common/src/main/java/org/onap/policy/clamp/controlloop/common/utils/CommonUtils.java152
-rw-r--r--common/src/main/resources/tosca/ApplicationServiceDescriptorTypes.yaml74
-rw-r--r--common/src/main/resources/tosca/AutomationCompositionTOSCAServiceTemplateTypes.yaml (renamed from common/src/main/resources/tosca/ControlLoopTOSCAServiceTemplateTypes.yaml)24
-rw-r--r--common/src/main/resources/tosca/CdsAutomationCompositionElementType.yaml (renamed from common/src/main/resources/tosca/CdsControlLoopElementType.yaml)8
-rw-r--r--common/src/main/resources/tosca/DcaeControlLoopElementType.yaml51
-rw-r--r--common/src/main/resources/tosca/HttpAutomationCompositionElementType.yaml (renamed from common/src/main/resources/tosca/HttpControlLoopElementType.yaml)20
-rw-r--r--common/src/main/resources/tosca/KubernetesAutomationCompositionElementType.yaml (renamed from common/src/main/resources/tosca/KubernetesControlLoopElementType.yaml)10
-rw-r--r--common/src/main/resources/tosca/PolicyAutomationCompositionElementType.yaml (renamed from common/src/main/resources/tosca/PolicyControlLoopElementType.yaml)17
13 files changed, 96 insertions, 366 deletions
diff --git a/common/src/main/java/org/onap/policy/clamp/controlloop/common/exception/ControlLoopException.java b/common/src/main/java/org/onap/policy/clamp/common/acm/exception/AutomationCompositionException.java
index 58b5368a9..c22aa920e 100644
--- a/common/src/main/java/org/onap/policy/clamp/controlloop/common/exception/ControlLoopException.java
+++ b/common/src/main/java/org/onap/policy/clamp/common/acm/exception/AutomationCompositionException.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.clamp.controlloop.common.exception;
+package org.onap.policy.clamp.common.acm.exception;
import javax.ws.rs.core.Response;
import lombok.Getter;
@@ -28,11 +28,11 @@ import org.onap.policy.models.errors.concepts.ErrorResponseInfo;
import org.onap.policy.models.errors.concepts.ErrorResponseUtils;
/**
- * This class is a base exception from which all control loop exceptions are sub classes.
+ * This class is a base exception from which all automation composition exceptions are sub classes.
*/
@Getter
@ToString
-public class ControlLoopException extends Exception implements ErrorResponseInfo {
+public class AutomationCompositionException extends Exception implements ErrorResponseInfo {
private static final long serialVersionUID = -8507246953751956974L;
// The error response of the exception
@@ -42,23 +42,23 @@ public class ControlLoopException extends Exception implements ErrorResponseInfo
private final transient Object object;
/**
- * Instantiates a new control loop exception.
+ * Instantiates a new automation composition exception.
*
* @param statusCode the status code for the response as a HTTP status code
* @param message the message on the exception
*/
- public ControlLoopException(final Response.Status statusCode, final String message) {
+ public AutomationCompositionException(final Response.Status statusCode, final String message) {
this(statusCode, message, null);
}
/**
- * Instantiates a new control loop exception.
+ * Instantiates a new automation composition exception.
*
* @param statusCode the return code for the exception
* @param message the message on the exception
* @param object the object that the exception was thrown on
*/
- public ControlLoopException(final Response.Status statusCode, final String message, final Object object) {
+ public AutomationCompositionException(final Response.Status statusCode, final String message, final Object object) {
super(message);
errorResponse.setResponseCode(statusCode);
ErrorResponseUtils.getExceptionMessages(errorResponse, this);
@@ -66,13 +66,14 @@ public class ControlLoopException extends Exception implements ErrorResponseInfo
}
/**
- * Instantiates a new control loop exception.
+ * Instantiates a new automation composition exception.
*
* @param statusCode the return code for the exception
* @param message the message on the exception
* @param exception the exception that caused this exception
*/
- public ControlLoopException(final Response.Status statusCode, final String message, final Exception exception) {
+ public AutomationCompositionException(final Response.Status statusCode, final String message,
+ final Exception exception) {
this(statusCode, message, exception, null);
}
@@ -84,8 +85,8 @@ public class ControlLoopException extends Exception implements ErrorResponseInfo
* @param exception the exception that caused this exception
* @param object the object that the exception was thrown on
*/
- public ControlLoopException(final Response.Status statusCode, final String message, final Exception exception,
- final Object object) {
+ public AutomationCompositionException(final Response.Status statusCode, final String message,
+ final Exception exception, final Object object) {
super(message, exception);
errorResponse.setResponseCode(statusCode);
ErrorResponseUtils.getExceptionMessages(errorResponse, this);
diff --git a/common/src/main/java/org/onap/policy/clamp/controlloop/common/exception/ControlLoopRuntimeException.java b/common/src/main/java/org/onap/policy/clamp/common/acm/exception/AutomationCompositionRuntimeException.java
index b110a4362..2fc427db8 100644
--- a/common/src/main/java/org/onap/policy/clamp/controlloop/common/exception/ControlLoopRuntimeException.java
+++ b/common/src/main/java/org/onap/policy/clamp/common/acm/exception/AutomationCompositionRuntimeException.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.clamp.controlloop.common.exception;
+package org.onap.policy.clamp.common.acm.exception;
import javax.ws.rs.core.Response;
import lombok.Getter;
@@ -28,11 +28,12 @@ import org.onap.policy.models.errors.concepts.ErrorResponseInfo;
import org.onap.policy.models.errors.concepts.ErrorResponseUtils;
/**
- * This class is a base control loop run time exception from which all control loop run time exceptions are sub classes.
+ * This class is a base automation composition run time exception from which all automation composition run time
+ * exceptions are sub classes.
*/
@Getter
@ToString
-public class ControlLoopRuntimeException extends RuntimeException implements ErrorResponseInfo {
+public class AutomationCompositionRuntimeException extends RuntimeException implements ErrorResponseInfo {
private static final long serialVersionUID = -8507246953751956974L;
// The error response of the exception
@@ -42,23 +43,24 @@ public class ControlLoopRuntimeException extends RuntimeException implements Err
private final transient Object object;
/**
- * Instantiates a new control loop runtime exception.
+ * Instantiates a new automation composition runtime exception.
*
* @param statusCode the return code for the exception
* @param message the message on the exception
*/
- public ControlLoopRuntimeException(final Response.Status statusCode, final String message) {
+ public AutomationCompositionRuntimeException(final Response.Status statusCode, final String message) {
this(statusCode, message, null);
}
/**
- * Instantiates a new control loop runtime exception.
+ * Instantiates a new automation composition runtime exception.
*
* @param statusCode the return code for the exception
* @param message the message on the exception
* @param object the object that the exception was thrown on
*/
- public ControlLoopRuntimeException(final Response.Status statusCode, final String message, final Object object) {
+ public AutomationCompositionRuntimeException(final Response.Status statusCode, final String message,
+ final Object object) {
super(message);
this.object = object;
errorResponse.setResponseCode(statusCode);
@@ -66,23 +68,23 @@ public class ControlLoopRuntimeException extends RuntimeException implements Err
}
/**
- * Instantiates a new control loop runtime exception.
+ * Instantiates a new automation composition runtime exception.
*
* @param statusCode the return code for the exception
* @param message the message on the exception
- * @param exception the exception that caused this control loop exception
+ * @param exception the exception that caused this automation composition exception
*/
- public ControlLoopRuntimeException(final Response.Status statusCode, final String message,
- final Exception exception) {
+ public AutomationCompositionRuntimeException(final Response.Status statusCode, final String message,
+ final Exception exception) {
this(statusCode, message, exception, null);
}
/**
- * Instantiates a new model runtime exception from a ControlLoopException instance.
+ * Instantiates a new model runtime exception from an AutomationCompositionException instance.
*
- * @param exception the exception that caused this control loop exception
+ * @param exception the exception that caused this automation composition exception
*/
- public ControlLoopRuntimeException(final ControlLoopException exception) {
+ public AutomationCompositionRuntimeException(final AutomationCompositionException exception) {
super(exception.getMessage(), exception);
this.object = exception.getObject();
errorResponse.setResponseCode(exception.getErrorResponse().getResponseCode());
@@ -90,15 +92,15 @@ public class ControlLoopRuntimeException extends RuntimeException implements Err
}
/**
- * Instantiates a new control loop runtime exception.
+ * Instantiates a new automation composition runtime exception.
*
* @param statusCode the return code for the exception
* @param message the message on the exception
- * @param exception the exception that caused this control loop exception
+ * @param exception the exception that caused this automation composition exception
* @param object the object that the exception was thrown on
*/
- public ControlLoopRuntimeException(final Response.Status statusCode, final String message,
- final Exception exception, final Object object) {
+ public AutomationCompositionRuntimeException(final Response.Status statusCode, final String message,
+ final Exception exception, final Object object) {
super(message, exception);
this.object = object;
errorResponse.setResponseCode(statusCode);
diff --git a/common/src/main/java/org/onap/policy/clamp/controlloop/common/rest/CoderHttpMesageConverter.java b/common/src/main/java/org/onap/policy/clamp/common/acm/rest/CoderHttpMesageConverter.java
index 9eb43fd6f..f445364ad 100644
--- a/common/src/main/java/org/onap/policy/clamp/controlloop/common/rest/CoderHttpMesageConverter.java
+++ b/common/src/main/java/org/onap/policy/clamp/common/acm/rest/CoderHttpMesageConverter.java
@@ -18,14 +18,14 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.clamp.controlloop.common.rest;
+package org.onap.policy.clamp.common.acm.rest;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.nio.charset.StandardCharsets;
import javax.ws.rs.core.Response;
-import org.onap.policy.clamp.controlloop.common.exception.ControlLoopRuntimeException;
+import org.onap.policy.clamp.common.acm.exception.AutomationCompositionRuntimeException;
import org.onap.policy.common.utils.coder.Coder;
import org.onap.policy.common.utils.coder.CoderException;
import org.onap.policy.common.utils.coder.StandardCoder;
@@ -57,7 +57,7 @@ public class CoderHttpMesageConverter<T> extends AbstractHttpMessageConverter<T>
try (var is = new InputStreamReader(inputMessage.getBody(), StandardCharsets.UTF_8)) {
return coder.decode(is, clazz);
} catch (CoderException e) {
- throw new ControlLoopRuntimeException(Response.Status.BAD_REQUEST, e.getMessage(), e);
+ throw new AutomationCompositionRuntimeException(Response.Status.BAD_REQUEST, e.getMessage(), e);
}
}
@@ -67,7 +67,7 @@ public class CoderHttpMesageConverter<T> extends AbstractHttpMessageConverter<T>
try (var writer = new OutputStreamWriter(outputMessage.getBody(), StandardCharsets.UTF_8)) {
coder.encode(writer, t);
} catch (CoderException e) {
- throw new ControlLoopRuntimeException(Response.Status.BAD_REQUEST, e.getMessage(), e);
+ throw new AutomationCompositionRuntimeException(Response.Status.BAD_REQUEST, e.getMessage(), e);
}
}
diff --git a/common/src/main/java/org/onap/policy/clamp/controlloop/common/rest/RequestResponseLoggingFilter.java b/common/src/main/java/org/onap/policy/clamp/common/acm/rest/RequestResponseLoggingFilter.java
index 915cdf0b2..4b6dce46d 100644
--- a/common/src/main/java/org/onap/policy/clamp/controlloop/common/rest/RequestResponseLoggingFilter.java
+++ b/common/src/main/java/org/onap/policy/clamp/common/acm/rest/RequestResponseLoggingFilter.java
@@ -20,7 +20,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.clamp.controlloop.common.rest;
+package org.onap.policy.clamp.common.acm.rest;
import java.io.IOException;
import java.util.UUID;
diff --git a/common/src/main/java/org/onap/policy/clamp/controlloop/common/startstop/CommonCommandLineArguments.java b/common/src/main/java/org/onap/policy/clamp/common/acm/startstop/CommonCommandLineArguments.java
index 525da259f..6f6fb6a4b 100644
--- a/common/src/main/java/org/onap/policy/clamp/controlloop/common/startstop/CommonCommandLineArguments.java
+++ b/common/src/main/java/org/onap/policy/clamp/common/acm/startstop/CommonCommandLineArguments.java
@@ -18,7 +18,7 @@
* ============LICENSE_END=========================================================
*/
-package org.onap.policy.clamp.controlloop.common.startstop;
+package org.onap.policy.clamp.common.acm.startstop;
import java.io.File;
import java.io.PrintWriter;
@@ -28,7 +28,7 @@ import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.Option;
import org.apache.commons.cli.Options;
import org.apache.commons.lang3.StringUtils;
-import org.onap.policy.clamp.controlloop.common.exception.ControlLoopException;
+import org.onap.policy.clamp.common.acm.exception.AutomationCompositionException;
import org.onap.policy.common.utils.resources.ResourceUtils;
/**
@@ -75,9 +75,9 @@ public class CommonCommandLineArguments {
* Validate the command line options.
*
* @param configurationFilePath the path to the configuration file
- * @throws ControlLoopException on command argument validation errors
+ * @throws AutomationCompositionException on command argument validation errors
*/
- public void validate(final String configurationFilePath) throws ControlLoopException {
+ public void validate(final String configurationFilePath) throws AutomationCompositionException {
validateReadableFile("policy participant configuration", configurationFilePath);
}
@@ -103,7 +103,7 @@ public class CommonCommandLineArguments {
final var printWriter = new PrintWriter(stringWriter);
helpFormatter.printHelp(printWriter, HELP_LINE_LENGTH, mainClassName + " [options...]", "options", options, 0,
- 0, "");
+ 0, "");
return stringWriter.toString();
}
@@ -113,33 +113,34 @@ public class CommonCommandLineArguments {
*
* @param fileTag the file tag
* @param fileName the file name
- * @throws ControlLoopException on the file name passed as a parameter
+ * @throws AutomationCompositionException on the file name passed as a parameter
*/
- private void validateReadableFile(final String fileTag, final String fileName) throws ControlLoopException {
+ private void validateReadableFile(final String fileTag, final String fileName)
+ throws AutomationCompositionException {
if (StringUtils.isEmpty(fileName)) {
- throw new ControlLoopException(Response.Status.NOT_ACCEPTABLE,
- fileTag + " file was not specified as an argument");
+ throw new AutomationCompositionException(Response.Status.NOT_ACCEPTABLE,
+ fileTag + " file was not specified as an argument");
}
// The file name refers to a resource on the local file system
final var fileUrl = ResourceUtils.getUrl4Resource(fileName);
if (fileUrl == null) {
- throw new ControlLoopException(Response.Status.NOT_ACCEPTABLE,
- fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" does not exist");
+ throw new AutomationCompositionException(Response.Status.NOT_ACCEPTABLE,
+ fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" does not exist");
}
final var theFile = new File(fileUrl.getPath());
if (!theFile.exists()) {
- throw new ControlLoopException(Response.Status.NOT_ACCEPTABLE,
- fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" does not exist");
+ throw new AutomationCompositionException(Response.Status.NOT_ACCEPTABLE,
+ fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" does not exist");
}
if (!theFile.isFile()) {
- throw new ControlLoopException(Response.Status.NOT_ACCEPTABLE,
- fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" is not a normal file");
+ throw new AutomationCompositionException(Response.Status.NOT_ACCEPTABLE,
+ fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" is not a normal file");
}
if (!theFile.canRead()) {
- throw new ControlLoopException(Response.Status.NOT_ACCEPTABLE,
- fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" is unreadable");
+ throw new AutomationCompositionException(Response.Status.NOT_ACCEPTABLE,
+ fileTag + FILE_MESSAGE_PREAMBLE + fileName + "\" is unreadable");
}
}
}
diff --git a/common/src/main/java/org/onap/policy/clamp/controlloop/common/utils/CommonUtils.java b/common/src/main/java/org/onap/policy/clamp/controlloop/common/utils/CommonUtils.java
deleted file mode 100644
index 4ebd0aaa8..000000000
--- a/common/src/main/java/org/onap/policy/clamp/controlloop/common/utils/CommonUtils.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*-
- * ============LICENSE_START=======================================================
- * Copyright (C) 2021 Nordix Foundation.
- * ================================================================================
- * 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.
- *
- * SPDX-License-Identifier: Apache-2.0
- * ============LICENSE_END=========================================================
- */
-
-package org.onap.policy.clamp.controlloop.common.utils;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElement;
-import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ControlLoopElementDefinition;
-import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantDefinition;
-import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ParticipantUpdates;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaConceptIdentifier;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeTemplate;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeType;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
-import org.onap.policy.models.tosca.authorative.concepts.ToscaTopologyTemplate;
-
-/**
- * Utility functions used in controlloop-runtime and participants.
- *
- */
-public class CommonUtils {
-
- private CommonUtils() {
- throw new IllegalStateException("Utility class");
- }
-
- /**
- * Prepare participant updates map.
- *
- * @param clElement controlloop element
- * @param participantUpdates list of participantUpdates
- */
- public static void prepareParticipantUpdate(ControlLoopElement clElement,
- List<ParticipantUpdates> participantUpdates) {
- if (participantUpdates.isEmpty()) {
- participantUpdates.add(getControlLoopElementList(clElement));
- return;
- }
-
- var participantExists = false;
- for (ParticipantUpdates participantUpdate : participantUpdates) {
- if (participantUpdate.getParticipantId().equals(clElement.getParticipantId())) {
- participantUpdate.setControlLoopElementList(List.of(clElement));
- participantExists = true;
- }
- }
- if (!participantExists) {
- participantUpdates.add(getControlLoopElementList(clElement));
- }
- }
-
- private static ParticipantUpdates getControlLoopElementList(ControlLoopElement clElement) {
- var participantUpdate = new ParticipantUpdates();
- participantUpdate.setParticipantId(clElement.getParticipantId());
- participantUpdate.setControlLoopElementList(List.of(clElement));
- return participantUpdate;
- }
-
- /**
- * Set the Policy information in the service template for the controlloopelement.
- *
- * @param clElement controlloop element
- * @param toscaServiceTemplate ToscaServiceTemplate
- */
- public static void setServiceTemplatePolicyInfo(ControlLoopElement clElement,
- ToscaServiceTemplate toscaServiceTemplate) {
- // Pass respective PolicyTypes or Policies as part of toscaServiceTemplateFragment
- if (toscaServiceTemplate.getPolicyTypes() == null
- && toscaServiceTemplate.getToscaTopologyTemplate().getPolicies() == null) {
- return;
- }
- ToscaServiceTemplate toscaServiceTemplateFragment = new ToscaServiceTemplate();
- toscaServiceTemplateFragment.setPolicyTypes(toscaServiceTemplate.getPolicyTypes());
- ToscaTopologyTemplate toscaTopologyTemplate = new ToscaTopologyTemplate();
- toscaTopologyTemplate.setPolicies(toscaServiceTemplate.getToscaTopologyTemplate().getPolicies());
- toscaServiceTemplateFragment.setToscaTopologyTemplate(toscaTopologyTemplate);
- toscaServiceTemplateFragment.setDataTypes(toscaServiceTemplate.getDataTypes());
- clElement.setToscaServiceTemplateFragment(toscaServiceTemplateFragment);
- }
-
- /**
- * Prepare ParticipantDefinitionUpdate to set in the message.
- *
- * @param clParticipantType controlloop element
- * @param entryKey key for the entry
- * @param entryValue value relates to toscaNodeTemplate
- * @param participantDefinitionUpdates list of participantDefinitionUpdates
- * @param commonPropertiesMap common properties map
- */
- public static void prepareParticipantDefinitionUpdate(ToscaConceptIdentifier clParticipantType, String entryKey,
- ToscaNodeTemplate entryValue, List<ParticipantDefinition> participantDefinitionUpdates,
- Map<String, ToscaNodeType> commonPropertiesMap) {
-
- var clDefinition = new ControlLoopElementDefinition();
- clDefinition.setClElementDefinitionId(new ToscaConceptIdentifier(entryKey, entryValue.getVersion()));
- clDefinition.setControlLoopElementToscaNodeTemplate(entryValue);
- if (commonPropertiesMap != null) {
- ToscaNodeType nodeType = commonPropertiesMap.get(entryValue.getType());
- if (nodeType != null) {
- clDefinition.setCommonPropertiesMap(nodeType.getProperties());
- }
- }
-
- List<ControlLoopElementDefinition> controlLoopElementDefinitionList = new ArrayList<>();
-
- if (participantDefinitionUpdates.isEmpty()) {
- participantDefinitionUpdates
- .add(getParticipantDefinition(clDefinition, clParticipantType, controlLoopElementDefinitionList));
- } else {
- var participantExists = false;
- for (ParticipantDefinition participantDefinitionUpdate : participantDefinitionUpdates) {
- if (participantDefinitionUpdate.getParticipantType().equals(clParticipantType)) {
- participantDefinitionUpdate.getControlLoopElementDefinitionList().add(clDefinition);
- participantExists = true;
- }
- }
- if (!participantExists) {
- participantDefinitionUpdates.add(
- getParticipantDefinition(clDefinition, clParticipantType, controlLoopElementDefinitionList));
- }
- }
- }
-
- private static ParticipantDefinition getParticipantDefinition(ControlLoopElementDefinition clDefinition,
- ToscaConceptIdentifier clParticipantType,
- List<ControlLoopElementDefinition> controlLoopElementDefinitionList) {
- var participantDefinition = new ParticipantDefinition();
- participantDefinition.setParticipantType(clParticipantType);
- controlLoopElementDefinitionList.add(clDefinition);
- participantDefinition.setControlLoopElementDefinitionList(controlLoopElementDefinitionList);
- return participantDefinition;
- }
-}
diff --git a/common/src/main/resources/tosca/ApplicationServiceDescriptorTypes.yaml b/common/src/main/resources/tosca/ApplicationServiceDescriptorTypes.yaml
deleted file mode 100644
index ad16173b9..000000000
--- a/common/src/main/resources/tosca/ApplicationServiceDescriptorTypes.yaml
+++ /dev/null
@@ -1,74 +0,0 @@
-# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation.
-# ================================================================================
-# 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-tosca_definitions_version: tosca_simple_yaml_1_3
-node_types:
- org.oran.asd.DeploymentItem:
- version: 1.0.1
- derived_from: org.onap.policy.clamp.controlloop.KubernetesControlLoopElement
- properties:
- deployemntItemId:
- type: onap.datatypes.ToscaConceptIdentifier
- required: true
- description: The identifier of this deployment item
- artifactId:
- type: onap.datatypes.ToscaConceptIdentifier
- required: true
- description: Reference to a DeploymentArtifact
- lifecycleParameters:
- type: string
- required: false
- description: List of parameters that can be overridden at deployment time
- (e.g. values for values.yaml in the chart this item references)
- org.oran.asd.ASD:
- version: 1.0.1
- derived_from: org.onap.policy.clamp.controlloop.ControlLoop
- properties:
- asdId:
- type: onap.datatypes.ToscaConceptIdentifier
- required: true
- description: The identifier of this deployment item
- asdSchemaVersion:
- type: onap.datatypes.ToscaConceptIdentifier
- required: true
- description: Reference to a DeploymentArtifact
- asdApplication:
- type: onap.datatypes.ToscaConceptIdentifier
- required: true
- description: Reference to a DeploymentArtifact
- asdApplicationInfoName:
- type: string
- required: false
- description: Human readable name for the Application service. Can change during the AS lifetime.
- asdExtCpd:
- type: string
- required: false
- description: Describes external interface(s) exposed by this AS enabling connection with a VL.
- (Similar to VnfExtCpd on VNF-D, but only describing L3 and above interfaces, since
- K8S can’t do <L3)
- enhancedClusterCapabilities:
- type: string
- required: false
- description: Describes expected capabilities of the target Kubernetes cluster to aid placement of the
- application service on a suitable cluster. Examples of capabilities are; required networking
- characteristics, Kubernetes API extensions or quantifiable node specific resources. This attribute
- can contain information complementing information provided in the referenced DeploymentArtifacts.
- Note; Modeling of enhancedClusterCapabilities is subject to standardization but is ffs. Alignment
- between O2-IMS and O2-DMS of these values is required.
-
-
-
diff --git a/common/src/main/resources/tosca/ControlLoopTOSCAServiceTemplateTypes.yaml b/common/src/main/resources/tosca/AutomationCompositionTOSCAServiceTemplateTypes.yaml
index a17cb7624..12f8cf7da 100644
--- a/common/src/main/resources/tosca/ControlLoopTOSCAServiceTemplateTypes.yaml
+++ b/common/src/main/resources/tosca/AutomationCompositionTOSCAServiceTemplateTypes.yaml
@@ -1,5 +1,5 @@
# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation.
+# Copyright (C) 2021-2022 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -27,7 +27,7 @@ data_types:
type: string
required: true
node_types:
- org.onap.policy.clamp.controlloop.ControlLoopElement:
+ org.onap.policy.clamp.acm.AutomationCompositionElement:
version: 1.0.1
derived_from: tosca.nodetypes.Root
properties:
@@ -36,13 +36,13 @@ node_types:
required: false
metadata:
common: true
- description: Specifies the organization that provides the control loop element
+ description: Specifies the organization that provides the automation composition element
participantType:
type: onap.datatypes.ToscaConceptIdentifier
required: true
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
required: false
@@ -50,10 +50,10 @@ node_types:
- greater_or_equal: 0
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 automation composition 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
required: false
@@ -98,8 +98,8 @@ node_types:
default: 0
metadata:
common: true
- description: The number of milliseconds that the start of this control loop element should be delayed
- org.onap.policy.clamp.controlloop.ControlLoop:
+ description: The number of milliseconds that the start of this automation composition element should be delayed
+ org.onap.policy.clamp.acm.AutomationComposition:
version: 1.0.1
derived_from: tosca.nodetypes.Root
properties:
@@ -108,7 +108,7 @@ node_types:
required: false
metadata:
common: true
- description: Specifies the organization that provides the control loop element
+ description: Specifies the organization that provides the automation composition element
elements:
type: list
required: true
@@ -116,5 +116,5 @@ node_types:
common: true
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 automation composition element definitions that make up this automation composition definition
diff --git a/common/src/main/resources/tosca/CdsControlLoopElementType.yaml b/common/src/main/resources/tosca/CdsAutomationCompositionElementType.yaml
index c2fc66a6a..de195ac84 100644
--- a/common/src/main/resources/tosca/CdsControlLoopElementType.yaml
+++ b/common/src/main/resources/tosca/CdsAutomationCompositionElementType.yaml
@@ -1,5 +1,5 @@
# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation.
+# Copyright (C) 2021-2022 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,11 +17,11 @@
# ============LICENSE_END=========================================================
tosca_definitions_version: tosca_simple_yaml_1_3
node_types:
- 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:
cdsBlueprint:
type: string
required: true
- description: The CDS blueprint that this control loop element is managing.
+ description: The CDS blueprint that this automation composition element is managing.
diff --git a/common/src/main/resources/tosca/DcaeControlLoopElementType.yaml b/common/src/main/resources/tosca/DcaeControlLoopElementType.yaml
deleted file mode 100644
index acf91bb92..000000000
--- a/common/src/main/resources/tosca/DcaeControlLoopElementType.yaml
+++ /dev/null
@@ -1,51 +0,0 @@
-# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation.
-# ================================================================================
-# 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.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-tosca_definitions_version: tosca_simple_yaml_1_3
-
-data_types:
- org.onap.datatypes.policy.clamp.controlloop.DCAEControlLoopElementConsulInfo:
- version: 1.0.0
- derived_from: tosca.datatypes.Root
- properties:
- consulUrl:
- name: consulUrl
- type: string
- typeVersion: 0.0.0
- required: true
- description: Consul url for this entry
- consulBody:
- name: consulBody
- type: string
- typeVersion: 0.0.0
- required: true
- description: Body of Consul entry
-node_types:
- org.onap.policy.clamp.controlloop.DCAEMicroserviceControlLoopElement:
- version: 1.0.1
- derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
- properties:
- dcaeBlueprint:
- type: string
- required: true
- description: The DCAE blueprint for the DCAE microservice this control loop element is managing.
- consulInfo:
- type: list
- required: false
- entry_schema:
- type: org.onap.datatypes.policy.clamp.controlloop.DCAEControlLoopElementConsulInfo
- description: The information to be sent to Consul for the microservice this control loop element is managing.
diff --git a/common/src/main/resources/tosca/HttpControlLoopElementType.yaml b/common/src/main/resources/tosca/HttpAutomationCompositionElementType.yaml
index fd37040c6..f1ea39d61 100644
--- a/common/src/main/resources/tosca/HttpControlLoopElementType.yaml
+++ b/common/src/main/resources/tosca/HttpAutomationCompositionElementType.yaml
@@ -1,5 +1,5 @@
# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation.
+# Copyright (C) 2021-2022 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
# ============LICENSE_END=========================================================
tosca_definitions_version: tosca_simple_yaml_1_3
data_types:
- 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:
@@ -46,7 +46,7 @@ data_types:
constraints:
- in_range: [100, 599]
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:
@@ -54,17 +54,18 @@ data_types:
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
node_types:
- 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
@@ -80,6 +81,7 @@ node_types:
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
diff --git a/common/src/main/resources/tosca/KubernetesControlLoopElementType.yaml b/common/src/main/resources/tosca/KubernetesAutomationCompositionElementType.yaml
index 86a8ce197..2b60b679e 100644
--- a/common/src/main/resources/tosca/KubernetesControlLoopElementType.yaml
+++ b/common/src/main/resources/tosca/KubernetesAutomationCompositionElementType.yaml
@@ -1,5 +1,5 @@
# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation.
+# Copyright (C) 2021-2022 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,7 +17,7 @@
# ============LICENSE_END=========================================================
tosca_definitions_version: tosca_simple_yaml_1_3
data_types:
- org.onap.datatypes.policy.clamp.controlloop.kubernetesControlLoopElement.Chart:
+ org.onap.datatypes.policy.clamp.acm.kubernetesAutomationCompositionElement.Chart:
version: 1.0.0
derived_from: tosca.datatypes.Root
properties:
@@ -45,12 +45,12 @@ data_types:
type: string
description: A map of override settings for parameters in the chart
node_types:
- org.onap.policy.clamp.controlloop.KubernetesControlLoopElement:
+ org.onap.policy.clamp.acm.KubernetesAutomationCompositionElement:
version: 1.0.1
- derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
+ derived_from: org.onap.policy.clamp.acm.AutomationCompositionElement
properties:
chart:
- type: org.onap.datatypes.policy.clamp.controlloop.kubernetesControlLoopElement.Chart
+ type: org.onap.datatypes.policy.clamp.acm.kubernetesAutomationCompositionElement.Chart
typeVersion: 1.0.0
required: true
description: The helm chart for the microservice
diff --git a/common/src/main/resources/tosca/PolicyControlLoopElementType.yaml b/common/src/main/resources/tosca/PolicyAutomationCompositionElementType.yaml
index b4631ba14..3968b3471 100644
--- a/common/src/main/resources/tosca/PolicyControlLoopElementType.yaml
+++ b/common/src/main/resources/tosca/PolicyAutomationCompositionElementType.yaml
@@ -1,5 +1,5 @@
# ============LICENSE_START=======================================================
-# Copyright (C) 2021 Nordix Foundation.
+# Copyright (C) 2021-2022 Nordix Foundation.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,20 +17,20 @@
# ============LICENSE_END=========================================================
tosca_definitions_version: tosca_simple_yaml_1_3
node_types:
- 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:
policyType:
type: onap.datatypes.ToscaConceptIdentifier
required: true
- description: The policy type of the policy that this control loop element is managing
+ description: The policy type of the policy that this automation composition element is managing
policyId:
type: onap.datatypes.ToscaConceptIdentifier
required: false
- description: The policy that this control loop element is managing, if the policy ID is specified, the policy
- is either already in the Policy Framework database or is specified in the "policies" part of the
- TOSCA service template of the Control Loop definition
+ description: The policy that this automation composition element is managing, if the policy ID is specified, the
+ policy is either already in the Policy Framework database or is specified in the "policies" part of
+ the TOSCA service template of the Automation Composition definition
pdpGroup:
type: string
required: false
@@ -40,4 +40,5 @@ node_types:
pdpType:
type: string
required: true
- description: The PDP type to which the policy will run on. This parameter is used when the policy is deployed to PAP. \ No newline at end of file
+ description: The PDP type to which the policy will run on. This parameter is used when the policy is deployed to
+ PAP. \ No newline at end of file