diff options
390 files changed, 17143 insertions, 1853 deletions
diff --git a/.gitignore b/.gitignore index 5cf5bb213b..631577ffa1 100644 --- a/.gitignore +++ b/.gitignore @@ -160,3 +160,4 @@ common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-cor /sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default/logback.xml /utils/webseal-simulator/sdc-simulator/chef-repo/cookbooks/sdc-simulator/files/default/logback.xml +sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/testSuites/* diff --git a/asdc-tests/pom.xml b/asdc-tests/pom.xml index de800cfcf7..266ad36903 100644 --- a/asdc-tests/pom.xml +++ b/asdc-tests/pom.xml @@ -226,8 +226,8 @@ </dependency> <dependency> - <groupId>com.thinkaurelius.titan</groupId> - <artifactId>titan-cassandra</artifactId> + <groupId>org.openecomp.sdc.sdc-titan-cassandra</groupId> + <artifactId>sdc-titan-cassandra</artifactId> <version>${titan.version}</version> <scope>compile</scope> <exclusions> diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java index 7e363202bb..1f578d108c 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java @@ -311,7 +311,7 @@ public class ArtifactServletTest extends ComponentBaseTest { httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate); httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId()); if (addMd5Header) { - httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody)); + httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody)); } StringEntity input = new StringEntity(jsonBody); input.setContentType("application/json"); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java index e4c89bee94..65c0bba6a0 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java @@ -620,7 +620,7 @@ artifact.setArtifactLabel("configure");*/ httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate); httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId()); if (addMd5Header) { - httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody)); + httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody)); } StringEntity input = new StringEntity(jsonBody); input.setContentType("application/json"); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java index 4a4e5a4529..45dbf315fb 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/devCI/CRUDExternalAPI.java @@ -3474,7 +3474,7 @@ public class CRUDExternalAPI extends ComponentBaseTest { httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate); httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId()); if (addMd5Header) { - httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody)); + httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody)); } StringEntity input = new StringEntity(jsonBody); input.setContentType("application/json"); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java index 255dfd9de2..4dbc374e35 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java @@ -213,7 +213,7 @@ public class DistributionDownloadArtifactTest extends ComponentBaseTest { AssertJUnit.assertEquals(artifactDetails.getPayload(), Base64.encodeBase64String(actualContents.getBytes())); // validating checksum - String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(actualContents.getBytes()); + String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(actualContents.getBytes()); AssertJUnit.assertEquals(expectedPayloadChecksum, actualPayloadChecksum); // validate audit @@ -381,7 +381,7 @@ public class DistributionDownloadArtifactTest extends ComponentBaseTest { // validating checksum byte[] bytes = actualContents.getBytes(); - String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(bytes); + String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(bytes); assertEquals(expectedPayloadChecksum, actualPayloadChecksum); // validating valid zip @@ -576,7 +576,7 @@ public class DistributionDownloadArtifactTest extends ComponentBaseTest { // validating checksum byte[] bytes = actualContents.getBytes(); - String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(bytes); + String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(bytes); AssertJUnit.assertEquals(expectedPayloadChecksum, actualPayloadChecksum); // validating valid zip diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java index 56841e1c5d..61c846242c 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java @@ -184,7 +184,7 @@ public class ImportNewResourceCITest extends ComponentBaseTest { + " \"icon\": \"router\",\r\n" + " \"tags\": [\r\n" + " \"importResource4test\"\r\n" + " ],\r\n" + " \"payloadData\": \"" + encodedPayload + "\"\r\n" + "}"; - String md5 = GeneralUtility.calculateMD5ByString(json); + String md5 = GeneralUtility.calculateMD5Base64EncodedByString(json); Map<String, String> headers = new HashMap<String, String>(); headers.put(Constants.MD5_HEADER, md5); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java index b17deb3756..a47477f363 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java @@ -86,7 +86,7 @@ public class ResourceRestUtils extends BaseRestUtils { Gson gson = new Gson(); String userBodyJson = gson.toJson(resourceDetails); - String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson); headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5); HttpRequest http = new HttpRequest(); // System.out.println(url); @@ -508,7 +508,7 @@ public class ResourceRestUtils extends BaseRestUtils { Gson gson = new Gson(); String userBodyJson = gson.toJson(resourceDetails); - String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson); headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5); HttpRequest http = new HttpRequest(); RestResponse updateResourceResponse = http.httpSendPut(url, userBodyJson, headersMap); diff --git a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java index 10f573cf0e..19d7d728fe 100644 --- a/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java +++ b/asdc-tests/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java @@ -48,7 +48,7 @@ public class ResourceRestUtilsExternalAPI extends BaseRestUtils { Gson gson = new Gson(); String userBodyJson = gson.toJson(resourceDetails); - String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson); headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5); headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader); headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci"); diff --git a/asdctool/pom.xml b/asdctool/pom.xml index 633360d8f8..410e852f8f 100644 --- a/asdctool/pom.xml +++ b/asdctool/pom.xml @@ -269,8 +269,8 @@ </dependency> <dependency> - <groupId>com.thinkaurelius.titan</groupId> - <artifactId>titan-cassandra</artifactId> + <groupId>org.openecomp.sdc.sdc-titan-cassandra</groupId> + <artifactId>sdc-titan-cassandra</artifactId> <version>${titan.version}</version> <scope>compile</scope> <exclusions> diff --git a/build-tools/pom.xml b/build-tools/pom.xml index 952ebef380..24a6742b71 100644 --- a/build-tools/pom.xml +++ b/build-tools/pom.xml @@ -15,21 +15,4 @@ <version>1.1.0-SNAPSHOT</version> </parent> - <properties> - <pmd.version>5.8.1</pmd.version> - </properties> - - <dependencies> - <dependency> - <groupId>net.sourceforge.pmd</groupId> - <artifactId>pmd-core</artifactId> - <version>${pmd.version}</version> - </dependency> - <dependency> - <groupId>net.sourceforge.pmd</groupId> - <artifactId>pmd-java</artifactId> - <version>${pmd.version}</version> - </dependency> - </dependencies> - </project>
\ No newline at end of file diff --git a/catalog-be/pom.xml b/catalog-be/pom.xml index 6d34402ac5..8b638e84d7 100644 --- a/catalog-be/pom.xml +++ b/catalog-be/pom.xml @@ -320,9 +320,8 @@ </dependency> <dependency> - <groupId>com.thinkaurelius.titan</groupId> - <artifactId>titan-cassandra</artifactId> - <!--<artifactId>asdc-titan-cassandra</artifactId>--> + <groupId>org.openecomp.sdc.sdc-titan-cassandra</groupId> + <artifactId>sdc-titan-cassandra</artifactId> <version>${titan.version}</version> <scope>compile</scope> <exclusions> diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java index 61f0c02d10..74bb55b63d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java @@ -355,7 +355,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { } byte[] decodedPayload = artifactDefinition.getPayloadData(); artifactDefinition.setEsId(artifactDefinition.getUniqueId()); - artifactDefinition.setArtifactChecksum(GeneralUtility.calculateMD5ByByteArray(decodedPayload)); + artifactDefinition.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(decodedPayload)); return lockComponentAndUpdateArtifact(component.getUniqueId(), artifactDefinition, AuditingActionEnum.ARTIFACT_PAYLOAD_UPDATE, artifactDefinition.getUniqueId(), user, component.getComponentType(), component, decodedPayload, null, null, shouldLock, inTransaction); @@ -1007,7 +1007,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { private Either<Boolean, ResponseFormat> validateMd5(String origMd5, String originData, byte[] payload, ArtifactOperationInfo operation) { if (origMd5 != null) { - String encodeBase64Str = GeneralUtility.calculateMD5ByString(originData); + String encodeBase64Str = GeneralUtility.calculateMD5Base64EncodedByString(originData); if (false == encodeBase64Str.equals(origMd5)) { log.debug("The calculated md5 is different then the received one"); @@ -2754,7 +2754,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return Either.right(responseFormat); } - String checkSum = GeneralUtility.calculateMD5ByByteArray(decodedPayload); + String checkSum = GeneralUtility.calculateMD5Base64EncodedByByteArray(decodedPayload); artifactInfo.setArtifactChecksum(checkSum); log.trace("Calculated checksum, base64 payload: {}, checksum: {}", payload, checkSum); @@ -3642,7 +3642,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return Either.right(artifactDataRes.right().value()); } - String newCheckSum = GeneralUtility.calculateMD5ByByteArray(artifactData.getDataAsArray()); + String newCheckSum = GeneralUtility.calculateMD5Base64EncodedByByteArray(artifactData.getDataAsArray()); String oldCheckSum; String esArtifactId = artifactDefinition.getEsId(); Either<ESArtifactData, CassandraOperationStatus> artifactfromES; @@ -3657,7 +3657,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { return Either.right(componentsUtils.getResponseFormatByArtifactId(actionStatus, artifactDefinition.getArtifactDisplayName())); } esArtifactData = artifactfromES.left().value(); - oldCheckSum = GeneralUtility.calculateMD5ByByteArray(esArtifactData.getDataAsArray()); + oldCheckSum = GeneralUtility.calculateMD5Base64EncodedByByteArray(esArtifactData.getDataAsArray()); } else { oldCheckSum = artifactDefinition.getArtifactChecksum(); @@ -4696,7 +4696,7 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { try { for (ArtifactDefinition artifact : artifactsToHandle) { originData = buildJsonStringForCsarVfcArtifact(artifact); - origMd5 = GeneralUtility.calculateMD5ByString(originData); + origMd5 = GeneralUtility.calculateMD5Base64EncodedByString(originData); actionResult = handleArtifactRequest(component.getUniqueId(), user.getUserId(), componentType, operation, artifact.getUniqueId(), artifact, origMd5, originData, null, null, null, null, shouldLock, inTransaction); if (actionResult.isRight()) { log.debug("Failed to upload artifact to component with type {} and name {}. Status is {}. ", componentType, component.getName(), actionResult.right().value()); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CsarValidationUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CsarValidationUtils.java index 3d280ab7ca..8b0c6fa8bf 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CsarValidationUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/CsarValidationUtils.java @@ -20,11 +20,16 @@ package org.openecomp.sdc.be.components.impl; +import static org.openecomp.sdc.be.tosca.CsarUtils.VF_NODE_TYPE_ARTIFACTS_PATH_PATTERN; + import java.io.ByteArrayInputStream; import java.io.IOException; +import java.io.StringReader; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Properties; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -55,7 +60,13 @@ public class CsarValidationUtils { private static final String NEW_LINE_DELM = "\n"; - public final static String TOSCA_METADATA_FILE = "TOSCA-Metadata/TOSCA.meta"; + //public final static String TOSCA_METADATA_FILE = "TOSCA-Metadata/TOSCA.meta"; + public final static String TOSCA_METADATA = "TOSCA-Metadata"; + public final static String TOSCA_FILE = "TOSCA.meta"; + public final static String DEL_PATTERN = "([/\\\\]+)"; + public static final String TOSCA_METADATA_PATH_PATTERN = TOSCA_METADATA + + // Artifact Group (i.e Deployment/Informational) + DEL_PATTERN + TOSCA_FILE; public static final String TOSCA_META_ENTRY_DEFINITIONS = "Entry-Definitions"; @@ -134,10 +145,19 @@ public class CsarValidationUtils { if (validateStatus.isRight()) { return Either.right(validateStatus.right().value()); } - byte[] toscaMetaBytes = csar.get(TOSCA_METADATA_FILE); + Pattern pattern = Pattern.compile(TOSCA_METADATA_PATH_PATTERN); + Optional<String> keyOp = csar.keySet().stream().filter(k -> pattern.matcher(k).matches()).findAny(); + if(!keyOp.isPresent()){ + log.debug("TOSCA-Metadata/TOSCA.meta file is not in expected key-value form in csar, csar ID {}", csarUUID); + BeEcompErrorManager.getInstance().logInternalDataError("TOSCA-Metadata/TOSCA.meta file not in expected key-value form in CSAR with id " + csarUUID, "CSAR internals are invalid", ErrorSeverity.ERROR); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.CSAR_INVALID_FORMAT, csarUUID)); + } + byte[] toscaMetaBytes = csar.get(keyOp.get()); Properties props = new Properties(); try { - props.load(new ByteArrayInputStream(toscaMetaBytes)); + //props.load(new ByteArrayInputStream(toscaMetaBytes)); + String propStr = new String(toscaMetaBytes); + props.load(new StringReader(propStr.replace("\\","\\\\"))); } catch (IOException e) { log.debug("TOSCA-Metadata/TOSCA.meta file is not in expected key-value form in csar, csar ID {}", csarUUID, e); BeEcompErrorManager.getInstance().logInternalDataError("TOSCA-Metadata/TOSCA.meta file not in expected key-value form in CSAR with id " + csarUUID, "CSAR internals are invalid", ErrorSeverity.ERROR); @@ -145,13 +165,16 @@ public class CsarValidationUtils { } String yamlFileName = props.getProperty(TOSCA_META_ENTRY_DEFINITIONS); - - if (!csar.containsKey(yamlFileName)) { + String[] ops = yamlFileName.split(DEL_PATTERN); + List<String> list = Arrays.asList(ops); + String result = list.stream().map(x -> x).collect(Collectors.joining(DEL_PATTERN)); + keyOp = csar.keySet().stream().filter(k -> Pattern.compile(result).matcher(k).matches()).findAny(); + if(!keyOp.isPresent()){ log.debug("Entry-Definitions entry not found in TOSCA-Metadata/TOSCA.meta file, csar ID {}", csarUUID); BeEcompErrorManager.getInstance().logInternalDataError("Entry-Definitions entry not found in TOSCA-Metadata/TOSCA.meta file in CSAR with id " + csarUUID, "CSAR internals are invalid", ErrorSeverity.ERROR); return Either.right(componentsUtils.getResponseFormat(ActionStatus.YAML_NOT_FOUND_IN_CSAR, csarUUID, yamlFileName)); } - + log.trace("Found Entry-Definitions property in TOSCA-Metadata/TOSCA.meta, Entry-Definitions: {}, CSAR id: {}", yamlFileName, csarUUID); byte[] yamlFileBytes = csar.get(yamlFileName); if (yamlFileBytes == null) { @@ -205,8 +228,16 @@ public class CsarValidationUtils { } private static Either<Boolean, ResponseFormat> validateTOSCAMetadataFile(Map<String, byte[]> csar, String csarUUID, ComponentsUtils componentsUtils) { + + Pattern pattern = Pattern.compile(TOSCA_METADATA_PATH_PATTERN); + Optional<String> keyOp = csar.keySet().stream().filter(k -> pattern.matcher(k).matches()).findAny(); + if(!keyOp.isPresent()){ + log.debug("TOSCA-Metadata/TOSCA.meta file is not in expected key-value form in csar, csar ID {}", csarUUID); + BeEcompErrorManager.getInstance().logInternalDataError("TOSCA-Metadata/TOSCA.meta file not in expected key-value form in CSAR with id " + csarUUID, "CSAR internals are invalid", ErrorSeverity.ERROR); + return Either.right(componentsUtils.getResponseFormat(ActionStatus.CSAR_INVALID_FORMAT, csarUUID)); + } - byte[] toscaMetaBytes = csar.get(TOSCA_METADATA_FILE); + byte[] toscaMetaBytes = csar.get(keyOp.get()); String toscaMetadata = new String(toscaMetaBytes); String[] splited = toscaMetadata.split(NEW_LINE_DELM); if (splited == null || splited.length < TOSCA_METADATA_FIELDS.length) { @@ -283,12 +314,16 @@ public class CsarValidationUtils { ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.CSAR_INVALID, csarUUID); return Either.right(responseFormat); } - if (!csar.containsKey(TOSCA_METADATA_FILE)) { + + Pattern pattern = Pattern.compile(TOSCA_METADATA_PATH_PATTERN); + Optional<String> keyOp = csar.keySet().stream().filter(k -> pattern.matcher(k).matches()).findAny(); + if(!keyOp.isPresent()){ + log.debug("TOSCA-Metadata/TOSCA.meta file not found in csar, csar ID {}", csarUUID); BeEcompErrorManager.getInstance().logInternalDataError("TOSCA-Metadata/TOSCA.meta file not found in CSAR with id " + csarUUID, "CSAR structure is invalid", ErrorSeverity.ERROR); return Either.right(componentsUtils.getResponseFormat(ActionStatus.CSAR_INVALID, csarUUID)); } - byte[] toscaMetaBytes = csar.get(TOSCA_METADATA_FILE); + byte[] toscaMetaBytes = csar.get(keyOp.get()); // && exchanged for || if (toscaMetaBytes == null || toscaMetaBytes.length == 0) { log.debug("TOSCA-Metadata/TOSCA.meta file not found in csar, csar ID {}", csarUUID); @@ -307,7 +342,7 @@ public class CsarValidationUtils { return Either.right(toscaYamlRes.right().value()); } - String newCheckSum = GeneralUtility.calculateMD5ByByteArray(toscaYamlRes.left().value().getRight().getBytes()); + String newCheckSum = GeneralUtility.calculateMD5Base64EncodedByByteArray(toscaYamlRes.left().value().getRight().getBytes()); return Either.left(newCheckSum); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java index 8fd28e1224..ba26576648 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java @@ -82,12 +82,12 @@ import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.ComponentInstanceInput; import org.openecomp.sdc.be.model.ComponentInstanceProperty; import org.openecomp.sdc.be.model.ComponentParametersView; +import org.openecomp.sdc.be.model.CsarInfo; import org.openecomp.sdc.be.model.DataTypeDefinition; import org.openecomp.sdc.be.model.GroupDefinition; import org.openecomp.sdc.be.model.GroupProperty; import org.openecomp.sdc.be.model.GroupTypeDefinition; import org.openecomp.sdc.be.model.HeatParameterDefinition; -import org.openecomp.sdc.be.model.CsarInfo; import org.openecomp.sdc.be.model.InputDefinition; import org.openecomp.sdc.be.model.InterfaceDefinition; import org.openecomp.sdc.be.model.LifeCycleTransitionEnum; @@ -148,13 +148,13 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.context.WebApplicationContext; import org.yaml.snakeyaml.DumperOptions; import org.yaml.snakeyaml.Yaml; +import org.yaml.snakeyaml.parser.ParserException; import com.google.gson.Gson; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import fj.data.Either; -import org.yaml.snakeyaml.parser.ParserException; @org.springframework.stereotype.Component("resourceBusinessLogic") public class ResourceBusinessLogic extends ComponentBusinessLogic { @@ -624,7 +624,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } preparedResource = createResourcesInstancesEither.left().value(); - createResourcesInstancesEither = createResourceInstancesRelations(csarInfo.getModifier(), yamlFileName, preparedResource, instances, inTransaction, shouldLock); + createResourcesInstancesEither = createResourceInstancesRelations(csarInfo.getModifier(), yamlFileName, preparedResource, instances); if (createResourcesInstancesEither.isRight()) { log.debug("failed to create relation between resource instances status is {}", createResourcesInstancesEither.right().value()); result = Either.right(createResourcesInstancesEither.right().value()); @@ -779,7 +779,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { if (!foundArtifact.getArtifactChecksum().equals(currNewArtifact.getArtifactChecksum())) { foundArtifact.setPayload(currNewArtifact.getPayloadData()); foundArtifact.setPayloadData(Base64.encodeBase64String(currNewArtifact.getPayloadData())); - foundArtifact.setArtifactChecksum(GeneralUtility.calculateMD5ByByteArray(currNewArtifact.getPayloadData())); + foundArtifact.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(currNewArtifact.getPayloadData())); artifactsToUpdate.add(foundArtifact); } existingArtifacts.remove(foundArtifact.getArtifactLabel()); @@ -1461,7 +1461,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { String nameWithouNamespacePrefix = nodeName.substring(Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX.length()); String[] findTypes = nameWithouNamespacePrefix.split("\\."); String resourceType = findTypes[0]; - return resourceVfName + "-" + nameWithouNamespacePrefix.substring(resourceType.length() + 1); + return resourceVfName + "-" + nameWithouNamespacePrefix.substring(resourceType.length() + 1) + "Cvfc"; } private Either<Resource, ResponseFormat> createResourceAndRIsFromYaml(String yamlName, Resource resource, ParsedToscaYamlInfo parsedToscaYamlInfo, AuditingActionEnum actionEnum, boolean isNormative, @@ -1633,7 +1633,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { List<GroupDefinition> groupsToCreate = new ArrayList<GroupDefinition>(); if (groupsFromResource != null && !groupsFromResource.isEmpty()) { for (GroupDefinition group : groupsAsList) { - Optional<GroupDefinition> op = groupsFromResource.stream().filter(p -> p.getName().equals(group.getName())).findAny(); + Optional<GroupDefinition> op = groupsFromResource.stream().filter(p -> p.getName().equalsIgnoreCase(group.getName())).findAny(); if (op.isPresent()) { GroupDefinition groupToUpdate = op.get(); groupToUpdate.setMembers(group.getMembers()); @@ -1643,7 +1643,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } } for (GroupDefinition group : groupsFromResource) { - Optional<GroupDefinition> op = groupsAsList.stream().filter(p -> p.getName().equals(group.getName())).findAny(); + Optional<GroupDefinition> op = groupsAsList.stream().filter(p -> p.getName().equalsIgnoreCase(group.getName())).findAny(); if (!op.isPresent() && (group.getArtifacts() == null || group.getArtifacts().isEmpty())) { groupsToDelete.add(group); @@ -1651,7 +1651,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } } else - groupsToCreate.addAll(groupsAsList); + groupsToCreate.addAll(groupsAsList); Either<List<GroupDefinition>, ResponseFormat> prepareGroups = null; if (!groupsToCreate.isEmpty()) { @@ -1886,7 +1886,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } resource = createResourcesInstancesEither.left().value(); log.debug("************* Going to create all relations {}", yamlName); - createResourcesInstancesEither = createResourceInstancesRelations(csarInfo.getModifier(), yamlName, resource, uploadComponentInstanceInfoMap, true, false); + createResourcesInstancesEither = createResourceInstancesRelations(csarInfo.getModifier(), yamlName, resource, uploadComponentInstanceInfoMap); log.debug("************* Finished to create all relations {}", yamlName); @@ -2087,7 +2087,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { String jsonStr = gson.toJson(json); - String origMd5 = GeneralUtility.calculateMD5ByString(jsonStr); + String origMd5 = GeneralUtility.calculateMD5Base64EncodedByString(jsonStr); ArtifactDefinition artifactDefinitionFromJson = RepresentationUtils.convertJsonToArtifactDefinition(jsonStr, ArtifactDefinition.class); String artifactUniqueId = artifactDefinitionFromJson == null ? null : artifactDefinitionFromJson.getUniqueId(); Either<Either<ArtifactDefinition, Operation>, ResponseFormat> uploadArtifactToService = artifactsBusinessLogic.validateAndHandleArtifact(resource.getUniqueId(), ComponentTypeEnum.RESOURCE, operation, artifactUniqueId, @@ -2416,7 +2416,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { for (ArtifactDefinition createdArtifact : createdDeplymentArtifactsAfterDelete) { if (artifactTemplate.getFileName().equalsIgnoreCase(createdArtifact.getArtifactName())) { arifactsUids.add(createdArtifact.getUniqueId()); - arifactsUuids.add(createdArtifact.getUniqueId()); + arifactsUuids.add(createdArtifact.getArtifactUUID()); isCreate = false; String heatEnvId = checkAndGetHeatEnvId(createdArtifact); if (!heatEnvId.isEmpty()) { @@ -2436,7 +2436,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { for (ArtifactDefinition createdNewArtifact : createdNewArtifacts) { if (artifactTemplate.getFileName().equalsIgnoreCase(createdNewArtifact.getArtifactName())) { arifactsUids.add(createdNewArtifact.getUniqueId()); - arifactsUuids.add(createdNewArtifact.getUniqueId()); + arifactsUuids.add(createdNewArtifact.getArtifactUUID()); isCreate = false; String heatEnvId = checkAndGetHeatEnvId(createdNewArtifact); if (!heatEnvId.isEmpty()) { @@ -2455,7 +2455,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } ArtifactDefinition createdArtifact = createArtifactEither.left().value(); arifactsUids.add(createdArtifact.getUniqueId()); - arifactsUuids.add(createdArtifact.getUniqueId()); + arifactsUuids.add(createdArtifact.getArtifactUUID()); ArtifactTypeEnum artifactType = ArtifactTypeEnum.findType(createdArtifact.getArtifactType()); if (artifactType == ArtifactTypeEnum.HEAT || artifactType == ArtifactTypeEnum.HEAT_NET || artifactType == ArtifactTypeEnum.HEAT_VOL) { Either<ArtifactDefinition, ResponseFormat> createHeatEnvPlaceHolder = artifactsBusinessLogic.createHeatEnvPlaceHolder(createdArtifact, ArtifactsBusinessLogic.HEAT_VF_ENV_NAME, resource.getUniqueId(), NodeTypeEnum.Resource, @@ -3532,7 +3532,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return Either.left(artifactTemplateInfoList); } - private Either<Resource, ResponseFormat> createResourceInstancesRelations(User user, String yamlName, Resource resource, Map<String, UploadComponentInstanceInfo> uploadResInstancesMap, boolean inTransaction, boolean needLock) { + private Either<Resource, ResponseFormat> createResourceInstancesRelations(User user, String yamlName, Resource resource, Map<String, UploadComponentInstanceInfo> uploadResInstancesMap) { log.debug("createResourceInstancesRelations try to create relations "); List<ComponentInstance> componentInstancesList = resource.getComponentInstances(); if (uploadResInstancesMap == null) { @@ -3590,7 +3590,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return Either.right(responseFormat); } String resourceInstanceId = currentCompInstance.getUniqueId(); - Resource originResource = null; + Resource originResource; if (!originCompMap.containsKey(currentCompInstance.getComponentUid())) { Either<Resource, StorageOperationStatus> getOriginResourceRes = toscaOperationFacade.getToscaFullElement(currentCompInstance.getComponentUid()); if (getOriginResourceRes.isRight()) { @@ -3603,38 +3603,10 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } else { originResource = originCompMap.get(currentCompInstance.getComponentUid()); } - if (originResource.getCapabilities() != null && !originResource.getCapabilities().isEmpty()) { - Map<String, List<CapabilityDefinition>> originCapabilities ; - if (MapUtils.isNotEmpty(uploadComponentInstanceInfo.getCapabilitiesNamesToUpdate()) && resource.getResourceType() == ResourceTypeEnum.CVFC) { - originCapabilities = new HashMap<>(); - originResource.getCapabilities().entrySet().stream().forEach(e ->{ - List<CapabilityDefinition> list = e.getValue().stream().map(l -> new CapabilityDefinition(l)).collect(Collectors.toList()); - originCapabilities.put(e.getKey(), list); - }); - for (List<CapabilityDefinition> capabilities : originCapabilities.values()) { - capabilities.stream().filter(c -> uploadComponentInstanceInfo.getCapabilitiesNamesToUpdate().containsKey(c.getName())).forEach(c -> c.setName(uploadComponentInstanceInfo.getCapabilitiesNamesToUpdate().get(c.getName()))); - } - }else{ - originCapabilities = originResource.getCapabilities(); - } - instCapabilties.put(currentCompInstance, originCapabilities); - } - if (originResource.getRequirements() != null && !originResource.getRequirements().isEmpty()) { - Map<String, List<RequirementDefinition>> originRequirements; - if (MapUtils.isNotEmpty(uploadComponentInstanceInfo.getRequirementsNamesToUpdate()) && resource.getResourceType() == ResourceTypeEnum.CVFC) { - originRequirements = new HashMap<>(); - originResource.getRequirements().entrySet().stream().forEach(e ->{ - List<RequirementDefinition> list = e.getValue().stream().map(l -> new RequirementDefinition(l)).collect(Collectors.toList()); - originRequirements.put(e.getKey(), list); - }); - for (List<RequirementDefinition> requirements : originRequirements.values()) { - requirements.stream().filter(r -> uploadComponentInstanceInfo.getRequirementsNamesToUpdate().containsKey(r.getName())).forEach(r -> r.setName(uploadComponentInstanceInfo.getRequirementsNamesToUpdate().get(r.getName()))); - } - }else{ - originRequirements = originResource.getRequirements(); - } - instRequirements.put(currentCompInstance, originRequirements); - } + if (originResource.getCapabilities() != null && !originResource.getCapabilities().isEmpty()) + instCapabilties.put(currentCompInstance, originResource.getCapabilities()); + if (originResource.getRequirements() != null && !originResource.getRequirements().isEmpty()) + instRequirements.put(currentCompInstance, originResource.getRequirements()); if (originResource.getDeploymentArtifacts() != null && !originResource.getDeploymentArtifacts().isEmpty()) instDeploymentArtifacts.put(resourceInstanceId, originResource.getDeploymentArtifacts()); if (originResource.getArtifacts() != null && !originResource.getArtifacts().isEmpty()) @@ -3711,16 +3683,16 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { parametersView.setIgnoreCapabilities(false); parametersView.setIgnoreRequirements(false); - Either<Resource, StorageOperationStatus> eitherGerResource = toscaOperationFacade.getToscaElement(resource.getUniqueId(), parametersView); + Either<Resource, StorageOperationStatus> eitherGetResource = toscaOperationFacade.getToscaElement(resource.getUniqueId(), parametersView); - if (eitherGerResource.isRight()) { - ResponseFormat responseFormat = componentsUtils.getResponseFormatByResource(componentsUtils.convertFromStorageResponse(eitherGerResource.right().value()), resource); + if (eitherGetResource.isRight()) { + ResponseFormat responseFormat = componentsUtils.getResponseFormatByResource(componentsUtils.convertFromStorageResponse(eitherGetResource.right().value()), resource); return Either.right(responseFormat); } - resource = eitherGerResource.left().value(); + resource = eitherGetResource.left().value(); for (Entry<String, UploadComponentInstanceInfo> entry : uploadResInstancesMap.entrySet()) { UploadComponentInstanceInfo uploadComponentInstanceInfo = entry.getValue(); @@ -3755,15 +3727,88 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { log.debug("************* in create relations, getResource start"); - eitherGerResource = toscaOperationFacade.getToscaElement(resource.getUniqueId()); + eitherGetResource = toscaOperationFacade.getToscaElement(resource.getUniqueId()); log.debug("************* in create relations, getResource end"); - if (eitherGerResource.isRight()) { - ResponseFormat responseFormat = componentsUtils.getResponseFormatByResource(componentsUtils.convertFromStorageResponse(eitherGerResource.right().value()), resource); + if (eitherGetResource.isRight()) { + ResponseFormat responseFormat = componentsUtils.getResponseFormatByResource(componentsUtils.convertFromStorageResponse(eitherGetResource.right().value()), resource); return Either.right(responseFormat); } - return Either.left(eitherGerResource.left().value()); + resource = eitherGetResource.left().value(); + if(resource.getResourceType() == ResourceTypeEnum.CVFC){ + eitherGetResource = updateCalculatedCapReqWithSubstitutionMappings(resource, uploadResInstancesMap); + if (eitherGetResource.isRight()) { + ResponseFormat responseFormat = componentsUtils.getResponseFormatByResource(componentsUtils.convertFromStorageResponse(eitherGetResource.right().value()), resource); + return Either.right(responseFormat); + } + } + return Either.left(eitherGetResource.left().value()); + } + + private Either<Resource, StorageOperationStatus> updateCalculatedCapReqWithSubstitutionMappings(Resource resource, Map<String, UploadComponentInstanceInfo> uploadResInstancesMap) { + Either<Resource, StorageOperationStatus> updateRes = null; + Map<ComponentInstance, Map<String, List<CapabilityDefinition>>> updatedInstCapabilities = new HashMap<>(); + Map<ComponentInstance, Map<String, List<RequirementDefinition>>> updatedInstRequirements = new HashMap<>(); + StorageOperationStatus status = toscaOperationFacade.deleteAllCalculatedCapabilitiesRequirements( resource.getUniqueId()); + if(status != StorageOperationStatus.OK && status != StorageOperationStatus.NOT_FOUND){ + log.debug("Failed to delete all calculated capabilities and requirements of resource {} upon update. Status is {}", resource.getUniqueId(), status); + updateRes = Either.right(status); + } + if(updateRes == null){ + fillUpdatedInstCapabilitiesRequirements(resource.getComponentInstances(), uploadResInstancesMap, updatedInstCapabilities, updatedInstRequirements); + status = toscaOperationFacade.associateCalculatedCapReq(updatedInstCapabilities, updatedInstRequirements, resource.getUniqueId()); + if (status != StorageOperationStatus.OK && status != StorageOperationStatus.NOT_FOUND) { + log.debug("Failed to associate capabilities and requirementss of resource {}, updated according to a substitution mapping. Status is {}", resource.getUniqueId(), status); + updateRes = Either.right(status); + } + } + if(updateRes == null){ + updateRes = toscaOperationFacade.getToscaElement( resource.getUniqueId()); + } + return updateRes; + } + + + private void fillUpdatedInstCapabilitiesRequirements(List<ComponentInstance> componentInstances, Map<String, UploadComponentInstanceInfo> uploadResInstancesMap, + Map<ComponentInstance, Map<String, List<CapabilityDefinition>>> updatedInstCapabilities, Map<ComponentInstance, Map<String, List<RequirementDefinition>>> updatedInstRequirements) { + + componentInstances.stream().forEach( i -> { + fillUpdatedInstCapabilities(updatedInstCapabilities, i, uploadResInstancesMap.get(i.getName()).getCapabilitiesNamesToUpdate()); + fillUpdatedInstRequirements(updatedInstRequirements, i, uploadResInstancesMap.get(i.getName()).getRequirementsNamesToUpdate()); + }); + } + + private void fillUpdatedInstRequirements(Map<ComponentInstance, Map<String, List<RequirementDefinition>>> updatedInstRequirements, ComponentInstance instance, Map<String, String> requirementsNamesToUpdate) { + Map<String, List<RequirementDefinition>> updatedRequirements = new HashMap<>(); + Set<String> updatedReqNames = new HashSet<>(); + if(MapUtils.isNotEmpty(requirementsNamesToUpdate)){ + for (Map.Entry<String, List<RequirementDefinition>> requirements : instance.getRequirements().entrySet()) { + updatedRequirements.put(requirements.getKey(), requirements.getValue().stream() + .filter(r -> requirementsNamesToUpdate.containsKey(r.getName()) && !updatedReqNames.contains(requirementsNamesToUpdate.get(r.getName()))) + .map(r ->{r.setParentName(r.getName()); r.setName(requirementsNamesToUpdate.get(r.getName())); updatedReqNames.add(r.getName()); return r;}) + .collect(Collectors.toList())); + } + } + if(MapUtils.isNotEmpty(updatedRequirements)){ + updatedInstRequirements.put(instance, updatedRequirements); + } + } + + private void fillUpdatedInstCapabilities(Map<ComponentInstance, Map<String, List<CapabilityDefinition>>> updatedInstCapabilties, ComponentInstance instance, Map<String, String> capabilitiesNamesToUpdate) { + Map<String, List<CapabilityDefinition>> updatedCapabilities = new HashMap<>(); + Set<String> updatedCapNames = new HashSet<>(); + if(MapUtils.isNotEmpty(capabilitiesNamesToUpdate)){ + for (Map.Entry<String, List<CapabilityDefinition>> requirements : instance.getCapabilities().entrySet()) { + updatedCapabilities.put(requirements.getKey(), requirements.getValue().stream() + .filter(c -> capabilitiesNamesToUpdate.containsKey(c.getName()) && !updatedCapNames.contains(capabilitiesNamesToUpdate.get(c.getName()))) + .map(c -> {c.setParentName(c.getName()); c.setName(capabilitiesNamesToUpdate.get(c.getName())); updatedCapNames.add(c.getName()); return c;}) + .collect(Collectors.toList())); + } + } + if(MapUtils.isNotEmpty(updatedCapabilities)){ + updatedInstCapabilties.put(instance, updatedCapabilities); + } } private ResponseFormat addRelationToRI(String yamlName, Resource resource, UploadComponentInstanceInfo nodesInfoValue, List<RequirementCapabilityRelDef> relations) { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java index 85db9a2c0f..89c444b6d9 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceBusinessLogic.java @@ -1616,7 +1616,7 @@ public class ServiceBusinessLogic extends ComponentBusinessLogic { vfModuleArtifactDefinition.setArtifactName(currVF.getNormalizedName() + "_modules.json"); vfModuleArtifactDefinition.setPayloadData(vfModulePayloadString); if (vfModulePayloadString != null) { - newCheckSum = GeneralUtility.calculateMD5ByByteArray(vfModulePayloadString.getBytes()); + newCheckSum = GeneralUtility.calculateMD5Base64EncodedByByteArray(vfModulePayloadString.getBytes()); } vfModuleArtifactDefinition.setArtifactChecksum(newCheckSum); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java index 32293ca9b7..1c2f175cfb 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/ArtifactExternalServlet.java @@ -166,7 +166,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { } else { Object representation = RepresentationUtils.toRepresentation(uploadArtifactEither.left().value()); Map<String, String> headers = new HashMap<>(); - headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5ByString((String) representation)); + headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5Base64EncodedByString((String) representation)); responseWrapper.setInnerElement(getComponentsUtils().getResponseFormat(ActionStatus.OK)); response = buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), representation, headers); } @@ -263,7 +263,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { } else { Object representation = RepresentationUtils.toRepresentation(uploadArtifactEither.left().value()); Map<String, String> headers = new HashMap<>(); - headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5ByString((String) representation)); + headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5Base64EncodedByString((String) representation)); responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); responseWrapper.setInnerElement(buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), representation, headers)); } @@ -363,7 +363,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { } else { Object representation = RepresentationUtils.toRepresentation(uploadArtifactEither.left().value()); Map<String, String> headers = new HashMap<>(); - headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5ByString((String) representation)); + headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5Base64EncodedByString((String) representation)); responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); responseWrapper.setInnerElement(buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), representation, headers)); } @@ -459,7 +459,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { } else { Object representation = RepresentationUtils.toRepresentation(uploadArtifactEither.left().value()); Map<String, String> headers = new HashMap<>(); - headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5ByString((String) representation)); + headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5Base64EncodedByString((String) representation)); responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); responseWrapper.setInnerElement(buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), representation, headers)); } @@ -550,7 +550,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { } else { Object representation = RepresentationUtils.toRepresentation(uploadArtifactEither.left().value()); Map<String, String> headers = new HashMap<>(); - headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5ByString((String) representation)); + headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5Base64EncodedByString((String) representation)); responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); responseWrapper.setInnerElement(buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), representation, headers)); } @@ -641,7 +641,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { } else { Object representation = RepresentationUtils.toRepresentation(uploadArtifactEither.left().value()); Map<String, String> headers = new HashMap<>(); - headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5ByString((String) representation)); + headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5Base64EncodedByString((String) representation)); responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); responseWrapper.setInnerElement(buildOkResponse(getComponentsUtils().getResponseFormat(ActionStatus.OK), representation, headers)); } @@ -719,7 +719,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { byte[] value = downloadComponentArtifactEither.left().value(); InputStream is = new ByteArrayInputStream(value); Map<String, String> headers = new HashMap<>(); - headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5ByByteArray(value)); + headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5Base64EncodedByByteArray(value)); responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); responseWrapper.setInnerElement(buildOkResponse(responseFormat, is, headers)); } @@ -800,7 +800,7 @@ public class ArtifactExternalServlet extends AbstractValidationsServlet { byte[] value = downloadResourceArtifactEither.left().value(); InputStream is = new ByteArrayInputStream(value); Map<String, String> headers = new HashMap<>(); - headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5ByByteArray(value)); + headers.put(Constants.MD5_HEADER, GeneralUtility.calculateMD5Base64EncodedByByteArray(value)); responseFormat = getComponentsUtils().getResponseFormat(ActionStatus.OK); responseWrapper.setInnerElement(buildOkResponse(responseFormat, is, headers)); } diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java index f96e226d26..6e971f215d 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/externalapi/servlet/AssetsDataServlet.java @@ -352,7 +352,7 @@ public class AssetsDataServlet extends AbstractValidationsServlet { } else { byte[] value = csarArtifact.left().value().getRight(); InputStream is = new ByteArrayInputStream(value); - String contenetMD5 = GeneralUtility.calculateMD5ByByteArray(value); + String contenetMD5 = GeneralUtility.calculateMD5Base64EncodedByByteArray(value); Map<String, String> headers = new HashMap<>(); headers.put(Constants.CONTENT_DISPOSITION_HEADER, getContentDispositionValue(csarArtifact.left().value().getLeft())); headers.put(Constants.MD5_HEADER, contenetMD5); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java index 55ad44db0c..f1dd1539b4 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AbstractValidationsServlet.java @@ -458,7 +458,7 @@ public abstract class AbstractValidationsServlet extends BeGenericServlet { if (recievedMD5 == null) { isValid = false; } else { - String calculateMD5 = GeneralUtility.calculateMD5ByString(resourceInfoJsonString); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(resourceInfoJsonString); isValid = calculateMD5.equals(recievedMD5); } if (!isValid) { diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java index 6c4c5fafe1..006c5c22d3 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CapabiltyRequirementConvertor.java @@ -187,7 +187,7 @@ public class CapabiltyRequirementConvertor { String sourceCapName; if(ToscaUtils.isComplexVfc(component)){ fullReqName = r.getName(); - sourceCapName = getSourceCvfcDataTypeName(r.getName(), r.getOwnerName()); + sourceCapName = r.getParentName(); } else { fullReqName = getRequirementPath(r); sourceCapName = getSubPathByFirstDelimiterAppearance(fullReqName); @@ -205,13 +205,6 @@ public class CapabiltyRequirementConvertor { return toscaRequirements; } - private String getSourceCvfcDataTypeName(String name, String ownerName) { - if(name.contains(ownerName)){ - return name.substring(0, name.length() - ownerName.length() - 1); - } - return null; - } - private String getRequirementPath(RequirementDefinition r) { List<String> pathArray = Lists.reverse(r.getPath().stream() .map(path -> ValidationUtils.normalizeComponentInstanceName(getSubPathByLastDelimiterAppearance(path))) @@ -275,7 +268,7 @@ public class CapabiltyRequirementConvertor { String sourceReqName; if(ToscaUtils.isComplexVfc(component)){ fullCapName = c.getName(); - sourceReqName = getSourceCvfcDataTypeName(c.getName(), c.getOwnerName()); + sourceReqName = c.getParentName(); } else { fullCapName = getCapabilityPath(c); sourceReqName = getSubPathByFirstDelimiterAppearance(fullCapName); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java index 85b1927548..a0cc347e09 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/tosca/CsarUtils.java @@ -137,19 +137,26 @@ public class CsarUtils { private static final String TOSCA_META_PATH_FILE_NAME = "TOSCA-Metadata/TOSCA.meta"; private static final String TOSCA_META_VERSION = "1.0"; private static final String CSAR_VERSION = "1.1"; + public static final String ARTIFACTS = "Artifacts"; + public static final String DEFINITION = "Definitions"; + public static final String DEL_PATTERN = "([/\\\\]+)"; private static String versionFirstThreeOctates; - public static final String VFC_NODE_TYPE_ARTIFACTS_PATH_PATTERN = ARTIFACTS_PATH + ImportUtils.Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX + "([\\d\\w\\_\\-\\.\\s]+)(/)([\\d\\w\\_\\-\\.\\s]+)(/)([\\d\\w\\_\\-\\.\\s\\/]+)"; + public static final String VFC_NODE_TYPE_ARTIFACTS_PATH_PATTERN = ARTIFACTS + DEL_PATTERN + + ImportUtils.Constants.USER_DEFINED_RESOURCE_NAMESPACE_PREFIX + + "([\\d\\w\\_\\-\\.\\s]+)" + DEL_PATTERN + + "([\\d\\w\\_\\-\\.\\s]+)" + DEL_PATTERN + + "([\\d\\w\\_\\-\\.\\s]+)" + DEL_PATTERN; - public static final String VF_NODE_TYPE_ARTIFACTS_PATH_PATTERN = ARTIFACTS_PATH + + public static final String VF_NODE_TYPE_ARTIFACTS_PATH_PATTERN = ARTIFACTS + DEL_PATTERN+ // Artifact Group (i.e Deployment/Informational) - "([\\w\\_\\-\\.\\s]+)(/)" + + "([\\w\\_\\-\\.\\s]+)" + DEL_PATTERN + // Artifact Type - "([\\w\\_\\-\\.\\s]+)(/)" + + "([\\w\\_\\-\\.\\s]+)" + DEL_PATTERN + // Artifact Any File Name ".+"; public static final String VALID_ENGLISH_ARTIFACT_NAME = "([\\w\\_\\-\\.\\s]+)"; - public static final String SERVICE_TEMPLATE_PATH_PATTERN = Constants.SERVICE_TEMPLATES_CONTAINING_FOLDER + + public static final String SERVICE_TEMPLATE_PATH_PATTERN = DEFINITION + DEL_PATTERN+ // Service Template File Name "([\\w\\_\\-\\.\\s]+)"; @@ -633,7 +640,7 @@ public class CsarUtils { for (ArtifactDefinition artDef : generatedArtifactsDefinitions) { String data = gson.toJson(artDef); - String dataMD5 = GeneralUtility.calculateMD5ByString(data); + String dataMD5 = GeneralUtility.calculateMD5Base64EncodedByString(data); String artifactUniqueId = null; if ((operationType.getArtifactOperationEnum() == ArtifactOperationEnum.Update) || (operationType.getArtifactOperationEnum() == ArtifactOperationEnum.Delete)) { @@ -941,7 +948,7 @@ public class CsarUtils { artifact.setArtifactDisplayName(artifact.getArtifactName().lastIndexOf('.') > 0 ? artifact.getArtifactName().substring(0, artifact.getArtifactName().lastIndexOf('.')) : artifact.getArtifactName()); artifact.setArtifactLabel(ValidationUtils.normalizeArtifactLabel(artifact.getArtifactName())); artifact.setDescription(ARTIFACT_CREATED_FROM_CSAR); - artifact.setArtifactChecksum(GeneralUtility.calculateMD5ByByteArray(entry.getValue())); + artifact.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(entry.getValue())); return artifact; } @@ -971,7 +978,7 @@ public class CsarUtils { this.artifactLabel = ValidationUtils.normalizeArtifactLabel(artifactName); if (payloadData != null) { this.payloadData = Base64.encodeBase64String(payloadData); - this.artifactChecksum = GeneralUtility.calculateMD5ByByteArray(payloadData); + this.artifactChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(payloadData); } this.artifactUniqueId = artifactUniqueId; } diff --git a/catalog-be/src/main/resources/import/tosca/categories/categoryTypes.yml b/catalog-be/src/main/resources/import/tosca/categories/categoryTypes.yml index 8914207b0f..4c7ca11f13 100644 --- a/catalog-be/src/main/resources/import/tosca/categories/categoryTypes.yml +++ b/catalog-be/src/main/resources/import/tosca/categories/categoryTypes.yml @@ -11,6 +11,12 @@ services: VoIP_Call_Control: name: "VoIP Call Control" icons: ['call_controll'] + E2E_Service: + name: "E2E Service" + icons: ['network_l_1-3'] + Network_Service: + name: "Network Service" + icons: ['network_l_1-3'] resources: NetworkLayer23: name: "Network L2-3" @@ -137,7 +143,10 @@ resources: icons: ['service_admin'] ContrailRoute: name: "Contrail Route" - icons: ['contrail_route'] + icons: ['contrail_route'] SecurityZone: name: "Security Zone" - icons: ['security_zone']
\ No newline at end of file + icons: ['security_zone'] + NetworkService: + name: "Network Service" + icons: ['network']
\ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/categories/categoryTypes.zip b/catalog-be/src/main/resources/import/tosca/categories/categoryTypes.zip Binary files differindex 7a0e6bcad7..314a12ea55 100644 --- a/catalog-be/src/main/resources/import/tosca/categories/categoryTypes.zip +++ b/catalog-be/src/main/resources/import/tosca/categories/categoryTypes.zip diff --git a/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.yml b/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.yml index 621274796f..ba7a7a0cfd 100644 --- a/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.yml +++ b/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.yml @@ -849,6 +849,7 @@ org.openecomp.datatypes.Root: properties: supplemental_data: type: map + required: false entry_schema: description: > A placeholder for missing properties that would be included in future ecomp model versions. diff --git a/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.zip b/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.zip Binary files differindex ffbe146f9b..c97ea2caa0 100644 --- a/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.zip +++ b/catalog-be/src/main/resources/import/tosca/data-types/dataTypes.zip diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java index f3c7a7d24c..c47400bcdb 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogicTest.java @@ -1498,14 +1498,14 @@ public class ResourceBusinessLogicTest { deploymentArtifactToUpdate.setArtifactName(deploymentArtifactToUpdateFileName); deploymentArtifactToUpdate.setArtifactType("SNMP_POLL"); deploymentArtifactToUpdate.setPayload(oldPayloadData); - deploymentArtifactToUpdate.setArtifactChecksum(GeneralUtility.calculateMD5ByByteArray(oldPayloadData)); + deploymentArtifactToUpdate.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); ArtifactDefinition deploymentArtifactToDelete = new ArtifactDefinition(); deploymentArtifactToDelete.setMandatory(false); deploymentArtifactToDelete.setArtifactName(deploymentArtifactToDeleteFileName); deploymentArtifactToDelete.setArtifactType("SNMP_TRAP"); deploymentArtifactToDelete.setPayload(oldPayloadData); - deploymentArtifactToDelete.setArtifactChecksum(GeneralUtility.calculateMD5ByByteArray(oldPayloadData)); + deploymentArtifactToDelete.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); ArtifactDefinition deploymentArtifactToIgnore = new ArtifactDefinition(); @@ -1520,14 +1520,14 @@ public class ResourceBusinessLogicTest { artifactToUpdate.setArtifactName(artifactInfoToUpdateFileName); artifactToUpdate.setArtifactType("SNMP_POLL"); artifactToUpdate.setPayload(oldPayloadData); - artifactToUpdate.setArtifactChecksum(GeneralUtility.calculateMD5ByByteArray(oldPayloadData)); + artifactToUpdate.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); ArtifactDefinition artifactToDelete = new ArtifactDefinition(); artifactToDelete.setMandatory(false); artifactToDelete.setArtifactName(artifactInfoToDeleteFileName); artifactToDelete.setArtifactType("SNMP_TRAP"); artifactToDelete.setPayload(oldPayloadData); - artifactToDelete.setArtifactChecksum(GeneralUtility.calculateMD5ByByteArray(oldPayloadData)); + artifactToDelete.setArtifactChecksum(GeneralUtility.calculateMD5Base64EncodedByByteArray(oldPayloadData)); ArtifactDefinition artifactToIgnore = new ArtifactDefinition(); diff --git a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceServletTest.java b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceServletTest.java index 3afb5d6bdc..107163c520 100644 --- a/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceServletTest.java +++ b/catalog-be/src/test/java/org/openecomp/sdc/be/servlets/ResourceServletTest.java @@ -229,7 +229,7 @@ public class ResourceServletTest extends JerseyTest { } private void setMD5OnRequest(boolean isValid, UploadResourceInfo json) { - String md5 = (isValid) ? GeneralUtility.calculateMD5ByString(gson.toJson(json)) : "stam="; + String md5 = (isValid) ? GeneralUtility.calculateMD5Base64EncodedByString(gson.toJson(json)) : "stam="; when(request.getHeader(Constants.MD5_HEADER)).thenReturn(md5); } diff --git a/catalog-dao/pom.xml b/catalog-dao/pom.xml index 2627899e1f..d3c255ae79 100644 --- a/catalog-dao/pom.xml +++ b/catalog-dao/pom.xml @@ -221,9 +221,8 @@ </dependency> <dependency> - <groupId>com.thinkaurelius.titan</groupId> - <artifactId>titan-cassandra</artifactId> - <!--<artifactId>asdc-titan-cassandra</artifactId>--> + <groupId>org.openecomp.sdc.sdc-titan-cassandra</groupId> + <artifactId>sdc-titan-cassandra</artifactId> <version>${titan.version}</version> <scope>provided</scope> <exclusions> diff --git a/catalog-model/pom.xml b/catalog-model/pom.xml index 444686d3a2..3752d79a20 100644 --- a/catalog-model/pom.xml +++ b/catalog-model/pom.xml @@ -119,8 +119,8 @@ </dependency> <dependency> - <groupId>com.thinkaurelius.titan</groupId> - <artifactId>titan-cassandra</artifactId> + <groupId>org.openecomp.sdc.sdc-titan-cassandra</groupId> + <artifactId>sdc-titan-cassandra</artifactId> <version>${titan.version}</version> <scope>provided</scope> <exclusions> diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java index d52aa038a3..d986d77450 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/NodeTypeOperation.java @@ -36,6 +36,7 @@ import org.openecomp.sdc.be.datatypes.elements.ListRequirementDataDefinition; import org.openecomp.sdc.be.datatypes.elements.MapPropertiesDataDefinition; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; import org.openecomp.sdc.be.datatypes.enums.GraphPropertyEnum; +import org.openecomp.sdc.be.datatypes.enums.JsonPresentationFields; import org.openecomp.sdc.be.datatypes.tosca.ToscaDataDefinition; import org.openecomp.sdc.be.model.ComponentParametersView; import org.openecomp.sdc.be.model.DerivedNodeTypeResolver; @@ -54,6 +55,7 @@ import org.springframework.beans.factory.annotation.Qualifier; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; import java.util.List; @@ -468,6 +470,19 @@ public class NodeTypeOperation extends ToscaElementOperation { ToscaDataDefinition.mergeDataMaps(capabiltiesAll, capabilties); } + + capabiltiesAll.values().forEach(l -> { + l.getListToscaDataDefinition().forEach(c -> { + List<String> capabilitySources = c.getCapabilitySources(); + if ( capabilitySources == null ){ + capabilitySources = new ArrayList<>(); + } + capabilitySources.add((String) nodeType.getMetadataValue(JsonPresentationFields.TOSCA_RESOURCE_NAME)); + c.setCapabilitySources(capabilitySources); + }); + }); + + if (!capabiltiesAll.isEmpty()) { Either<GraphVertex, StorageOperationStatus> assosiateElementToData = assosiateElementToData(nodeTypeVertex, VertexTypeEnum.CAPABILTIES, EdgeLabelEnum.CAPABILITIES, capabiltiesAll); if (assosiateElementToData.isRight()) { @@ -584,11 +599,11 @@ public class NodeTypeOperation extends ToscaElementOperation { return Either.right(StorageOperationStatus.PARENT_RESOURCE_NOT_FOUND); } else { if (resources.size() > 1) { - log.error("Multiple parent resources called {} found in the graph.", parentResource); - return Either.right(StorageOperationStatus.MULTIPLE_PARENT_RESOURCE_FOUND); + return handleMultipleParent(parentResource, derivedResources, resources); + } else { + GraphVertex parentResourceData = resources.get(0); + derivedResources.add(parentResourceData); } - GraphVertex parentResourceData = resources.get(0); - derivedResources.add(parentResourceData); } } @@ -597,6 +612,47 @@ public class NodeTypeOperation extends ToscaElementOperation { } return Either.left(derivedResources); } + + Either<List<GraphVertex>, StorageOperationStatus> handleMultipleParent(String parentResource, List<GraphVertex> derivedResource, List<GraphVertex> fetchedDerivedResources){ + + Either<List<GraphVertex>, StorageOperationStatus> result = Either.left(derivedResource); + try{ + fetchedDerivedResources.sort((d1,d2)->{ + return new Double(Double.parseDouble((String)d1.getMetadataProperty(GraphPropertyEnum.VERSION))) + .compareTo(Double.parseDouble((String)d2.getMetadataProperty(GraphPropertyEnum.VERSION))); + }); + + int actualHighestIndex = fetchedDerivedResources.size() - 1; + derivedResource.add(fetchedDerivedResources.get(actualHighestIndex)); + fetchedDerivedResources.remove(actualHighestIndex); + + StorageOperationStatus status = fixMultipleParent(fetchedDerivedResources); + if(status != StorageOperationStatus.OK){ + result = Either.right(status); + } + } catch (Exception e){ + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Exception occured during handle multiple parent {}. Exception is {}", + parentResource, e.getMessage()); + result = Either.right(StorageOperationStatus.GENERAL_ERROR); + } + return result; + } + + private StorageOperationStatus fixMultipleParent(List<GraphVertex> fetchedDerivedResources) { + StorageOperationStatus result = StorageOperationStatus.OK; + for(GraphVertex fetchedDerivedResource : fetchedDerivedResources){ + fetchedDerivedResource.addMetadataProperty(GraphPropertyEnum.IS_HIGHEST_VERSION, false); + Either<GraphVertex, TitanOperationStatus> updateVertexRes = titanDao.updateVertex(fetchedDerivedResource); + if (updateVertexRes.isRight()) { + TitanOperationStatus titatStatus = updateVertexRes.right().value(); + CommonUtility.addRecordToLog(log, LogLevelEnum.DEBUG, "Failed to set highest version of node type {} to false. Status is {}", + fetchedDerivedResource.getMetadataProperty(GraphPropertyEnum.TOSCA_RESOURCE_NAME), titatStatus); + result = DaoStatusConverter.convertTitanStatusToStorageStatus(titatStatus); + break; + } + } + return result; + } private GraphVertex fillMetadata(GraphVertex nodeTypeVertex, NodeType nodeType) { nodeTypeVertex.setLabel(VertexTypeEnum.NODE_TYPE); diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacade.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacade.java index 3cc80eaf36..b11036df49 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacade.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/jsontitan/operations/ToscaOperationFacade.java @@ -2207,5 +2207,13 @@ public class ToscaOperationFacade { public StorageOperationStatus deleteComponentInstanceInputsFromTopologyTemplate(Component containerComponent, ComponentTypeEnum componentType, List<InputDefinition> inputsToDelete) { return topologyTemplateOperation.deleteToscaDataElements(containerComponent.getUniqueId(), EdgeLabelEnum.INPUTS, inputsToDelete.stream().map(i -> i.getName()).collect(Collectors.toList())); } + + public StorageOperationStatus deleteAllCalculatedCapabilitiesRequirements(String topologyTemplateId) { + StorageOperationStatus status = topologyTemplateOperation.removeToscaData(topologyTemplateId, EdgeLabelEnum.CALCULATED_CAPABILITIES, VertexTypeEnum.CALCULATED_CAPABILITIES); + if(status == StorageOperationStatus.OK){ + status = topologyTemplateOperation.removeToscaData(topologyTemplateId, EdgeLabelEnum.CALCULATED_REQUIREMENTS, VertexTypeEnum.CALCULATED_REQUIREMENTS); + } + return status; + } } diff --git a/catalog-ui/src/app/models/component-metadata.ts b/catalog-ui/src/app/models/component-metadata.ts index 8c6ed5593d..1545739ce3 100644 --- a/catalog-ui/src/app/models/component-metadata.ts +++ b/catalog-ui/src/app/models/component-metadata.ts @@ -65,6 +65,7 @@ export class ComponentMetadata { public namingPolicy: string; public serviceType:string; public serviceRole:string; + public environmentContext:string; //backend lifecycleState @@ -101,7 +102,7 @@ export class ComponentMetadata { this.projectCode = response.projectCode; this.resourceType = response.resourceType; this.csarUUID = response.csarUUID; - this.csarVersion = response.version; + this.csarVersion = response.csarVersion; this.state = response.state; this.ecompGeneratedNaming = response.ecompGeneratedNaming; this.namingPolicy = response.namingPolicy; @@ -109,6 +110,7 @@ export class ComponentMetadata { this.resourceVendorModelNumber = response.resourceVendorModelNumber; this.serviceType = response.serviceType; this.serviceRole = response.serviceRole; + this.environmentContext = response.environmentContext; return this; } diff --git a/catalog-ui/src/app/models/components/service.ts b/catalog-ui/src/app/models/components/service.ts index 90a38e895b..ce6921b1bb 100644 --- a/catalog-ui/src/app/models/components/service.ts +++ b/catalog-ui/src/app/models/components/service.ts @@ -36,6 +36,7 @@ export class Service extends Component { public namingPolicy:string; public serviceType:string; public serviceRole:string; + public environmentContext:string; constructor(componentService:IServiceService, $q:ng.IQService, component?:Service) { super(componentService, $q, component); @@ -47,6 +48,7 @@ export class Service extends Component { this.namingPolicy = component.namingPolicy; this.serviceType = component.serviceType; this.serviceRole = component.serviceRole; + this.environmentContext = component.environmentContext; if (component.categories && component.categories[0]) { this.mainCategory = component.categories[0].name; this.selectedCategory = this.mainCategory; @@ -161,6 +163,7 @@ export class Service extends Component { this.namingPolicy = componentMetadata.namingPolicy; this.serviceType = componentMetadata.serviceType; this.serviceRole = componentMetadata.serviceRole; + this.environmentContext = componentMetadata.environmentContext; this.setComponentDisplayData(); } diff --git a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts index 48fc9dbb42..c60a490b4b 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts +++ b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view-model.ts @@ -20,7 +20,7 @@ 'use strict'; import {ModalsHandler, ValidationUtils, EVENTS, CHANGE_COMPONENT_CSAR_VERSION_FLAG, ComponentType, DEFAULT_ICON, - ResourceType} from "app/utils"; + ResourceType, ComponentState} from "app/utils"; import {CacheService, EventListenerService, ProgressService, OnboardingService} from "app/services"; import {IAppConfigurtaion, IValidate, IMainCategory, Resource, ISubCategory,Service, ICsarComponent} from "app/models"; import {IWorkspaceViewModelScope} from "app/view-models/workspace/workspace-view-model"; @@ -41,6 +41,7 @@ export class componentCategories {//categories field bind to this obj in order t selectedCategory:string; } + export interface IGeneralScope extends IWorkspaceViewModelScope { validation:Validation; editForm:ng.IFormController; @@ -56,7 +57,7 @@ export interface IGeneralScope extends IWorkspaceViewModelScope { browseFileLabel:string; componentCategories:componentCategories; - onToscaFileChange():void + onToscaFileChange():void; validateField(field:any):boolean; validateName(isInit:boolean):void; calculateUnique(mainCategory:string, subCategory:string):string; // Build unique string from main and sub category @@ -146,21 +147,24 @@ export class GeneralViewModel { (<Resource>this.$scope.component).resourceType == ResourceType.VF && (<Resource>this.$scope.component).csarUUID) { this.$scope.isShowOnboardingSelectionBrowse = true; - let onboardCsarFilesMap:Dictionary<string> = this.cacheService.get('onboardCsarFilesMap'); + let onboardCsarFilesMap:Dictionary<Dictionary<string>> = this.cacheService.get('onboardCsarFilesMap'); // The onboardCsarFilesMap in cache contains map of [packageId]:[vsp display name for brows] // if the map is empty - Do request to BE if(onboardCsarFilesMap) { - this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[(<Resource>this.$scope.component).csarUUID]; + if (onboardCsarFilesMap[(<Resource>this.$scope.component).csarUUID]){ + this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[(<Resource>this.$scope.component).csarUUID][(<Resource>this.$scope.component).csarVersion]; + } } if(!onboardCsarFilesMap || !this.$scope.importedToscaBrowseFileText){ let onSuccess = (vsps:Array<ICsarComponent>): void =>{ onboardCsarFilesMap = {}; _.each(vsps, (vsp:ICsarComponent)=>{ - onboardCsarFilesMap[vsp.packageId] = vsp.vspName + " (" + vsp.version + ")"; + onboardCsarFilesMap[vsp.packageId] = onboardCsarFilesMap[vsp.packageId] || {}; + onboardCsarFilesMap[vsp.packageId][vsp.version] = vsp.vspName + " (" + vsp.version + ")"; }); this.cacheService.set('onboardCsarFilesMap', onboardCsarFilesMap); - this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[(<Resource>this.$scope.component).csarUUID]; + this.$scope.importedToscaBrowseFileText = onboardCsarFilesMap[(<Resource>this.$scope.component).csarUUID][(<Resource>this.$scope.component).csarVersion]; }; let onError = (): void =>{ diff --git a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html index d3626803e9..3a3b2d316d 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html +++ b/catalog-ui/src/app/view-models/workspace/tabs/general/general-view.html @@ -375,6 +375,7 @@ </div> </div> <!--------------------- Service Role --------------------> + <div class="meta-data" data-ng-if="component.creationDate"> <div> <b>Created:</b> diff --git a/catalog-ui/src/app/view-models/workspace/tabs/general/general.less b/catalog-ui/src/app/view-models/workspace/tabs/general/general.less index 9633ec5bb6..b9b59deb1b 100644 --- a/catalog-ui/src/app/view-models/workspace/tabs/general/general.less +++ b/catalog-ui/src/app/view-models/workspace/tabs/general/general.less @@ -34,7 +34,7 @@ } .description{ - height: 300px; + height: 360px; } .i-sdc-form-item.description-field{ diff --git a/catalog-ui/src/app/view-models/workspace/workspace-view.html b/catalog-ui/src/app/view-models/workspace/workspace-view.html index 19ebefe7a5..a7c9da05c4 100644 --- a/catalog-ui/src/app/view-models/workspace/workspace-view.html +++ b/catalog-ui/src/app/view-models/workspace/workspace-view.html @@ -70,10 +70,12 @@ </div> </div> - <div class="tab-title" data-ng-if="!isComposition && !isDeployment"> - {{getTabTitle()}} + <div class="w-sdc-main-container-body-content-wrapper"> + <div class="tab-title" data-ng-if="!isComposition && !isDeployment"> + {{getTabTitle()}} + </div> + <div class="w-sdc-main-container-body-content" data-ng-class="{'third-party':thirdParty}" data-ui-view></div> </div> - <div class="w-sdc-main-container-body-content" data-ng-class="{'third-party':thirdParty}" data-ui-view></div> </div> </div> <top-nav search-bind="search.filterTerm" hide-search="true" menu-model="breadcrumbsModel" version="{{version}}"></top-nav> diff --git a/catalog-ui/src/app/view-models/workspace/workspace.less b/catalog-ui/src/app/view-models/workspace/workspace.less index d0799f4bac..8b8b6d624a 100644 --- a/catalog-ui/src/app/view-models/workspace/workspace.less +++ b/catalog-ui/src/app/view-models/workspace/workspace.less @@ -174,7 +174,7 @@ height: calc(~'100% - @{action_nav_height}'); //composition is the only tab without a tab title. need to exclude from calculation. } .w-sdc-main-container-body-content { - height:calc(~'100% - @{action_nav_height} - @{tab_title}'); + // height:calc(~'100% - @{action_nav_height} - @{tab_title}'); align-items: center; padding: 0 100px 20px 100px; &.third-party { @@ -187,6 +187,10 @@ bottom: 0; } } + .w-sdc-main-container-body-content-wrapper { + overflow: auto; + height: calc(~'100% - @{action_nav_height}') + } } } diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/util/GeneralUtility.java b/common-app-api/src/main/java/org/openecomp/sdc/common/util/GeneralUtility.java index 0b55fd1845..8890b14dd1 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/common/util/GeneralUtility.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/common/util/GeneralUtility.java @@ -134,7 +134,7 @@ public class GeneralUtility { return res; } - public static String calculateMD5ByByteArray(byte[] payload) { + public static String calculateMD5Base64EncodedByByteArray(byte[] payload) { String decodedMd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(payload); byte[] encodeMd5 = Base64.encodeBase64(decodedMd5.getBytes()); return new String(encodeMd5); @@ -146,7 +146,7 @@ public class GeneralUtility { * @param data * @return */ - public static String calculateMD5ByString(String data) { + public static String calculateMD5Base64EncodedByString(String data) { String calculatedMd5 = org.apache.commons.codec.digest.DigestUtils.md5Hex(data); // encode base-64 result diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java index 8ec5a89c44..fd04f47b29 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/CapabilityDataDefinition.java @@ -52,6 +52,7 @@ public class CapabilityDataDefinition extends ToscaDataDefinition implements Ser this.setType(a.getType()); this.setDescription ( a.getDescription()); this.setName( a.getName()); + this.setParentName( a.getParentName()); this.setValidSourceTypes( a.getValidSourceTypes()); this.setCapabilitySources( a.getCapabilitySources()); this.setOwnerId( a.getOwnerId()); @@ -128,6 +129,14 @@ public class CapabilityDataDefinition extends ToscaDataDefinition implements Ser public void setName(String name) { setToscaPresentationValue(JsonPresentationFields.NAME, name); } + + public String getParentName() { + return (String) getToscaPresentationValue(JsonPresentationFields.PARENT_NAME); + } + + public void setParentName(String parentName) { + setToscaPresentationValue(JsonPresentationFields.PARENT_NAME, parentName); + } public String getType() { return (String) getToscaPresentationValue(JsonPresentationFields.TYPE); diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java index b32f65f9d3..4a6f770ebc 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/elements/RequirementDataDefinition.java @@ -47,6 +47,7 @@ public class RequirementDataDefinition extends ToscaDataDefinition implements Se public RequirementDataDefinition(RequirementDataDefinition other) { this.setUniqueId(other.getUniqueId()); this.setName(other.getName()); + this.setParentName(other.getParentName()); this.setCapability(other.getCapability()); this.setNode(other.getNode()); this.setRelationship(other.getRelationship()); @@ -78,6 +79,14 @@ public class RequirementDataDefinition extends ToscaDataDefinition implements Se public void setName(String name) { setToscaPresentationValue(JsonPresentationFields.NAME, name); } + + public String getParentName() { + return (String) getToscaPresentationValue(JsonPresentationFields.PARENT_NAME); + } + + public void setParentName(String parentName) { + setToscaPresentationValue(JsonPresentationFields.PARENT_NAME, parentName); + } /** * specify the capability type diff --git a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java index fd028c0349..8634ac871a 100644 --- a/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java +++ b/common-be/src/main/java/org/openecomp/sdc/be/datatypes/enums/JsonPresentationFields.java @@ -134,7 +134,7 @@ public enum JsonPresentationFields { RELATIONSHIP ("relationship", null), VALID_SOURCE_TYPES ("validSourceTypes", null), REQUIREMENT_ID ("requirementId", null), - + PARENT_NAME ("parentName", null), //Relation CAPABILTY_OWNER_ID ("capabilityOwnerId", null), REQUIREMENT_OWNER_ID ("requirementOwnerId", null), diff --git a/onboarding/pom.xml b/onboarding/pom.xml index 141ffc012d..667ed607b7 100644 --- a/onboarding/pom.xml +++ b/onboarding/pom.xml @@ -34,10 +34,11 @@ <mvn.swagger.version>3.1.0</mvn.swagger.version> <mvn.war.version>2.1.1</mvn.war.version> - <!-- Onboarding artifacts version --> + <!-- Onboarding artifacts version --> <openecomp.sdc.common.version>1.1.0-SNAPSHOT</openecomp.sdc.common.version> <!-- Onboarding 3rd party versions --> + <jtosca.version>1.1.1-SNAPSHOT</jtosca.version> <aspectj.version>1.8.9</aspectj.version> <bsh.version>2.0b5</bsh.version> <cassandra.version>2.1.9</cassandra.version> @@ -95,7 +96,8 @@ <zusammen.version>0.2.0</zusammen.version> <zusammen-state-store.version>0.2.1</zusammen-state-store.version> <skipSA>true</skipSA> - <build.tools.version>1.1.0-SNAPSHOT</build.tools.version> + <pmd.version>5.8.1</pmd.version> + <build.tools.version>${project.version}</build.tools.version> </properties> <build> @@ -146,6 +148,16 @@ <artifactId>build-tools</artifactId> <version>${build.tools.version}</version> </dependency> + <dependency> + <groupId>net.sourceforge.pmd</groupId> + <artifactId>pmd-core</artifactId> + <version>${pmd.version}</version> + </dependency> + <dependency> + <groupId>net.sourceforge.pmd</groupId> + <artifactId>pmd-java</artifactId> + <version>${pmd.version}</version> + </dependency> </dependencies> </plugin> </plugins> diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/ActionsForSwaggerFileUpload.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/ActionsForSwaggerFileUpload.java index 369e90c928..5dc79ebdfe 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/ActionsForSwaggerFileUpload.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/ActionsForSwaggerFileUpload.java @@ -23,10 +23,10 @@ package org.openecomp.sdcrests.action.rest; import com.sun.jersey.multipart.FormDataParam; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; import org.springframework.validation.annotation.Validated; +import java.io.InputStream; import javax.servlet.http.HttpServletRequest; import javax.ws.rs.Consumes; import javax.ws.rs.HeaderParam; @@ -39,8 +39,6 @@ import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import java.io.InputStream; - @Path("/workflow/v1.0/actions") @Produces(MediaType.APPLICATION_JSON) diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java index e6f5e6b1a3..53ebf0baab 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/action-library-rest/action-library-rest-services/src/main/java/org/openecomp/sdcrests/action/rest/services/ActionsImpl.java @@ -830,7 +830,6 @@ public class ActionsImpl implements Actions { HttpServletRequest servletRequest) { ListResponseWrapper responseList = null; Map<String, String> errorMap = validateRequestHeaders(servletRequest); - ; Map<String, String> queryParamErrors = validateQueryParam(componentID); errorMap.putAll(queryParamErrors); if (errorMap.isEmpty()) { @@ -992,37 +991,36 @@ public class ActionsImpl implements Actions { if (StringUtils.isEmpty(requestJSON) || requestJSON.equals(REQUEST_EMPTY_BODY)) { requestBodyErrorMap.put(ACTION_INVALID_REQUEST_BODY_CODE, ACTION_REQUEST_BODY_EMPTY); } else { - switch (requestType) { - case ActionConstants.REQUEST_TYPE_CREATE_ACTION: - case ActionConstants.REQUEST_TYPE_UPDATE_ACTION: - //Semantic request specific validations - Action action = JsonUtil.json2Object(requestJSON, Action.class); - if (StringUtils.isEmpty(action.getName())) { - setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_PARAM_NAME, - requestBodyErrorMap); - } else { - //Added check for action name not allowing whitespaces - if (action.getName().matches(whitespaceRegex)) { - requestBodyErrorMap - .put(ACTION_ARTIFACT_INVALID_NAME_CODE, ACTION_REQUEST_INVALID_NAME); - } + if(requestType == ActionConstants.REQUEST_TYPE_CREATE_ACTION){ + //placeholder for future implementation + } + if(requestType == ActionConstants.REQUEST_TYPE_UPDATE_ACTION){ + //Semantic request specific validations + Action action = JsonUtil.json2Object(requestJSON, Action.class); + if(StringUtils.isEmpty(action.getName())){ + setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, ACTION_REQUEST_PARAM_NAME, + requestBodyErrorMap); + } else { + //Added check for action names not allowing whitespaces + if (action.getName().matches(whitespaceRegex)){ + requestBodyErrorMap.put(ACTION_ARTIFACT_INVALID_NAME_CODE, ACTION_REQUEST_INVALID_NAME); } + } - if (action.getSupportedModels() != null && - !isIDPresentInMap(action.getSupportedModels(), SUPPORTED_MODELS_VERSION_ID)) { - setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, - ACTION_REQUEST_PARAM_SUPPORTED_MODELS, requestBodyErrorMap); - } - if (action.getSupportedComponents() != null && - !isIDPresentInMap(action.getSupportedComponents(), SUPPORTED_COMPONENTS_ID)) { - setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, - ACTION_REQUEST_PARAM_SUPPORTED_COMPONENTS, requestBodyErrorMap); - } - if (action.getArtifacts() != null) { - setErrorValue(ACTION_UPDATE_NOT_ALLOWED_CODE, ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED, - requestBodyErrorMap); - } - break; + if(action.getSupportedModels() != null && !isIDPresentInMap(action.getSupportedModels(), + SUPPORTED_MODELS_VERSION_ID)){ + setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, + ACTION_REQUEST_PARAM_SUPPORTED_MODELS, requestBodyErrorMap); + } + if(action.getSupportedComponents() != null && !isIDPresentInMap(action + .getSupportedComponents(), SUPPORTED_COMPONENTS_ID)){ + setErrorValue(ACTION_REQUEST_INVALID_GENERIC_CODE, + ACTION_REQUEST_PARAM_SUPPORTED_MODELS, requestBodyErrorMap); + } + if(action.getArtifacts() != null){ + setErrorValue(ACTION_UPDATE_NOT_ALLOWED_CODE, + ACTION_REQUEST_ARTIFACT_OPERATION_ALLOWED, requestBodyErrorMap); + } } } @@ -1037,11 +1035,8 @@ public class ActionsImpl implements Actions { if (errorMessage != null) { message = errorMessage + ", " + message; } else { - switch (key) { - case ACTION_REQUEST_INVALID_GENERIC_CODE: - message = ACTION_REQUEST_MISSING_MANDATORY_PARAM + message; - break; - } + if(key == ACTION_REQUEST_INVALID_GENERIC_CODE) + message = ACTION_REQUEST_MISSING_MANDATORY_PARAM + message; } errorMap.put(key, message); } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java index 2794315188..023dedf12c 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/activity-log-rest/activity-log-rest-services/src/main/java/org/openecomp/sdcrests/activitylog/rest/mapping/MapActivityLogEntityToActivityLogDto.java @@ -23,7 +23,6 @@ package org.openecomp.sdcrests.activitylog.rest.mapping; import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; import org.openecomp.sdcrests.activitylog.types.ActivityLogDto; import org.openecomp.sdcrests.activitylog.types.ActivityStatus; -import org.openecomp.sdcrests.activitylog.types.ActivityType; import org.openecomp.sdcrests.mapping.MappingBase; public class MapActivityLogEntityToActivityLogDto extends MappingBase<ActivityLogEntity, ActivityLogDto> { diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java index 4ffe4488da..c7f3f2598c 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/application-config-rest/application-config-rest-services/src/main/java/org/openecomp/sdcrests/applicationconfig/rest/services/ApplicationConfigurationImpl.java @@ -24,7 +24,6 @@ import org.openecomp.core.utilities.applicationconfig.dao.type.ApplicationConfig import org.openecomp.core.utilities.applicationconfig.type.ConfigurationData; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.applicationconfig.ApplicationConfigManager; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerServiceName; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/HealthCheck.java b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/HealthCheck.java index 2ed1d57f8f..446a80e3cc 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/HealthCheck.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/HealthCheck.java @@ -22,13 +22,15 @@ package org.openecomp.sdcrests.health.rest; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; +import org.openecomp.sdcrests.health.types.HealthInfoDtos; import org.springframework.validation.annotation.Validated; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import java.util.Collection; -import org.openecomp.sdcrests.health.types.HealthInfoDtos; @Path("/v1.0/healthcheck") @Produces(MediaType.APPLICATION_JSON) diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java index 047adaa25e..38858c0e7c 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java @@ -26,7 +26,6 @@ import org.openecomp.sdc.health.HealthCheckManagerFactory; import org.openecomp.sdc.health.data.HealthCheckResult; import org.openecomp.sdc.health.data.HealthCheckStatus; import org.openecomp.sdc.health.data.HealthInfo; -import org.openecomp.sdc.health.data.SiteMode; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.MdcUtil; @@ -36,10 +35,10 @@ import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; -import javax.inject.Named; -import javax.ws.rs.core.Response; import java.util.Arrays; import java.util.Collection; +import javax.inject.Named; +import javax.ws.rs.core.Response; @Named @Service("healthCheck") diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java index e59d3fb3b8..18465cd00c 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/src/main/java/org/openecomp/server/filters/ActionAuthenticationFilter.java @@ -20,6 +20,9 @@ package org.openecomp.server.filters; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; + import java.io.IOException; import java.security.Principal; import java.util.Base64; @@ -35,6 +38,7 @@ import javax.servlet.http.HttpServletResponse; public class ActionAuthenticationFilter implements Filter { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); private boolean runningOnLocal = true; @Override @@ -58,6 +62,7 @@ public class ActionAuthenticationFilter implements Filter { String decodedCredentials = new String(Base64.getDecoder().decode(base64Credentials)); username = decodedCredentials.substring(0, decodedCredentials.indexOf(":")); } catch (Exception exception) { + log.debug("",exception); setResponseStatus((HttpServletResponse) arg1, HttpServletResponse.SC_FORBIDDEN); return; } @@ -82,6 +87,7 @@ public class ActionAuthenticationFilter implements Filter { .valueOf(username.substring(username.indexOf("-") + 1).toUpperCase()); return userPrivilege.ordinal() >= requiredPrivilege.ordinal(); } catch (Exception exception) { + log.debug("",exception); return false; } } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java index 91f2656f16..2310c0f6ce 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/openecomp-sdc-common-rest/src/main/java/org/openecomp/sdcrests/mapping/MappingBase.java @@ -29,6 +29,9 @@ import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerServiceName; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; + /** * Base class for all mapping classes. Mapping classes will perform data mapping from source object * to target object Base class provides following<br> <ol> <li>provides life cycle of @@ -52,6 +55,8 @@ public abstract class MappingBase<S, T> { * @return <code>T</code> - instance of type <code>T</code> */ + private final Logger logger = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + public final T applyMapping(final S source, Class<T> clazz) { T target = (T) instantiateTarget(clazz); if (source == null || target == null) { diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java index c0c759e123..b08bc10727 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/Validation.java @@ -21,7 +21,6 @@ package org.openecomp.sdcrests.validation.rest; import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; import org.apache.cxf.jaxrs.ext.multipart.Multipart; import org.springframework.validation.annotation.Validated; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/ValidationForSwaggerUsage.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/ValidationForSwaggerUsage.java index 0a737f32e8..fd5bea3380 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/ValidationForSwaggerUsage.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/ValidationForSwaggerUsage.java @@ -23,13 +23,16 @@ package org.openecomp.sdcrests.validation.rest; import com.sun.jersey.multipart.FormDataParam; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; import org.springframework.validation.annotation.Validated; -import javax.ws.rs.*; +import java.io.InputStream; +import javax.ws.rs.Consumes; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import java.io.InputStream; @Path("/v1.0/validation") diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java index b0467b6ef0..15675f14de 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/validation-rest/validation-rest-services/src/main/java/org/openecomp/sdcrests/validation/rest/services/ValidationImpl.java @@ -21,7 +21,6 @@ package org.openecomp.sdcrests.validation.rest.services; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java index 9a72a59070..a3a4e4d0d8 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/FeatureGroups.java @@ -20,10 +20,12 @@ package org.openecomp.sdcrests.vendorlicense.rest; +import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupEntityDto; import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupModelDto; import org.openecomp.sdcrests.vendorlicense.types.FeatureGroupRequestDto; @@ -32,7 +34,6 @@ import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; @@ -42,13 +43,9 @@ import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM; -import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; - @Path("/v1.0/vendor-license-models/{vlmId}/versions/{versionId}/feature-groups") @Produces(MediaType.APPLICATION_JSON) diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroupLimits.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroupLimits.java index bfb2d51af0..bd31dc5607 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroupLimits.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/LicenseKeyGroupLimits.java @@ -6,7 +6,6 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.openecomp.sdcrests.vendorlicense.types.EntitlementPoolEntityDto; import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto; import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto; import org.springframework.validation.annotation.Validated; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLimitEntityToLimitDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLimitEntityToLimitDto.java index 1152cc1eb3..a0226c1626 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLimitEntityToLimitDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-services/src/main/java/org/openecomp/sdcrests/vendorlicense/rest/mapping/MapLimitEntityToLimitDto.java @@ -3,7 +3,6 @@ package org.openecomp.sdcrests.vendorlicense.rest.mapping; import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity; import org.openecomp.sdcrests.mapping.MappingBase; import org.openecomp.sdcrests.vendorlicense.types.LimitEntityDto; -import org.openecomp.sdcrests.vendorlicense.types.LimitRequestDto; public class MapLimitEntityToLimitDto extends MappingBase<LimitEntity, LimitEntityDto> { diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java index 79cf750f74..18488ab83d 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/EntitlementPoolRequestDto.java @@ -22,9 +22,6 @@ package org.openecomp.sdcrests.vendorlicense.types; import io.swagger.annotations.ApiModel; import org.codehaus.jackson.annotate.JsonIgnoreProperties; -import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; -import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; -import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; import org.openecomp.sdc.vendorlicense.dao.types.ThresholdUnit; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LimitRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LimitRequestDto.java index defff137d8..daeb9b0d10 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LimitRequestDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-license-rest/vendor-license-rest-types/src/main/java/org/openecomp/sdcrests/vendorlicense/types/LimitRequestDto.java @@ -2,10 +2,7 @@ package org.openecomp.sdcrests.vendorlicense.types; import io.swagger.annotations.ApiModel; import org.hibernate.validator.constraints.NotBlank; -import org.openecomp.sdc.vendorlicense.dao.types.LimitType; -import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; import javax.validation.constraints.Size; @ApiModel(value = "LimitRequest") diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencyModels.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencyModels.java index 5df05d1cf1..d7ba65fce5 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencyModels.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/ComponentDependencyModels.java @@ -1,11 +1,11 @@ package org.openecomp.sdcrests.vsp.rest; +import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM; import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; - import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModelRequestDto; import org.springframework.validation.annotation.Validated; @@ -21,11 +21,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM; - -import java.util.List; - @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/component-dependency-model") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java index 13d9a049c8..d5125c92bf 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Compute.java @@ -6,7 +6,6 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDetailsDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; @@ -15,7 +14,6 @@ import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; @@ -25,7 +23,6 @@ import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java index 581b15199c..1ba2f71b4c 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/DeploymentFlavors.java @@ -6,7 +6,6 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorListResponseDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.DeploymentFlavorRequestDto; @@ -14,8 +13,15 @@ import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java index 8939faa13f..ffa1675f91 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Images.java @@ -6,9 +6,6 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ImageData; -import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageRequestDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; @@ -17,7 +14,6 @@ import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; @@ -27,7 +23,6 @@ import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java index c29966b54b..21bd65eccb 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Nics.java @@ -26,7 +26,6 @@ import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.NicRequestDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; @@ -35,7 +34,6 @@ import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; @@ -45,7 +43,6 @@ import javax.ws.rs.PUT; import javax.ws.rs.Path; import javax.ws.rs.PathParam; import javax.ws.rs.Produces; -import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java index 93dcbc4e32..458a1c63fd 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/Processes.java @@ -20,26 +20,32 @@ package org.openecomp.sdcrests.vsp.rest; +import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessEntityDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ProcessRequestDto; import org.springframework.validation.annotation.Validated; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import javax.ws.rs.*; +import javax.ws.rs.Consumes; +import javax.ws.rs.DELETE; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; -import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM; -import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; - @Path("/v1.0/vendor-software-products/{vspId}/versions/{versionId}/processes") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java index 4366b2c3d1..1a68d49479 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/VendorSoftwareProducts.java @@ -20,15 +20,14 @@ package org.openecomp.sdcrests.vsp.rest; +import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM; +import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; + import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; -import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import org.openecomp.sdc.vendorsoftwareproduct.types.FileDataStructureDto; -import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdcrests.vendorsoftwareproducts.types.PackageInfoDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; -import org.openecomp.sdcrests.vendorsoftwareproducts.types.UploadFileResponseDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.VersionSoftwareProductActionRequestDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspComputeDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.VspCreationDto; @@ -38,11 +37,8 @@ import org.springframework.validation.annotation.Validated; import java.io.File; import java.io.IOException; -import java.io.InputStream; -import java.lang.reflect.InvocationTargetException; import javax.validation.Valid; import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; import javax.ws.rs.GET; @@ -55,9 +51,6 @@ import javax.ws.rs.Produces; import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; - -import static org.openecomp.sdcrests.common.RestConstants.USER_ID_HEADER_PARAM; -import static org.openecomp.sdcrests.common.RestConstants.USER_MISSING_ERROR_MSG; @Path("/v1.0/vendor-software-products") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelEntityToDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelEntityToDto.java index 0c923fe82b..bc8a7d20d4 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelEntityToDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelEntityToDto.java @@ -1,16 +1,8 @@ package org.openecomp.sdcrests.vsp.rest.mapping; -import org.openecomp.sdc.common.errors.CoreException; -import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.datatypes.error.ErrorLevel; -import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity; -import org.openecomp.sdc.vendorsoftwareproduct.errors.ComponentDependencyModelErrorBuilder; import org.openecomp.sdcrests.mapping.MappingBase; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentDependencyModel; -import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentRelationType; public class MapComponentDependencyModelEntityToDto extends MappingBase<ComponentDependencyModelEntity, ComponentDependencyModel> { diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelRequestToEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelRequestToEntity.java index baaa664938..d0956bb37d 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelRequestToEntity.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComponentDependencyModelRequestToEntity.java @@ -29,6 +29,7 @@ public class MapComponentDependencyModelRequestToEntity extends ComponentRelationType.valueOf(source.getRelationType()); target.setRelation(source.getRelationType()); } catch (IllegalArgumentException exception) { + logger.debug("",exception); ErrorCode errorCode = ComponentDependencyModelErrorBuilder.getInvalidRelationTypeErrorBuilder(); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java index 7db9a0a9b1..ee9882369f 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeDetailsDtoToComputeEntity.java @@ -12,6 +12,6 @@ public class MapComputeDetailsDtoToComputeEntity extends MappingBase<ComputeDeta public void doMapping(ComputeDetailsDto source, ComputeEntity target) { ComputeDescription computeDesc = new ComputeDescription(source.getName(), source .getDescription()); - target.setCompositionData(computeDesc == null ? null : JsonUtil.object2Json(computeDesc)); + target.setCompositionData(JsonUtil.object2Json(computeDesc)); } } diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeDto.java index d7586471b5..53aa2afec3 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapComputeEntityToComputeDto.java @@ -1,7 +1,6 @@ package org.openecomp.sdcrests.vsp.rest.mapping; import org.openecomp.core.utilities.json.JsonUtil; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity; import org.openecomp.sdc.vendorsoftwareproduct.types.ListComputeResponse; import org.openecomp.sdcrests.mapping.MappingBase; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComputeDescription; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageCreationDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageCreationDto.java index 5710fbe02e..81f57a3e95 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageCreationDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageCreationDto.java @@ -1,9 +1,7 @@ package org.openecomp.sdcrests.vsp.rest.mapping; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity; import org.openecomp.sdcrests.mapping.MappingBase; -import org.openecomp.sdcrests.vendorsoftwareproducts.types.ComponentCreationDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageCreationDto; public class MapImageEntityToImageCreationDto extends MappingBase<ImageEntity, diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageDto.java index 62d37465e1..7a4ccf990c 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageEntityToImageDto.java @@ -1,7 +1,6 @@ package org.openecomp.sdcrests.vsp.rest.mapping; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Image; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ImageData; import org.openecomp.sdcrests.mapping.MappingBase; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageRequestDtoToImageEntity.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageRequestDtoToImageEntity.java index 0b8a501f16..78cd13f4c7 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageRequestDtoToImageEntity.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/mapping/MapImageRequestDtoToImageEntity.java @@ -1,18 +1,7 @@ package org.openecomp.sdcrests.vsp.rest.mapping; -import org.openecomp.sdc.common.errors.CoreException; -import org.openecomp.sdc.common.errors.ErrorCategory; -import org.openecomp.sdc.common.errors.ErrorCode; -import org.openecomp.sdc.datatypes.error.ErrorLevel; -import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; -import org.openecomp.sdc.logging.types.LoggerConstants; -import org.openecomp.sdc.logging.types.LoggerErrorCode; -import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity; -import org.openecomp.sdc.vendorsoftwareproduct.errors.ImageErrorBuilder; -import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Image; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ImageFormat; import org.openecomp.sdcrests.mapping.MappingBase; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageRequestDto; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java index 51955b7b69..fa7e9249c2 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComponentsImpl.java @@ -47,13 +47,12 @@ import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto; import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto; import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; -import org.openecomp.sdcrests.wrappers.StringWrapperResponse; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; +import java.util.Collection; import javax.inject.Named; import javax.ws.rs.core.Response; -import java.util.Collection; @Named @Service("components") diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java index ec445af0e8..599b5adac7 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ComputeImpl.java @@ -30,7 +30,6 @@ import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeEntityToComputeCreation import org.openecomp.sdcrests.vsp.rest.mapping.MapComputeEntityToComputeDto; import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto; import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java index adcdacaa88..03372269fc 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/DeploymentFlavorsImpl.java @@ -25,7 +25,6 @@ import org.openecomp.sdcrests.vsp.rest.mapping.MapDeploymentFlavorEntityToDeploy import org.openecomp.sdcrests.vsp.rest.mapping.MapDeploymentFlavorRequestDtoToDeploymentFlavorEntity; import org.openecomp.sdcrests.vsp.rest.mapping.MapDeploymentFlavorToDeploymentDto; import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java index c939eb57ae..fcaf038dc0 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ImagesImpl.java @@ -1,7 +1,6 @@ package org.openecomp.sdcrests.vsp.rest.services; -import io.swagger.annotations.ApiParam; import org.apache.commons.collections.CollectionUtils; import org.openecomp.sdc.logging.context.MdcUtil; import org.openecomp.sdc.logging.types.LoggerServiceName; @@ -9,39 +8,30 @@ import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager; import org.openecomp.sdc.vendorsoftwareproduct.ComponentManagerFactory; import org.openecomp.sdc.vendorsoftwareproduct.ImageManager; import org.openecomp.sdc.vendorsoftwareproduct.ImageManagerFactory; -import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity; import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Image; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ImageData; import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdc.versioning.types.VersionableEntityAction; -import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityResponseDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.CompositionEntityValidationDataDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageCreationDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.ImageRequestDto; import org.openecomp.sdcrests.vendorsoftwareproducts.types.QuestionnaireResponseDto; import org.openecomp.sdcrests.vsp.rest.Images; -import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityResponseToDto; import org.openecomp.sdcrests.vsp.rest.mapping.MapCompositionEntityValidationDataToDto; -import org.openecomp.sdcrests.vsp.rest.mapping.MapImageDataToImageDto; import org.openecomp.sdcrests.vsp.rest.mapping.MapImageEntityToImageCreationDto; import org.openecomp.sdcrests.vsp.rest.mapping.MapImageEntityToImageDto; import org.openecomp.sdcrests.vsp.rest.mapping.MapImageRequestDtoToImageEntity; import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto; import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; import java.util.Collection; import javax.inject.Named; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; -import javax.ws.rs.HeaderParam; import javax.ws.rs.core.Response; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java index 1612c964a1..73ca82ada3 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/NicsImpl.java @@ -49,13 +49,12 @@ import org.openecomp.sdcrests.vsp.rest.mapping.MapNicRequestDtoToNicEntity; import org.openecomp.sdcrests.vsp.rest.mapping.MapNicToNicDto; import org.openecomp.sdcrests.vsp.rest.mapping.MapQuestionnaireResponseToQuestionnaireResponseDto; import org.openecomp.sdcrests.wrappers.GenericCollectionWrapper; -import org.openecomp.sdcrests.wrappers.StringWrapperResponse; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; +import java.util.Collection; import javax.inject.Named; import javax.ws.rs.core.Response; -import java.util.Collection; @Named @Service("nics") diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java index 07cef57251..172c8940e9 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/OrchestrationTemplateCandidateImpl.java @@ -27,12 +27,12 @@ import org.openecomp.sdcrests.vsp.rest.mapping.MapValidationResponseToDto; import org.springframework.context.annotation.Scope; import org.springframework.stereotype.Service; -import javax.inject.Named; -import javax.ws.rs.core.Response; import java.io.IOException; import java.io.InputStream; import java.lang.reflect.InvocationTargetException; import java.util.Optional; +import javax.inject.Named; +import javax.ws.rs.core.Response; import static org.openecomp.core.utilities.file.FileUtils.getFileExtension; import static org.openecomp.core.utilities.file.FileUtils.getNetworkPackageName; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java index a175908cd1..6bc7a37eee 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-services/src/main/java/org/openecomp/sdcrests/vsp/rest/services/ProcessesImpl.java @@ -20,6 +20,8 @@ package org.openecomp.sdcrests.vsp.rest.services; +import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID; + import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; @@ -36,8 +38,6 @@ import org.springframework.stereotype.Service; import javax.inject.Named; import javax.ws.rs.core.Response; -import static org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants.GENERAL_COMPONENT_ID; - @Named @Service("processes") @Scope(value = "prototype") diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModel.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModel.java index 4e908ed99d..097a00dad4 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModel.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComponentDependencyModel.java @@ -1,8 +1,6 @@ package org.openecomp.sdcrests.vendorsoftwareproducts.types; -import org.hibernate.validator.constraints.NotBlank; - public class ComponentDependencyModel { private String sourceId; diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDetailsDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDetailsDto.java index 92ad0fdb0c..d3e68b8446 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDetailsDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ComputeDetailsDto.java @@ -2,7 +2,6 @@ package org.openecomp.sdcrests.vendorsoftwareproducts.types; import org.hibernate.validator.constraints.NotBlank; -import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; public class ComputeDetailsDto implements CompositionDataEntityDto { diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java index baf6707ddf..3bc0b95626 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/DeploymentFlavorRequestDto.java @@ -5,7 +5,6 @@ import org.hibernate.validator.constraints.NotBlank; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation; import java.util.List; -import javax.validation.constraints.Pattern; import javax.validation.constraints.Size; public class DeploymentFlavorRequestDto { diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageRequestDto.java index 4386245342..3210104376 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageRequestDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/ImageRequestDto.java @@ -2,9 +2,6 @@ package org.openecomp.sdcrests.vendorsoftwareproducts.types; import org.hibernate.validator.constraints.NotBlank; -import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; - public class ImageRequestDto implements CompositionDataEntityDto { @NotBlank(message = "is mandatory and should not be empty") diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java index fdf953c80c..f4663fb2ae 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/NicRequestDto.java @@ -24,7 +24,6 @@ import org.hibernate.validator.constraints.NotBlank; import org.openecomp.sdcrests.vendorsoftwareproducts.types.validation.ValidateString; import javax.validation.constraints.NotNull; -import javax.validation.constraints.Pattern; public class NicRequestDto { diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java index c2bf49aa63..00f4569e5e 100644 --- a/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java +++ b/openecomp-be/api/openecomp-sdc-rest-webapp/vendor-software-products-rest/vendor-software-products-rest-types/src/main/java/org/openecomp/sdcrests/vendorsoftwareproducts/types/QuestionnaireValidationResultDto.java @@ -20,7 +20,6 @@ package org.openecomp.sdcrests.vendorsoftwareproducts.types; -import java.util.List; import java.util.Set; public class QuestionnaireValidationResultDto { diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java index 36493e2b14..f9b6bfe8a9 100644 --- a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java @@ -694,11 +694,13 @@ public class ActionManagerImpl implements ActionManager { String artifactName = artifactMetadata.getArtifactName(); String generatedArtifactUuId = generateActionArtifactUuId(action, artifactName); if (generatedArtifactUuId.equals(artifactUuId)) { - ActionArtifactEntity artifactDeleteEntity = - new ActionArtifactEntity(artifact.getArtifactUuId(), - getEffectiveVersion(action.getVersion())); - actionLogPreProcessor(ActionSubOperation.DELETE_ACTION_ARTIFACT, TARGET_ENTITY_DB); - actionArtifactDao.delete(artifactDeleteEntity); + if (artifact != null) { + ActionArtifactEntity artifactDeleteEntity = + new ActionArtifactEntity(artifact.getArtifactUuId(), + getEffectiveVersion(action.getVersion())); + actionLogPreProcessor(ActionSubOperation.DELETE_ACTION_ARTIFACT, TARGET_ENTITY_DB); + actionArtifactDao.delete(artifactDeleteEntity); + } actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); log.metrics(""); } @@ -1041,11 +1043,11 @@ public class ActionManagerImpl implements ActionManager { action.setActionUuId(existingAction.getActionUuId()); } catch (IllegalArgumentException iae) { String message = iae.getMessage(); - switch (message) { - case VERSION_STRING_VIOLATION_MSG: - throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, message); - default: - throw iae; + if(message == VERSION_STRING_VIOLATION_MSG) { + throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, message); + } + else { + throw iae; } } } diff --git a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java index 9dbdf760de..376cfca933 100644 --- a/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-application-config-manager/src/main/java/org/openecomp/sdc/applicationconfig/impl/ApplicationConfigManagerImpl.java @@ -29,6 +29,8 @@ import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -41,6 +43,9 @@ import java.util.Collection; * Created by Talio on 8/8/2016. */ public class ApplicationConfigManagerImpl implements ApplicationConfigManager { + + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR = "SCHEMA_GENERATOR_INITIALIZATION_ERROR"; private static final String SCHEMA_GENERATOR_INITIALIZATION_ERROR_MSG = @@ -52,6 +57,7 @@ public class ApplicationConfigManagerImpl implements ApplicationConfigManager { try { applicationConfig.insertValue(namespace, key, value); } catch (Exception exception) { + log.debug("",exception); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.INSERT_INTO_APPLICATION_CONFIG, ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), diff --git a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java index b8015c0962..7b0d325d64 100644 --- a/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java +++ b/openecomp-be/backend/openecomp-sdc-validation-manager/src/main/java/org/openecomp/sdc/validation/errors/ValidationInvalidErrorBuilder.java @@ -53,13 +53,13 @@ public class ValidationInvalidErrorBuilder extends BaseErrorBuilder { } private String toString(Map<String, List<ErrorMessage>> errors) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); errors.entrySet().stream() .forEach(entry -> singleErrorToString(sb, entry.getKey(), entry.getValue())); return sb.toString(); } - private void singleErrorToString(StringBuffer sb, String fileName, List<ErrorMessage> errors) { + private void singleErrorToString(StringBuilder sb, String fileName, List<ErrorMessage> errors) { sb.append(System.lineSeparator()); sb.append(fileName); sb.append(sb.append(": ")); diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java index 1acd44511a..edbf165ec1 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java @@ -20,6 +20,8 @@ package org.openecomp.sdc.vendorlicense.impl; +import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE; + import org.openecomp.core.util.UniqueValueUtil; import org.openecomp.sdc.activityLog.ActivityLogManager; import org.openecomp.sdc.activityLog.ActivityLogManagerFactory; @@ -77,14 +79,11 @@ import java.time.LocalDate; import java.time.format.DateTimeFormatter; import java.util.ArrayList; import java.util.Collection; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Optional; import java.util.Set; -import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_VERSIONABLE_TYPE; - public class VendorLicenseManagerImpl implements VendorLicenseManager { private VersioningManager versioningManager; private VendorLicenseFacade vendorLicenseFacade; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LimitTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LimitTest.java index c71b591a04..07fdeeeee8 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LimitTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/LimitTest.java @@ -29,10 +29,10 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.Spy; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorlicense.dao.LimitDao; import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; -import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; -import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity; import org.openecomp.sdc.vendorlicense.dao.types.LimitType; import org.openecomp.sdc.vendorlicense.errors.VendorLicenseErrorCodes; @@ -52,10 +52,10 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import static org.mockito.Mockito.when; - public class LimitTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private final String USER1 = "limitTestUser1"; private final String LT1_NAME = "LT1 name"; @@ -92,7 +92,7 @@ public class LimitTest { } @BeforeMethod - public void setUp() throws Exception { + public void setUp() { MockitoAnnotations.initMocks(this); } @@ -150,6 +150,7 @@ public class LimitTest { vendorLicenseManagerImpl.updateLimit(limitEntity2,USER1); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), VersioningErrorCodes.VERSIONABLE_SUB_ENTITY_NOT_FOUND); } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseFacadeImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseFacadeImplTest.java index 53e9857a32..ab6262d8ca 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseFacadeImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/VendorLicenseFacadeImplTest.java @@ -230,4 +230,4 @@ public class VendorLicenseFacadeImplTest { return ep; } */ -}
\ No newline at end of file +} diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/FeatureGroupTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/FeatureGroupTest.java index aa606913e1..dd3560615e 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/FeatureGroupTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/FeatureGroupTest.java @@ -21,6 +21,9 @@ package org.openecomp.sdc.vendorlicense.impl; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.doReturn; + import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -129,7 +132,7 @@ public class FeatureGroupTest { } @BeforeMethod - public void setUp() throws Exception{ + public void setUp() { MockitoAnnotations.initMocks(this); } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseKeyGroupTest.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseKeyGroupTest.java index acd1ce8cce..f0dd383a1f 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseKeyGroupTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/test/java/org/openecomp/sdc/vendorlicense/impl/LicenseKeyGroupTest.java @@ -26,6 +26,8 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.Spy; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorlicense.dao.LicenseKeyGroupDao; import org.openecomp.sdc.vendorlicense.dao.LimitDao; import org.openecomp.sdc.vendorlicense.dao.types.*; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java index 91912bc0c9..f808d542f1 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/errors/UploadInvalidErrorBuilder.java @@ -59,13 +59,13 @@ public class UploadInvalidErrorBuilder extends BaseErrorBuilder { } private String toString(Map<String, List<ErrorMessage>> errors) { - StringBuffer sb = new StringBuffer(); + StringBuilder sb = new StringBuilder(); errors.entrySet().stream() .forEach(entry -> singleErrorToString(sb, entry.getKey(), entry.getValue())); return sb.toString(); } - private void singleErrorToString(StringBuffer sb, String fileName, List<ErrorMessage> errors) { + private void singleErrorToString(StringBuilder sb, String fileName, List<ErrorMessage> errors) { sb.append(System.lineSeparator()); sb.append(fileName); sb.append(sb.append(": ")); diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerImpl.java index 86774381e0..5dc1446601 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelManagerImpl.java @@ -12,7 +12,6 @@ import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManager; import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager; -import org.openecomp.sdc.vendorsoftwareproduct.ComponentManagerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity; import org.openecomp.sdc.vendorsoftwareproduct.errors.ComponentDependencyModelErrorBuilder; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerFactoryImpl.java index 05a088f76a..dac68b5c47 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerFactoryImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerFactoryImpl.java @@ -24,7 +24,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager; import org.openecomp.sdc.vendorsoftwareproduct.ComponentManagerFactory; import org.openecomp.sdc.vendorsoftwareproduct.NicManagerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionEntityDataManagerFactory; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImpl.java index 42c8d12b3a..b5ca183ab7 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImpl.java @@ -52,7 +52,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentCo import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.ComponentQuestionnaireSchemaInput; import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext; import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput; -import org.openecomp.sdc.vendorsoftwareproduct.utils.VendorSoftwareProductUtils; import org.openecomp.sdc.versioning.VersioningUtil; import org.openecomp.sdc.versioning.dao.types.Version; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java index fc5857bb59..be90b08af9 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImpl.java @@ -12,7 +12,6 @@ import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.vendorsoftwareproduct.ComputeManager; -import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao; @@ -20,7 +19,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; -import org.openecomp.sdc.vendorsoftwareproduct.errors.ComputeErrorBuilder; import org.openecomp.sdc.vendorsoftwareproduct.errors.DuplicateComputeInComponentErrorBuilder; import org.openecomp.sdc.vendorsoftwareproduct.errors.NotSupportedHeatOnboardMethodErrorBuilder; import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerFactoryImpl.java index aef8be1fef..92ec7b7d2e 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerFactoryImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerFactoryImpl.java @@ -3,16 +3,11 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; import org.openecomp.sdc.vendorsoftwareproduct.DeploymentFlavorManager; import org.openecomp.sdc.vendorsoftwareproduct.DeploymentFlavorManagerFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionEntityDataManagerFactory; -import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager; public class DeploymentFlavorManagerFactoryImpl extends DeploymentFlavorManagerFactory { diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImpl.java index 5bf144e77e..0873eaf921 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImpl.java @@ -10,7 +10,6 @@ import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; import org.openecomp.sdc.vendorsoftwareproduct.DeploymentFlavorManager; -import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImpl.java index 9daec08d49..82b71399aa 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImpl.java @@ -37,12 +37,17 @@ import org.openecomp.sdc.versioning.dao.types.Version; import java.util.Collection; import java.util.stream.Collectors; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; + public class ImageManagerImpl implements ImageManager { private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); private VendorSoftwareProductInfoDao vspInfoDao; private ImageDao imageDao; private CompositionEntityDataManager compositionEntityDataManager; + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + public ImageManagerImpl( VendorSoftwareProductInfoDao vspInfoDao, ImageDao imageDao, @@ -276,6 +281,7 @@ public class ImageManagerImpl implements ImageManager { final ImageFormat imageFormat = ImageFormat.valueOf(format); } } catch (IllegalArgumentException exception) { + log.debug("", exception); ErrorCode errorCode = ImageErrorBuilder.getInvalidImageFormatErrorBuilder(); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.UPDATE_IMAGE, ErrorLevel.ERROR.name(), diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImpl.java index 06e54528b7..8bdc7fdfce 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImpl.java @@ -6,6 +6,8 @@ import org.openecomp.sdc.generator.core.services.ManualVspToscaGenerationService import org.openecomp.sdc.generator.datatypes.tosca.DeploymentFlavorModel; import org.openecomp.sdc.generator.datatypes.tosca.MultiFlavorVfcImage; import org.openecomp.sdc.generator.datatypes.tosca.VspModelInfo; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; @@ -27,6 +29,8 @@ public class ManualVspToscaManagerImpl implements ManualVspToscaManager { private ManualVspDataCollectionService manualVspDataCollectionService = new ManualVspDataCollectionService(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @Override public VspModelInfo gatherVspInformation(String vspId, Version version, String user) { mdcDataDebugMessage.debugEntryMessage(null, null); @@ -36,6 +40,7 @@ public class ManualVspToscaManagerImpl implements ManualVspToscaManager { try { releaseVendor = manualVspDataCollectionService.getReleaseVendor(vspId, version, user); } catch (Exception ex) { + log.debug("", ex); releaseVendor = Optional.empty(); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API, LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(), @@ -49,6 +54,7 @@ public class ManualVspToscaManagerImpl implements ManualVspToscaManager { try { allowedFlavors = manualVspDataCollectionService.getAllowedFlavors(vspId, version, user); } catch (Exception ex) { + log.debug("", ex); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API, LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to collect allowed flavors : " @@ -65,6 +71,7 @@ public class ManualVspToscaManagerImpl implements ManualVspToscaManager { vspComponentImages = manualVspDataCollectionService.getVspComponentImages(vspId, version, user); } catch (Exception ex) { + log.debug("", ex); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API, LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to collect vsp component images : " @@ -80,6 +87,7 @@ public class ManualVspToscaManagerImpl implements ManualVspToscaManager { try { vspComponents = manualVspDataCollectionService.getVspComponents(vspId, version, user); } catch (Exception ex) { + log.debug("", ex); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API, LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to collect vsp components : " @@ -95,6 +103,7 @@ public class ManualVspToscaManagerImpl implements ManualVspToscaManager { try { vspComponentNics = manualVspDataCollectionService.getVspComponentNics(vspId, version, user); } catch (Exception ex) { + log.debug("", ex); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API, LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to collect vsp component nics : " diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImpl.java index fcf54eef2f..0f4d73f8c5 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImpl.java @@ -73,6 +73,8 @@ public class MonitoringUploadsManagerImpl implements MonitoringUploadsManager { private static final Logger logger = LoggerFactory.getLogger(VendorSoftwareProductManagerImpl.class); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + MonitoringUploadsManagerImpl(ComponentArtifactDao componentArtifactDao, ActivityLogManager activityLogManager) { this.componentArtifactDao = componentArtifactDao; @@ -145,6 +147,7 @@ public class MonitoringUploadsManagerImpl implements MonitoringUploadsManager { uploadedFileData); } catch (Exception exception) { + log.debug("", exception); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.UPLOAD_MONITORING_FILE, ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Invalid " + type.toString() + "zip file"); @@ -259,6 +262,7 @@ public class MonitoringUploadsManagerImpl implements MonitoringUploadsManager { contentMap = CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.ZIP, uploadedFileData); VendorSoftwareProductUtils.validateContentZipData(contentMap, errors); } catch (IOException exception) { + log.debug("", exception); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.VALIDATE_MONITORING_FILE, ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Invalid Monitoring zip file"); diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java index 339e05c16f..4df00fd74a 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImpl.java @@ -26,6 +26,8 @@ import org.openecomp.sdc.activityLog.ActivityLogManager; import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; @@ -53,6 +55,8 @@ public class ProcessManagerImpl implements ProcessManager { private VendorSoftwareProductDao vendorSoftwareProductDao; + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + public ProcessManagerImpl(VendorSoftwareProductDao vendorSoftwareProductDao, ActivityLogManager activityLogManager) { this.vendorSoftwareProductDao = vendorSoftwareProductDao; this.activityLogManager = activityLogManager; @@ -170,6 +174,7 @@ public class ProcessManagerImpl implements ProcessManager { fos.write(retrieved.getArtifact().array()); fos.close(); } catch (IOException exception) { + log.debug("", exception); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.GET_PROCESS_ARTIFACT, ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Can't get process artifact"); @@ -216,6 +221,7 @@ public class ProcessManagerImpl implements ProcessManager { try { artifact = FileUtils.toByteArray(artifactFile); } catch (RuntimeException exception) { + log.debug("", exception); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.UPLOAD_PROCESS_ARTIFACT, ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Can't upload process artifact"); diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java index 78c4cbf5d9..f4015ab848 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java @@ -22,7 +22,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.MapUtils; -import org.openecomp.core.converter.datatypes.Constants; import org.openecomp.core.enrichment.api.EnrichmentManager; import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory; import org.openecomp.core.model.dao.EnrichedServiceModelDao; @@ -38,6 +37,7 @@ import org.openecomp.core.validation.util.MessageContainerUtil; import org.openecomp.sdc.activityLog.ActivityLogManager; import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.common.errors.ValidationErrorBuilder; import org.openecomp.sdc.common.utils.CommonUtil; @@ -136,18 +136,19 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; +import java.util.Optional; import java.util.Set; import java.util.zip.ZipInputStream; import java.util.zip.ZipOutputStream; public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductManager { - private static String VALIDATION_VSP_ID = "validationOnlyVspId"; + private String VALIDATION_VSP_ID = "validationOnlyVspId"; private static final String VALIDATION_VSP_NAME = "validationOnlyVspName"; //private static final String VALIDATION_VSP_USER = "validationOnlyVspUser"; private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); private static final Logger logger = - LoggerFactory.getLogger(VendorSoftwareProductManagerImpl.class); + LoggerFactory.getLogger(VendorSoftwareProductManagerImpl.class); private OrchestrationTemplateDao orchestrationTemplateDao; private VendorSoftwareProductInfoDao vspInfoDao; @@ -184,21 +185,21 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa * @param nicDao the nic dao */ public VendorSoftwareProductManagerImpl( - VersioningManager versioningManager, - VendorSoftwareProductDao vendorSoftwareProductDao, - OrchestrationTemplateDao orchestrationTemplateDataDao, - VendorSoftwareProductInfoDao vspInfoDao, - VendorLicenseFacade vendorLicenseFacade, - ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao, - EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao, - HealingManager healingManager, - VendorLicenseArtifactsService licenseArtifactsService, - InformationArtifactGenerator informationArtifactGenerator, - PackageInfoDao packageInfoDao, - ActivityLogManager activityLogManager, - DeploymentFlavorDao deploymentFlavorDao, - NicDao nicDao, - ManualVspToscaManager manualVspToscaManager) { + VersioningManager versioningManager, + VendorSoftwareProductDao vendorSoftwareProductDao, + OrchestrationTemplateDao orchestrationTemplateDataDao, + VendorSoftwareProductInfoDao vspInfoDao, + VendorLicenseFacade vendorLicenseFacade, + ServiceModelDao<ToscaServiceModel, ServiceElement> serviceModelDao, + EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> enrichedServiceModelDao, + HealingManager healingManager, + VendorLicenseArtifactsService licenseArtifactsService, + InformationArtifactGenerator informationArtifactGenerator, + PackageInfoDao packageInfoDao, + ActivityLogManager activityLogManager, + DeploymentFlavorDao deploymentFlavorDao, + NicDao nicDao, + ManualVspToscaManager manualVspToscaManager) { this.versioningManager = versioningManager; this.vendorSoftwareProductDao = vendorSoftwareProductDao; this.orchestrationTemplateDao = orchestrationTemplateDataDao; @@ -220,11 +221,11 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa private void registerToVersioning() { vendorSoftwareProductDao.registerVersioning( - VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); + VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); serviceModelDao.registerVersioning( - VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); + VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); enrichedServiceModelDao.registerVersioning( - VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); + VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE); } @Override @@ -233,13 +234,13 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa MDC.put(LoggerConstants.SERVICE_NAME, LoggerServiceName.Checkout_Entity.toString()); Version newVersion = versioningManager - .checkout(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, - vendorSoftwareProductId, user); + .checkout(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, + vendorSoftwareProductId, user); if (newVersion != null) { ActivityLogEntity activityLogEntity = - new ActivityLogEntity(vendorSoftwareProductId, String.valueOf(newVersion.getMajor() + 1), - ActivityType.CHECKOUT.toString(), user, true, "", ""); + new ActivityLogEntity(vendorSoftwareProductId, String.valueOf(newVersion.getMajor() + 1), + ActivityType.CHECKOUT.toString(), user, true, "", ""); activityLogManager.addActionLog(activityLogEntity, user); } @@ -253,18 +254,18 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugEntryMessage("VSP id", vendorSoftwareProductId); Version version = - getVersionInfo(vendorSoftwareProductId, VersionableEntityAction.Read, user) - .getActiveVersion(); + getVersionInfo(vendorSoftwareProductId, VersionableEntityAction.Read, user) + .getActiveVersion(); String preVspName = vspInfoDao - .get(new VspDetails(vendorSoftwareProductId, version)).getName(); + .get(new VspDetails(vendorSoftwareProductId, version)).getName(); Version newVersion = versioningManager.undoCheckout( - VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, - vendorSoftwareProductId, user); + VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, + vendorSoftwareProductId, user); String postVspName = vspInfoDao - .get(new VspDetails(vendorSoftwareProductId, newVersion)) - .getName(); + .get(new VspDetails(vendorSoftwareProductId, newVersion)) + .getName(); updateUniqueName(preVspName, postVspName); @@ -278,13 +279,13 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugEntryMessage("VSP id", vendorSoftwareProductId); Version newVersion = versioningManager.checkin( - VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, - vendorSoftwareProductId, user, null); + VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, + vendorSoftwareProductId, user, null); if (newVersion != null) { ActivityLogEntity activityLogEntity = - new ActivityLogEntity(vendorSoftwareProductId, String.valueOf(newVersion.getMajor() + 1), - ActivityType.CHECKIN.toString(), user, true, "", ""); + new ActivityLogEntity(vendorSoftwareProductId, String.valueOf(newVersion.getMajor() + 1), + ActivityType.CHECKIN.toString(), user, true, "", ""); activityLogManager.addActionLog(activityLogEntity, user); } @@ -301,48 +302,56 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa VspDetails vspDetails = getVsp(vspId, version, user); UploadDataEntity uploadData = orchestrationTemplateDao.getOrchestrationTemplate(vspId, version); ToscaServiceModel serviceModel = - serviceModelDao.getServiceModel(vspId, vspDetails.getVersion()); + serviceModelDao.getServiceModel(vspId, vspDetails.getVersion()); ValidationResponse validationResponse = new ValidationResponse(); validationResponse - .setVspErrors(validateCompletedVendorSoftwareProduct(vspDetails, uploadData, serviceModel), - LoggerServiceName.Submit_VSP, LoggerTragetServiceName.SUBMIT_VSP); + .setVspErrors(validateCompletedVendorSoftwareProduct(vspDetails, uploadData, serviceModel), + LoggerServiceName.Submit_VSP, LoggerTragetServiceName.SUBMIT_VSP); if (isCyclicDependencyInComponents(vspId, vspDetails.getVersion())) { Collection<ErrorCode> vspErrors = validationResponse.getVspErrors() == null - ? new ArrayList<>() - : validationResponse.getVspErrors(); + ? new ArrayList<>() + : validationResponse.getVspErrors(); vspErrors.add(ComponentDependencyModelErrorBuilder - .getcyclicDependencyComponentErrorBuilder()); + .getcyclicDependencyComponentErrorBuilder()); validationResponse.setVspErrors(vspErrors, LoggerServiceName.Submit_VSP, - LoggerTragetServiceName.SUBMIT_VSP); + LoggerTragetServiceName.SUBMIT_VSP); } validationResponse.setLicensingDataErrors(validateLicensingData(vspDetails)); validationResponse - .setUploadDataErrors(validateUploadData(uploadData,vspDetails), LoggerServiceName.Submit_VSP, - LoggerTragetServiceName.SUBMIT_VSP); + .setUploadDataErrors(validateUploadData(uploadData, vspDetails), + LoggerServiceName.Submit_VSP, + LoggerTragetServiceName.SUBMIT_VSP); validationResponse.setQuestionnaireValidationResult( - validateQuestionnaire(vspDetails.getId(), vspDetails.getVersion(), vspDetails - .getOnboardingMethod())); + validateQuestionnaire(vspDetails.getId(), vspDetails.getVersion(), vspDetails + .getOnboardingMethod())); if (vspDetails.getOnboardingMethod().equals("Manual")) { - Collection<ErrorCode> deploymentFlavourValidationErrList = deploymentFlavorValidation(vspDetails.getId(), vspDetails.getVersion()); + Collection<ErrorCode> deploymentFlavourValidationErrList = + deploymentFlavorValidation(vspDetails.getId(), vspDetails.getVersion()); if (validationResponse.getVspErrors() != null) { - if(deploymentFlavourValidationErrList != null) + if (deploymentFlavourValidationErrList != null) { validationResponse.getVspErrors().addAll(deploymentFlavourValidationErrList); + } } else { - validationResponse.setVspErrors(deploymentFlavourValidationErrList, LoggerServiceName.Submit_VSP, + validationResponse + .setVspErrors(deploymentFlavourValidationErrList, LoggerServiceName.Submit_VSP, LoggerTragetServiceName.SUBMIT_VSP); } - Set<CompositionEntityValidationData> compositionEntityValidationData = componentValidation(vspDetails.getId(), vspDetails.getVersion()); + Set<CompositionEntityValidationData> compositionEntityValidationData = + componentValidation(vspDetails.getId(), vspDetails.getVersion()); if (validationResponse.getQuestionnaireValidationResult() != null) { - if(!CollectionUtils.isEmpty(compositionEntityValidationData)) - validationResponse.getQuestionnaireValidationResult().getValidationData().addAll(compositionEntityValidationData); + if (!CollectionUtils.isEmpty(compositionEntityValidationData)) { + validationResponse.getQuestionnaireValidationResult().getValidationData() + .addAll(compositionEntityValidationData); + } } else { - validationResponse.setQuestionnaireValidationResult(CollectionUtils.isEmpty(compositionEntityValidationData) ? null : + validationResponse.setQuestionnaireValidationResult( + CollectionUtils.isEmpty(compositionEntityValidationData) ? null : new QuestionnaireValidationResult(compositionEntityValidationData)); } @@ -351,16 +360,16 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa serviceModel = manualVspToscaManager.generateToscaModel(vspModelInfo); } validationResponse.setCompilationErrors( - compile(vspId, vspDetails.getVersion(), serviceModel), - LoggerServiceName.Submit_VSP, LoggerTragetServiceName.SUBMIT_VSP); + compile(vspId, vspDetails.getVersion(), serviceModel), + LoggerServiceName.Submit_VSP, LoggerTragetServiceName.SUBMIT_VSP); if (validationResponse.isValid()) { Version newVersion = versioningManager.submit( - VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, - vspId, user, null); + VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, + vspId, user, null); ActivityLogEntity activityLogEntity = new ActivityLogEntity(vspDetails.getId(), String - .valueOf(newVersion.getMajor()), - ActivityType.SUBMIT.toString(), user, true, "", ""); + .valueOf(newVersion.getMajor()), + ActivityType.SUBMIT.toString(), user, true, "", ""); activityLogManager.addActionLog(activityLogEntity, user); } @@ -371,7 +380,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa private boolean isCyclicDependencyInComponents(String vendorSoftwareProductId, Version version) { final Collection<ComponentDependencyModelEntity> componentDependencyModelEntities = - vendorSoftwareProductDao.listComponentDependencies(vendorSoftwareProductId, version); + vendorSoftwareProductDao.listComponentDependencies(vendorSoftwareProductId, version); ComponentDependencyTracker dependencyTracker = new ComponentDependencyTracker(); for (ComponentDependencyModelEntity entity : componentDependencyModelEntities) { @@ -386,42 +395,44 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa Set<CompositionEntityValidationData> validationData = new HashSet<>(); Collection<ErrorCode> errorCodeList = new ArrayList<>(); Collection<DeploymentFlavorEntity> deploymentFlavors = - vendorSoftwareProductDao.listDeploymentFlavors(vspId, version); + vendorSoftwareProductDao.listDeploymentFlavors(vspId, version); if (!CollectionUtils.isEmpty(deploymentFlavors)) { deploymentFlavors.forEach(deploymentFlavor -> { DeploymentFlavorEntity deployment = vendorSoftwareProductDao.getDeploymentFlavor(vspId, - version, deploymentFlavor.getId()); + version, deploymentFlavor.getId()); DeploymentFlavor deploymentlocalFlavor = deployment.getDeploymentFlavorCompositionData(); if (deploymentlocalFlavor != null) { - if (deploymentlocalFlavor.getFeatureGroupId() == null ) { + if (deploymentlocalFlavor.getFeatureGroupId() == null) { ErrorCode deploymentFlavorErrorBuilder = DeploymentFlavorErrorBuilder. - getFeatureGroupMandatoryErrorBuilder(deploymentlocalFlavor.getModel()); + getFeatureGroupMandatoryErrorBuilder(deploymentlocalFlavor.getModel()); errorCodeList.add(deploymentFlavorErrorBuilder); } List<ComponentComputeAssociation> componetComputeAssociations = new ArrayList<>(); componetComputeAssociations = deploymentlocalFlavor.getComponentComputeAssociations(); if (CollectionUtils.isEmpty(componetComputeAssociations)) { CompositionEntityValidationData compositionEntityValidationData = new - CompositionEntityValidationData(CompositionEntityType.deployment,deploymentFlavor - .getId()); + CompositionEntityValidationData(CompositionEntityType.deployment, deploymentFlavor + .getId()); compositionEntityValidationData.setEntityName(deployment - .getDeploymentFlavorCompositionData().getModel()); + .getDeploymentFlavorCompositionData().getModel()); ErrorCode deploymentFlavorErrorBuilder = DeploymentFlavorErrorBuilder - .getInvalidComponentComputeAssociationErrorBuilder(deploymentlocalFlavor.getModel()); + .getInvalidComponentComputeAssociationErrorBuilder( + deploymentlocalFlavor.getModel()); errorCodeList.add(deploymentFlavorErrorBuilder); } else { componetComputeAssociations.forEach(componetComputeAssociation -> { if (componetComputeAssociation == null - || !(componetComputeAssociation.getComponentId() != null - && componetComputeAssociation.getComputeFlavorId() != null)) { + || !(componetComputeAssociation.getComponentId() != null + && componetComputeAssociation.getComputeFlavorId() != null)) { CompositionEntityValidationData compositionEntityValidationData = new - CompositionEntityValidationData(CompositionEntityType.deployment, - deploymentFlavor.getId()); + CompositionEntityValidationData(CompositionEntityType.deployment, + deploymentFlavor.getId()); compositionEntityValidationData.setEntityName(deployment - .getDeploymentFlavorCompositionData().getModel()); + .getDeploymentFlavorCompositionData().getModel()); ErrorCode deploymentFlavorErrorBuilder = DeploymentFlavorErrorBuilder - .getInvalidComponentComputeAssociationErrorBuilder(deploymentlocalFlavor.getModel()); + .getInvalidComponentComputeAssociationErrorBuilder( + deploymentlocalFlavor.getModel()); errorCodeList.add(deploymentFlavorErrorBuilder); } @@ -437,7 +448,8 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugEntryMessage("VSP id", vspId); Set<CompositionEntityValidationData> validationData = new HashSet<>(); - Collection<ComponentEntity> components = vendorSoftwareProductDao.listComponents(vspId,version); + Collection<ComponentEntity> components = + vendorSoftwareProductDao.listComponents(vspId, version); if (!CollectionUtils.isEmpty(components)) { components.forEach(component -> { validateImage(vspId, version, validationData, component); @@ -452,19 +464,20 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa private void validateNic(String vspId, Version version, Set<CompositionEntityValidationData> validationData, ComponentEntity component) { - Collection<NicEntity> nics = nicDao.list(new NicEntity(vspId,version, component.getId(),null)); + Collection<NicEntity> nics = + nicDao.list(new NicEntity(vspId, version, component.getId(), null)); if (CollectionUtils.isNotEmpty(nics)) { nics.forEach(nicEntity -> { NicEntity nic = nicDao.get(new NicEntity(vspId, version, component.getId(), - nicEntity.getId())); + nicEntity.getId())); NetworkType networkType = nic.getNicCompositionData().getNetworkType(); String networkId = nic.getNicCompositionData().getNetworkId(); if (networkType.equals(NetworkType.Internal) && networkId == null) { CompositionEntityValidationData compositionEntityValidationData = new - CompositionEntityValidationData(CompositionEntityType.nic, nic.getId()); + CompositionEntityValidationData(CompositionEntityType.nic, nic.getId()); compositionEntityValidationData.setEntityName(nic.getNicCompositionData().getName()); ErrorCode nicInternalNetworkErrorBuilder = NicInternalNetworkErrorBuilder - .getNicNullNetworkIdInternalNetworkIdErrorBuilder(); + .getNicNullNetworkIdInternalNetworkIdErrorBuilder(); List<String> errors = new ArrayList<>(); errors.add(nicInternalNetworkErrorBuilder.message()); compositionEntityValidationData.setErrors(errors); @@ -477,15 +490,15 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa private void validateImage(String vspId, Version version, Set<CompositionEntityValidationData> validationData, ComponentEntity component) { - Collection<ImageEntity> images = vendorSoftwareProductDao.listImages(vspId,version, - component.getId()); + Collection<ImageEntity> images = vendorSoftwareProductDao.listImages(vspId, version, + component.getId()); if (CollectionUtils.isEmpty(images)) { CompositionEntityValidationData compositionEntityValidationData = new - CompositionEntityValidationData(component.getType(),component.getId()); + CompositionEntityValidationData(component.getType(), component.getId()); compositionEntityValidationData.setEntityName(component.getComponentCompositionData() - .getDisplayName()); + .getDisplayName()); ErrorCode vfcMissingImageErrorBuilder = - ComponentErrorBuilder.VfcMissingImageErrorBuilder(); + ComponentErrorBuilder.VfcMissingImageErrorBuilder(); List<String> errors = new ArrayList<>(); errors.add(vfcMissingImageErrorBuilder.message()); compositionEntityValidationData.setErrors(errors); @@ -494,9 +507,8 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa } - private List<ErrorCode> validateCompletedVendorSoftwareProduct( - VspDetails vspDetails, UploadDataEntity uploadData, Object serviceModel) { + VspDetails vspDetails, UploadDataEntity uploadData, Object serviceModel) { List<ErrorCode> errors = new ArrayList<>(); @@ -518,10 +530,10 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa if (vspDetails.getOnboardingMethod().equals("Manual")) { //Manual Onboarding specific validations Collection<DeploymentFlavorEntity> deploymentFlavorEntities = vendorSoftwareProductDao - .listDeploymentFlavors(vspDetails.getId(), vspDetails.getVersion()); - if (CollectionUtils.isEmpty(deploymentFlavorEntities) ) { + .listDeploymentFlavors(vspDetails.getId(), vspDetails.getVersion()); + if (CollectionUtils.isEmpty(deploymentFlavorEntities)) { ErrorCode vspMissingDeploymentFlavorErrorBuilder = - VendorSoftwareProductInvalidErrorBuilder.VspMissingDeploymentFlavorErrorBuilder(); + VendorSoftwareProductInvalidErrorBuilder.VspMissingDeploymentFlavorErrorBuilder(); errors.add(vspMissingDeploymentFlavorErrorBuilder); } errors.addAll(validateMandatoryLicenseFields(vspDetails)); @@ -529,11 +541,11 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa //Heat flow specific VSP validations if (uploadData == null || uploadData.getContentData() == null || serviceModel == null) { errors.add(VendorSoftwareProductInvalidErrorBuilder - .VendorSoftwareProductMissingServiceModelErrorBuilder(vspDetails.getId(), - vspDetails.getVersion())); + .VendorSoftwareProductMissingServiceModelErrorBuilder(vspDetails.getId(), + vspDetails.getVersion())); } if (vspDetails.getVlmVersion() != null || vspDetails.getLicenseAgreement() != null - || vspDetails.getFeatureGroups() != null) { + || vspDetails.getFeatureGroups() != null) { errors.addAll(validateMandatoryLicenseFields(vspDetails)); } } @@ -544,7 +556,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa List<ErrorCode> errors = new ArrayList<>(); if (vspDetails.getVlmVersion() == null) { errors.add(createMissingMandatoryFieldError( - "licensing version (in the format of: {integer}.{integer})")); + "licensing version (in the format of: {integer}.{integer})")); } if (vspDetails.getLicenseAgreement() == null) { errors.add(createMissingMandatoryFieldError("license agreement")); @@ -563,13 +575,13 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugEntryMessage(null); mdcDataDebugMessage.debugExitMessage(null); return SchemaGenerator - .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.vsp, schemaInput); + .generate(SchemaTemplateContext.questionnaire, CompositionEntityType.vsp, schemaInput); } private static void sortVspListByModificationTimeDescOrder( - List<VersionedVendorSoftwareProductInfo> vsps) { + List<VersionedVendorSoftwareProductInfo> vsps) { vsps.sort((o1, o2) -> o2.getVspDetails().getWritetimeMicroSeconds() - .compareTo(o1.getVspDetails().getWritetimeMicroSeconds())); + .compareTo(o1.getVspDetails().getWritetimeMicroSeconds())); } @@ -582,21 +594,22 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa enrichedServiceModelDao.deleteAll(vendorSoftwareProductId, version); EnrichmentManager<ToscaServiceModel> enrichmentManager = - EnrichmentManagerFactory.getInstance().createInterface(); + EnrichmentManagerFactory.getInstance().createInterface(); enrichmentManager.init(vendorSoftwareProductId, version); enrichmentManager.setModel(serviceModel); Map<String, List<ErrorMessage>> enrichErrors = enrichmentManager.enrich(); if (MapUtils.isEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, enrichErrors))) { logger.audit(AuditMessages.AUDIT_MSG + AuditMessages.ENRICHMENT_COMPLETED - + vendorSoftwareProductId); + + vendorSoftwareProductId); } else { enrichErrors.values().forEach(errorList -> - auditIfContainsErrors(errorList,vendorSoftwareProductId,AuditMessages.ENRICHMENT_ERROR)); + auditIfContainsErrors(errorList, vendorSoftwareProductId, + AuditMessages.ENRICHMENT_ERROR)); } enrichedServiceModelDao - .storeServiceModel(vendorSoftwareProductId, version, enrichmentManager.getModel()); + .storeServiceModel(vendorSoftwareProductId, version, enrichmentManager.getModel()); return enrichErrors; } @@ -605,15 +618,15 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugEntryMessage("VSP id", vspDetails.getId()); if (vspDetails.getVendorId() == null || vspDetails.getVlmVersion() == null - || vspDetails.getLicenseAgreement() == null - || CollectionUtils.isEmpty(vspDetails.getFeatureGroups())) { + || vspDetails.getLicenseAgreement() == null + || CollectionUtils.isEmpty(vspDetails.getFeatureGroups())) { return null; } mdcDataDebugMessage.debugExitMessage("VSP id", vspDetails.getId()); return vendorLicenseFacade - .validateLicensingData(vspDetails.getVendorId(), vspDetails.getVlmVersion(), - vspDetails.getLicenseAgreement(), vspDetails.getFeatureGroups()); + .validateLicensingData(vspDetails.getVendorId(), vspDetails.getVlmVersion(), + vspDetails.getLicenseAgreement(), vspDetails.getFeatureGroups()); } @Override @@ -621,6 +634,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa try { validateUniqueName(VALIDATION_VSP_NAME); } catch (Exception ignored) { + logger.debug("",ignored); return VALIDATION_VSP_ID; } VspDetails validationVsp = new VspDetails(); @@ -628,8 +642,8 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa vspInfoDao.create(validationVsp); Version version = versioningManager.create( - VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, - validationVsp.getId(), user); + VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, + validationVsp.getId(), user); validationVsp.setVersion(version); createUniqueName(VALIDATION_VSP_NAME); @@ -647,15 +661,15 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa vspInfoDao.create(vspDetails);//id will be set in the dao vspInfoDao.updateQuestionnaireData(vspDetails.getId(), null, - new JsonSchemaDataGenerator(getVspQuestionnaireSchema(null)).generateData()); + new JsonSchemaDataGenerator(getVspQuestionnaireSchema(null)).generateData()); Version version = versioningManager - .create(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, - vspDetails.getId(), user); + .create(VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, + vspDetails.getId(), user); vspDetails.setVersion(version); ActivityLogEntity activityLogEntity = new ActivityLogEntity(vspDetails.getId(), String - .valueOf(vspDetails.getVersion().getMajor() + 1), - ActivityType.CREATE_NEW.toString(), user, true, "", ""); + .valueOf(vspDetails.getVersion().getMajor() + 1), + ActivityType.CREATE_NEW.toString(), user, true, "", ""); activityLogManager.addActionLog(activityLogEntity, user); String vspName = vspDetails.getName(); createUniqueName(vspName); @@ -668,8 +682,8 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugEntryMessage(null); Map<String, VersionInfo> idToVersionsInfo = versioningManager.listEntitiesVersionInfo( - VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, user, - VersionableEntityAction.Read); + VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, user, + VersionableEntityAction.Read); List<VersionedVendorSoftwareProductInfo> vsps = new ArrayList<>(); for (Map.Entry<String, VersionInfo> entry : idToVersionsInfo.entrySet()) { @@ -694,11 +708,12 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa vsps.add(new VersionedVendorSoftwareProductInfo(vsp, versionInfo)); } } catch (RuntimeException rte) { + logger.debug("",rte); logger.error( - "Error trying to retrieve vsp[" + entry.getKey() + "] version[" + version.toString - () + "] " + - "message:" + rte - .getMessage()); + "Error trying to retrieve vsp[" + entry.getKey() + "] version[" + version.toString + () + "] " + + "message:" + rte + .getMessage()); } } @@ -716,11 +731,11 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa VspDetails retrieved = vspInfoDao.get(vspDetails); if (!retrieved.getOnboardingMethod().equals(vspDetails.getOnboardingMethod())) { final ErrorCode onboardingMethodUpdateErrorCode = OnboardingMethodErrorBuilder - .getOnboardingUpdateError(); + .getOnboardingUpdateError(); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.UPDATE_VSP, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), onboardingMethodUpdateErrorCode.message()); + LoggerTragetServiceName.UPDATE_VSP, ErrorLevel.ERROR.name(), + LoggerErrorCode.DATA_ERROR.getErrorCode(), onboardingMethodUpdateErrorCode.message()); throw new CoreException(onboardingMethodUpdateErrorCode); } @@ -742,18 +757,18 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa final List<String> featureGroups = vspDetails.getFeatureGroups(); if (featureGroups != null) { final Collection<DeploymentFlavorEntity> deploymentFlavorEntities = deploymentFlavorDao - .list(new DeploymentFlavorEntity(vspDetails.getId(), vspDetails - .getVersion(), null)); + .list(new DeploymentFlavorEntity(vspDetails.getId(), vspDetails + .getVersion(), null)); if (Objects.nonNull(deploymentFlavorEntities)) { deploymentFlavorEntities.forEach(deploymentFlavorEntity -> { final String featureGroupId = - deploymentFlavorEntity.getDeploymentFlavorCompositionData().getFeatureGroupId(); - if ( !featureGroups.contains(featureGroupId)) { + deploymentFlavorEntity.getDeploymentFlavorCompositionData().getFeatureGroupId(); + if (!featureGroups.contains(featureGroupId)) { DeploymentFlavor deploymentFlavorCompositionData = - deploymentFlavorEntity.getDeploymentFlavorCompositionData(); + deploymentFlavorEntity.getDeploymentFlavorCompositionData(); deploymentFlavorCompositionData.setFeatureGroupId(null); deploymentFlavorEntity.setDeploymentFlavorCompositionData - (deploymentFlavorCompositionData); + (deploymentFlavorCompositionData); vendorSoftwareProductDao.updateDeploymentFlavor(deploymentFlavorEntity); } }); @@ -769,17 +784,17 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa VspDetails vsp = vspInfoDao.get(new VspDetails(vspId, version)); if (vsp == null) { MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.GET_VSP, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), "Requested VSP not found"); + LoggerTragetServiceName.GET_VSP, ErrorLevel.ERROR.name(), + LoggerErrorCode.DATA_ERROR.getErrorCode(), "Requested VSP not found"); throw new CoreException(new VendorSoftwareProductNotFoundErrorBuilder(vspId).build()); } vsp.setValidationData(orchestrationTemplateDao.getValidationData(vspId, version)); - if(Objects.isNull(vsp.getOnboardingOrigin())){ + if (Objects.isNull(vsp.getOnboardingOrigin())) { vsp.setOnboardingOrigin(OnboardingTypesEnum.ZIP.toString()); } - if(Objects.isNull(vsp.getNetworkPackageName())){ + if (Objects.isNull(vsp.getNetworkPackageName())) { vsp.setNetworkPackageName("Upload File"); } @@ -790,12 +805,12 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa @Override public Version callAutoHeal(String vspId, VersionInfo versionInfo, VspDetails vendorSoftwareProductInfo, String user) - throws Exception { + throws Exception { switch (versionInfo.getStatus()) { case Locked: if (user.equals(versionInfo.getLockingUser())) { autoHeal(vspId, versionInfo.getActiveVersion(), vendorSoftwareProductInfo, - versionInfo.getLockingUser()); + versionInfo.getLockingUser()); } return versionInfo.getActiveVersion(); case Available: @@ -816,6 +831,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa createPackage(vspId, finalVersion, user); return finalVersion; } catch (IOException ex) { + logger.debug("",ex); throw new Exception(ex.getMessage()); } default: @@ -831,12 +847,12 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugEntryMessage("VSP id", vspId); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.DELETE_VSP, ErrorLevel.ERROR.name(), - LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), "Unsupported operation"); + LoggerTragetServiceName.DELETE_VSP, ErrorLevel.ERROR.name(), + LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), "Unsupported operation"); mdcDataDebugMessage.debugExitMessage("VSP id", vspId); throw new UnsupportedOperationException( - VendorSoftwareProductConstants.UNSUPPORTED_OPERATION_ERROR); + VendorSoftwareProductConstants.UNSUPPORTED_OPERATION_ERROR); } @Override @@ -846,11 +862,12 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa VersionInfo versionInfo = getVersionInfo(vspId, VersionableEntityAction.Read, user); version = VersionStatus.Locked.equals(versionInfo.getStatus()) - ? versionInfo.getActiveVersion() - : checkout(vspId, user); + ? versionInfo.getActiveVersion() + : checkout(vspId, user); version.setStatus(VersionStatus.Locked); - healingManager.healAll(getHealingParamsAsMap(vspId, version, user)); + Optional<String> errorMessages = + healingManager.healAll(getHealingParamsAsMap(vspId, version, user)); VspDetails vspDetails = new VspDetails(vspId, version); vspDetails.setOldVersion(null); @@ -858,6 +875,11 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa logger.audit("Healed VSP " + vspDetails.getId()); mdcDataDebugMessage.debugExitMessage("VSP id", vspId); + + if (errorMessages.isPresent()) { + throw new CoreException(new ErrorCode.ErrorCodeBuilder().withId("HEALING_ERROR") + .withCategory(ErrorCategory.APPLICATION).withMessage(errorMessages.get()).build()); + } } private void autoHeal(String vspId, Version checkoutVersion, VspDetails vspDetails, String user) { @@ -865,14 +887,20 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa checkoutVersion.setStatus(VersionStatus.Locked); Map<String, Object> healingParams = getHealingParamsAsMap(vspId, checkoutVersion, user); - healingManager.healAll(healingParams); + + Optional<String> errorMessages = healingManager.healAll(healingParams); + vspDetails.setVersion(checkoutVersion); vspDetails.setOldVersion(null); vspInfoDao.updateOldVersionIndication(vspDetails); logger.audit("Healed VSP " + vspDetails.getName()); - mdcDataDebugMessage.debugExitMessage("VSP id", vspId); + + if (errorMessages.isPresent()) { + throw new CoreException(new ErrorCode.ErrorCodeBuilder().withId("HEALING_ERROR") + .withCategory(ErrorCategory.APPLICATION).withMessage(errorMessages.get()).build()); + } } private Map<String, Object> getHealingParamsAsMap(String vspId, Version version, String user) { @@ -897,24 +925,24 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa if (version == null) { errorMessage = "Package not found"; MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.GET_TRANSLATED_FILE, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); + LoggerTragetServiceName.GET_TRANSLATED_FILE, ErrorLevel.ERROR.name(), + LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); throw new CoreException(new PackageNotFoundErrorBuilder(vspId).build()); } else if (!version.isFinal()) { errorMessage = "Invalid requested version"; MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.GET_VERSION_INFO, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); + LoggerTragetServiceName.GET_VERSION_INFO, ErrorLevel.ERROR.name(), + LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); throw new CoreException(new RequestedVersionInvalidErrorBuilder().build()); } PackageInfo packageInfo = - packageInfoDao.get(new PackageInfo(vspId, version)); + packageInfoDao.get(new PackageInfo(vspId, version)); if (packageInfo == null) { errorMessage = "Package not found"; MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.GET_TRANSLATED_FILE, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); + LoggerTragetServiceName.GET_TRANSLATED_FILE, ErrorLevel.ERROR.name(), + LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); throw new CoreException(new PackageNotFoundErrorBuilder(vspId, version).build()); } @@ -922,8 +950,8 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa if (translatedFileBuffer == null) { errorMessage = "Package not found"; MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.GET_TRANSLATED_FILE, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); + LoggerTragetServiceName.GET_TRANSLATED_FILE, ErrorLevel.ERROR.name(), + LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); throw new CoreException(new PackageInvalidErrorBuilder(vspId, version).build()); } @@ -936,10 +964,10 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa } catch (IOException exception) { errorMessage = "Can't create package"; MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.CREATE_TRANSLATED_FILE, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); + LoggerTragetServiceName.CREATE_TRANSLATED_FILE, ErrorLevel.ERROR.name(), + LoggerErrorCode.DATA_ERROR.getErrorCode(), errorMessage); throw new CoreException(new TranslationFileCreationErrorBuilder(vspId, version).build(), - exception); + exception); } mdcDataDebugMessage.debugExitMessage("VSP id", vspId); @@ -962,12 +990,12 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa try (final ZipOutputStream zos = new ZipOutputStream(baos); ZipInputStream zipStream = new ZipInputStream( - new ByteArrayInputStream(contentData.array()))) { + new ByteArrayInputStream(contentData.array()))) { zos.write(contentData.array()); } catch (IOException exception) { MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.GET_UPLOADED_HEAT, ErrorLevel.ERROR.name(), - LoggerErrorCode.DATA_ERROR.getErrorCode(), "Can't get uploaded HEAT"); + LoggerTragetServiceName.GET_UPLOADED_HEAT, ErrorLevel.ERROR.name(), + LoggerErrorCode.DATA_ERROR.getErrorCode(), "Can't get uploaded HEAT"); throw new CoreException(new FileCreationErrorBuilder(vspId).build(), exception); } @@ -981,11 +1009,11 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa if (!version.isFinal()) { MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.CREATE_PACKAGE, ErrorLevel.ERROR.name(), - LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), "Can't create package"); + LoggerTragetServiceName.CREATE_PACKAGE, ErrorLevel.ERROR.name(), + LoggerErrorCode.PERMISSION_ERROR.getErrorCode(), "Can't create package"); throw new CoreException( - new CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(vspId, version) - .build()); + new CreatePackageForNonFinalVendorSoftwareProductErrorBuilder(vspId, version) + .build()); } ToscaServiceModel toscaServiceModel = enrichedServiceModelDao.getServiceModel(vspId, version); @@ -995,13 +1023,13 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa PackageInfo packageInfo = createPackageInfo(vspId, vspDetails); ToscaFileOutputServiceCsarImpl toscaServiceTemplateServiceCsar = - new ToscaFileOutputServiceCsarImpl(); + new ToscaFileOutputServiceCsarImpl(); FileContentHandler licenseArtifacts = licenseArtifactsService - .createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, - vspDetails.getFeatureGroups(), user); + .createLicenseArtifacts(vspDetails.getId(), vspDetails.getVendorId(), vlmVersion, + vspDetails.getFeatureGroups(), user); //todo add tosca validation here packageInfo.setTranslatedFile(ByteBuffer.wrap( - toscaServiceTemplateServiceCsar.createOutputFile(toscaServiceModel, licenseArtifacts))); + toscaServiceTemplateServiceCsar.createOutputFile(toscaServiceModel, licenseArtifacts))); packageInfoDao.create(packageInfo); @@ -1032,7 +1060,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa VspQuestionnaireEntity retrieved = vspInfoDao.getQuestionnaire(vspId, version); VersioningUtil.validateEntityExistence(retrieved, new VspQuestionnaireEntity(vspId, version), - VspDetails.ENTITY_TYPE); + VspDetails.ENTITY_TYPE); String questionnaireData = retrieved.getQuestionnaireData(); @@ -1058,7 +1086,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa private Map<String, List<ErrorMessage>> validateUploadData(UploadDataEntity uploadData, VspDetails vspDetails) - throws IOException { + throws IOException { Map<String, List<ErrorMessage>> validationErrors = new HashMap<>(); if (uploadData == null || uploadData.getContentData() == null) { @@ -1066,24 +1094,26 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa } FileContentHandler fileContentMap = - CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.getOnboardingTypesEnum - (vspDetails.getOnboardingOrigin()), - uploadData.getContentData().array()); - //todo - check - ValidationManager validationManager = - ValidationManagerUtil.initValidationManager(fileContentMap); - validationErrors.putAll(validationManager.validate()); + CommonUtil.validateAndUploadFileContent(OnboardingTypesEnum.getOnboardingTypesEnum + (vspDetails.getOnboardingOrigin()), + uploadData.getContentData().array()); + + if (vspDetails.getOnboardingOrigin().equals(OnboardingTypesEnum.ZIP.name().toLowerCase())) { + ValidationManager validationManager = + ValidationManagerUtil.initValidationManager(fileContentMap); + validationErrors.putAll(validationManager.validate()); + } return - MapUtils.isEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, validationErrors)) - ? null : validationErrors; + MapUtils.isEmpty(MessageContainerUtil.getMessageByLevel(ErrorLevel.ERROR, validationErrors)) + ? null : validationErrors; } private VersionInfo getVersionInfo(String vendorSoftwareProductId, VersionableEntityAction action, String user) { return versioningManager.getEntityVersionInfo( - VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, - vendorSoftwareProductId, user, action); + VendorSoftwareProductConstants.VENDOR_SOFTWARE_PRODUCT_VERSIONABLE_TYPE, + vendorSoftwareProductId, user, action); } @@ -1094,9 +1124,9 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa // The apis of CompositionEntityDataManager used here are stateful! // so, it must be re-created from scratch when it is used! CompositionEntityDataManager compositionEntityDataManager = - CompositionEntityDataManagerFactory.getInstance().createInterface(); + CompositionEntityDataManagerFactory.getInstance().createInterface(); compositionEntityDataManager - .addEntity(vspInfoDao.getQuestionnaire(vspId, version), null); + .addEntity(vspInfoDao.getQuestionnaire(vspId, version), null); Collection<NicEntity> nics = vendorSoftwareProductDao.listNicsByVsp(vspId, version); @@ -1107,27 +1137,27 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa Nic nic = nicEntity.getNicCompositionData(); if (nic != null && nic.getName() != null) { List<String> nicNames = - nicNamesByComponent.computeIfAbsent(nicEntity.getComponentId(), k -> new ArrayList<>()); + nicNamesByComponent.computeIfAbsent(nicEntity.getComponentId(), k -> new ArrayList<>()); nicNames.add(nic.getName()); } } Collection<ComponentEntity> components = - vendorSoftwareProductDao.listComponentsCompositionAndQuestionnaire(vspId, version); + vendorSoftwareProductDao.listComponentsCompositionAndQuestionnaire(vspId, version); components.forEach(component -> compositionEntityDataManager.addEntity(component, - new ComponentQuestionnaireSchemaInput(nicNamesByComponent.get(component.getId()), - JsonUtil.json2Object(component.getQuestionnaireData(), Map.class)))); + new ComponentQuestionnaireSchemaInput(nicNamesByComponent.get(component.getId()), + JsonUtil.json2Object(component.getQuestionnaireData(), Map.class)))); Collection<ComputeEntity> computes = vendorSoftwareProductDao.listComputesByVsp(vspId, version); computes.forEach(compute -> compositionEntityDataManager.addEntity(compute, null)); - if ("Manual".equals(onboardingMethod) ) { + if ("Manual".equals(onboardingMethod)) { Collection<ImageEntity> images = vendorSoftwareProductDao.listImagesByVsp(vspId, version); images.forEach(image -> compositionEntityDataManager.addEntity(image, null)); } Map<CompositionEntityId, Collection<String>> errorsByEntityId = - compositionEntityDataManager.validateEntitiesQuestionnaire(); + compositionEntityDataManager.validateEntitiesQuestionnaire(); if (MapUtils.isNotEmpty(errorsByEntityId)) { compositionEntityDataManager.buildTrees(); compositionEntityDataManager.addErrorsToTrees(errorsByEntityId); @@ -1137,7 +1167,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugExitMessage("VSP id", vspId); return new QuestionnaireValidationResult( - compositionEntityDataManager.getAllErrorsByVsp(vspId)); + compositionEntityDataManager.getAllErrorsByVsp(vspId)); } mdcDataDebugMessage.debugExitMessage("VSP id", vspId); @@ -1158,11 +1188,11 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa File infoArtifactFile; try { infoArtifactAsByteBuffer = ByteBuffer.wrap(informationArtifactGenerator.generate(vspId, - version).getBytes()); + version).getBytes()); infoArtifactFile = - new File( - String.format(VendorSoftwareProductConstants.INFORMATION_ARTIFACT_NAME, vspName)); + new File( + String.format(VendorSoftwareProductConstants.INFORMATION_ARTIFACT_NAME, vspName)); OutputStream out = new BufferedOutputStream(new FileOutputStream(infoArtifactFile)); out.write(infoArtifactAsByteBuffer.array()); out.close(); @@ -1176,18 +1206,18 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa void validateUniqueName(String vspName) { UniqueValueUtil.validateUniqueValue( - VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, vspName); + VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, vspName); } void createUniqueName(String vspName) { UniqueValueUtil.createUniqueValue( - VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, vspName); + VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, vspName); } void updateUniqueName(String oldVspName, String newVspName) { UniqueValueUtil.updateUniqueValue( - VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, - oldVspName, newVspName); + VendorSoftwareProductConstants.UniqueValues.VENDOR_SOFTWARE_PRODUCT_NAME, + oldVspName, newVspName); } @Override @@ -1196,12 +1226,12 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa return vendorSoftwareProductDao.listComputesByVsp(vspId, version); } - private void auditIfContainsErrors(List<ErrorMessage> errorList, String vspId,String auditType) { + private void auditIfContainsErrors(List<ErrorMessage> errorList, String vspId, String auditType) { errorList.forEach(errorMessage -> { if (errorMessage.getLevel().equals(ErrorLevel.ERROR)) { logger.audit(AuditMessages.AUDIT_MSG + String.format(auditType, errorMessage.getMessage(), - vspId)); + vspId)); } }); } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java index 44c9d155c6..5615f8f6b5 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VspManagerFactoryImpl.java @@ -28,7 +28,6 @@ import org.openecomp.sdc.vendorlicense.VendorLicenseArtifactServiceFactory; import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; import org.openecomp.sdc.vendorsoftwareproduct.VspManagerFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory; @@ -36,7 +35,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.factory.InformationArtifactGeneratorFactory; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor; import org.openecomp.sdc.versioning.VersioningManagerFactory; public class VspManagerFactoryImpl extends VspManagerFactory { diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java index 3e059f4ccb..2599d4723d 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/QuestionnaireValidationResult.java @@ -22,7 +22,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.types; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData; -import java.util.List; import java.util.Set; public class QuestionnaireValidationResult { diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorTest.java index e3fa0a8480..45ba4fb434 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/DeploymentFlavorTest.java @@ -14,7 +14,7 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity; import org.openecomp.sdc.vendorsoftwareproduct.impl.VendorSoftwareProductManagerImpl; -import org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator.SchemaGenerator; + import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelTest.java index c6374375f9..c3f78b6cb0 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentDependencyModelTest.java @@ -5,24 +5,17 @@ import org.mockito.Mock; import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.Spy; -import org.openecomp.core.utilities.CommonMethods; import org.openecomp.sdc.common.errors.CoreException; -import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManager; -import org.openecomp.sdc.vendorsoftwareproduct.ComponentDependencyModelManagerFactory; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.ComponentManager; import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductManager; -import org.openecomp.sdc.vendorsoftwareproduct.VspManagerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao; -import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; import org.openecomp.sdc.vendorsoftwareproduct.errors.ComponentDependencyModelErrorBuilder; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; import org.openecomp.sdc.versioning.dao.types.Version; -import org.openecomp.sdc.versioning.errors.VersioningErrorCodes; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -31,10 +24,10 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import static org.mockito.Mockito.doReturn; - public class ComponentDependencyModelTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @Spy @InjectMocks private ComponentDependencyModelManagerImpl componentDependencyModelManager; @@ -90,7 +83,7 @@ public class ComponentDependencyModelTest { ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().id(), ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().message()); - entities.removeAll(entities); + entities.clear(); entities.add(createModelEntity("", sourceComp2Id)); testCreate_negative(entities, vsp1Id, VERSION01, USER1, ComponentDependencyModelErrorBuilder.getNoSourceComponentErrorBuilder().id(), @@ -142,6 +135,7 @@ public class ComponentDependencyModelTest { user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); Assert.assertEquals(exception.getMessage(), expectedErrorMsg); } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImplTest.java index 7cfcb05589..ee8295cafc 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComponentManagerImplTest.java @@ -6,6 +6,8 @@ import org.mockito.Mockito; import org.mockito.MockitoAnnotations; import org.mockito.Spy; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.NicManager; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; @@ -35,6 +37,9 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; public class ComponentManagerImplTest { + + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private static final String COMP_NOT_EXIST_MSG = "Vendor Software Product Component with Id 1 does not exist for Vendor Software Product with id VSP_ID and version 0.1"; private static final String USER = "componentsTestUser"; @@ -140,6 +145,7 @@ public class ComponentManagerImplTest { try { ComponentEntity created = componentManager.createComponent(expected, USER); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals("Creation of only one VFC per VSP allowed.", exception.code().message()); Assert.assertEquals(VendorSoftwareProductErrorCodes.VSP_VFC_COUNT_EXCEED, exception.code().id()); @@ -189,6 +195,7 @@ public class ComponentManagerImplTest { try { CompositionEntityValidationData created = componentManager.updateComponent(expected, USER); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals("VFC with specified name already present in given VSP.", exception.code().message()); Assert.assertEquals(VendorSoftwareProductErrorCodes.VSP_VFC_DUPLICATE_NAME, @@ -426,6 +433,7 @@ public class ComponentManagerImplTest { componentManager.createComponent(component, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -436,6 +444,7 @@ public class ComponentManagerImplTest { componentManager.getComponent(vspId, version, componentId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -447,6 +456,7 @@ public class ComponentManagerImplTest { .updateComponent(new ComponentEntity(vspId, version, componentId), user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -457,6 +467,7 @@ public class ComponentManagerImplTest { componentManager.listComponents(vspId, version, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -467,6 +478,7 @@ public class ComponentManagerImplTest { componentManager.deleteComponents(vspId, version, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -477,6 +489,7 @@ public class ComponentManagerImplTest { componentManager.deleteComponent(vspId, version, componentId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImplTest.java index bda77d0aa1..eda5693cce 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ComputeManagerImplTest.java @@ -1,30 +1,33 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; -import org.junit.runner.RunWith; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; + import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.Spy; import org.openecomp.sdc.common.errors.CoreException; -import org.openecomp.sdc.common.errors.ValidationErrorBuilder; -import org.openecomp.sdc.vendorsoftwareproduct.ComputeManager; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.NetworkManager; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao; -import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; -import org.openecomp.sdc.vendorsoftwareproduct.errors.DuplicateComputeInComponentErrorBuilder; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.DeploymentFlavorEntity; import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager; -import org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator.SchemaGenerator; import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; import org.openecomp.sdc.vendorsoftwareproduct.types.ListComputeResponse; import org.openecomp.sdc.vendorsoftwareproduct.types.QuestionnaireResponse; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.*; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData; +import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor; import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdc.versioning.errors.VersioningErrorCodes; import org.testng.Assert; @@ -36,14 +39,10 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - public class ComputeManagerImplTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private static final String COMPUTE_NOT_EXIST_MSG = "Vendor Software Product COMPUTE with Id compute1 does not exist for Vendor Software Product with " + "id VSP_ID and version 0.1"; @@ -153,6 +152,7 @@ public class ComputeManagerImplTest { Assert.fail(); } catch (CoreException ex) { + log.debug("",ex); Assert.assertEquals(VendorSoftwareProductErrorCodes.DUPLICATE_COMPUTE_NAME_NOT_ALLOWED, ex.code().id()); } @@ -227,6 +227,7 @@ public class ComputeManagerImplTest { computeManager.updateCompute(computeEntity, USER); } catch (CoreException ex) { + log.debug("",ex); Assert.assertEquals(ex.code().id(), VendorSoftwareProductErrorCodes.UPDATE_COMPUTE_NOT_ALLOWED); } @@ -315,6 +316,7 @@ public class ComputeManagerImplTest { computeManager.deleteCompute(vspId, version, componentId, computeId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -325,6 +327,7 @@ public class ComputeManagerImplTest { computeManager.getCompute(vspId, version, componentId, computeId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -335,6 +338,7 @@ public class ComputeManagerImplTest { computeManager.listCompute(vspId, version, componentId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); Assert.assertEquals(exception.getMessage(), expectedErrorMsg); } @@ -348,6 +352,7 @@ public class ComputeManagerImplTest { computeManager.updateCompute(new ComputeEntity(vspId, version, componentId, computeId), user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -357,6 +362,7 @@ public class ComputeManagerImplTest { computeManager.createCompute(computeEntity1, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java index 804af537df..82715d3fe6 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/DeploymentFlavorManagerImplTest.java @@ -11,6 +11,8 @@ import org.mockito.MockitoAnnotations; import org.mockito.Spy; import org.openecomp.core.utilities.json.JsonUtil; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao; @@ -38,6 +40,9 @@ import java.util.Collection; import java.util.List; public class DeploymentFlavorManagerImplTest { + + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private static final String USER = "depFlavorTestUser"; private static final String VSP_ID = "VSP_ID"; private static final Version VERSION = new Version(0, 1); @@ -108,6 +113,7 @@ public class DeploymentFlavorManagerImplTest { Assert.fail(); } catch (CoreException ex) { + log.debug("",ex); Assert.assertEquals(VendorSoftwareProductErrorCodes.DUPLICATE_DEPLOYMENT_FLAVOR_MODEL_NOT_ALLOWED, ex.code().id()); } @@ -137,6 +143,7 @@ public class DeploymentFlavorManagerImplTest { Assert.fail(); } catch (CoreException ex) { + log.debug("",ex); Assert.assertEquals(VendorSoftwareProductErrorCodes.FEATURE_GROUP_NOT_EXIST_FOR_VSP, ex.code().id()); } @@ -164,6 +171,7 @@ public class DeploymentFlavorManagerImplTest { deploymentFlavorManager.createDeploymentFlavor(expected, USER); } catch (CoreException ex) { + log.debug("",ex); Assert.assertEquals(VendorSoftwareProductErrorCodes.INVALID_COMPONENT_COMPUTE_ASSOCIATION, ex.code().id()); Assert.assertEquals("Invalid request,for valid association please provide ComponentId for Compute Flavor", @@ -198,6 +206,7 @@ public class DeploymentFlavorManagerImplTest { deploymentFlavorManager.createDeploymentFlavor(expected, USER); } catch (CoreException ex) { + log.debug("",ex); Assert.assertEquals(VendorSoftwareProductErrorCodes.INVALID_COMPUTE_FLAVOR_ID, ex.code().id()); } @@ -232,6 +241,7 @@ public class DeploymentFlavorManagerImplTest { deploymentFlavorManager.createDeploymentFlavor(expected, USER); } catch (CoreException ex) { + log.debug("",ex); Assert.assertEquals(VendorSoftwareProductErrorCodes.SAME_VFC_ASSOCIATION_MORE_THAN_ONCE_NOT_ALLOWED, ex.code().id()); } @@ -347,6 +357,7 @@ public class DeploymentFlavorManagerImplTest { deploymentFlavorManager.listDeploymentFlavors(vspId, version, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); Assert.assertEquals(exception.getMessage(), expectedErrorMsg); } @@ -358,6 +369,7 @@ public class DeploymentFlavorManagerImplTest { deploymentFlavorManager.createDeploymentFlavor(deploymentFlavorEntity, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -369,6 +381,7 @@ public class DeploymentFlavorManagerImplTest { deploymentFlavorManager.deleteDeploymentFlavor(vspId, version, deploymentFlavorId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -395,6 +408,7 @@ public class DeploymentFlavorManagerImplTest { .updateDeploymentFlavor(deploymentFlavorEntity, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -405,6 +419,7 @@ public class DeploymentFlavorManagerImplTest { deploymentFlavorManager.getDeploymentFlavor(vspId, version, deploymentFlavorId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImplTest.java index 741b1bf2ea..9f932b9fdf 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ImageManagerImplTest.java @@ -3,16 +3,19 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; import static org.mockito.Matchers.anyObject; import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.Spy; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager; import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; @@ -31,11 +34,10 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; - public class ImageManagerImplTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private static final String IMAGE_NOT_EXIST_MSG = "Vendor Software Product Image with Id image1 does not exist for Vendor Software Product with" + " " + @@ -194,6 +196,7 @@ public class ImageManagerImplTest { imageManager.updateImage(imageEntity, USER); } catch (CoreException ex) { + log.debug("",ex); Assert.assertEquals(ex.code().id(), VendorSoftwareProductErrorCodes.UPDATE_IMAGE_NOT_ALLOWED); } @@ -267,7 +270,6 @@ public class ImageManagerImplTest { String json = "{\"md5\" :\"FFDSD33SS\"}"; doReturn(true).when(vspInfoDao).isManual(anyObject(), anyObject()); doReturn(new ImageEntity()).when(imageDao).get(anyObject()); - imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, json, USER); verify(imageDao).updateQuestionnaireData(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, json); } @@ -292,6 +294,7 @@ public class ImageManagerImplTest { imageManager.updateImageQuestionnaire(VSP_ID, VERSION, COMPONENT_ID, IMAGE1_ID, json, USER); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), VendorSoftwareProductErrorCodes.DUPLICATE_IMAGE_VERSION_NOT_ALLOWED); } @@ -318,6 +321,7 @@ public class ImageManagerImplTest { Assert.fail(); } catch(CoreException ex) { + log.debug("",ex); Assert.assertEquals(ex.code().id(), VendorSoftwareProductErrorCodes.UPDATE_IMAGE_NOT_ALLOWED); } } @@ -338,6 +342,7 @@ public class ImageManagerImplTest { Assert.fail(); } catch(CoreException ex) { + log.debug("",ex); Assert.assertEquals(ex.code().id(), VendorSoftwareProductErrorCodes.VFC_IMAGE_INVALID_FORMAT); } } @@ -348,6 +353,7 @@ public class ImageManagerImplTest { imageManager.listImages(vspId, version, componentId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); Assert.assertEquals(exception.getMessage(), expectedErrorMsg); } @@ -358,6 +364,7 @@ public class ImageManagerImplTest { imageManager.createImage(image, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -369,6 +376,7 @@ public class ImageManagerImplTest { imageManager.deleteImage(vspId, version, componentId, nicId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -388,6 +396,7 @@ public class ImageManagerImplTest { imageManager.updateImage(new ImageEntity(vspId, version, componentId, imageId), user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImplTest.java index b65071ac51..ecfe0e6372 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ManualVspToscaManagerImplTest.java @@ -47,6 +47,7 @@ import org.openecomp.sdc.vendorsoftwareproduct.services.ManualVspDataCollectionS import org.openecomp.sdc.versioning.dao.types.Version; import java.util.ArrayList; +import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -95,6 +96,15 @@ public class ManualVspToscaManagerImplTest { private ManualVspDataCollectionService manualVspDataCollectionServiceMock; /* + private static List<String> supportedCapabilities = new ArrayList<>(); + private static List<String> supportedRequirements = new ArrayList<>(); + + static { + //TODO : Read from configuration + supportedCapabilities.addAll(Arrays.asList("host", "os", "endpoint", "scalable")); + supportedRequirements.addAll(Arrays.asList("link")); + } + @Test public void testGatherVspInformationInvalidVsp() { MockitoAnnotations.initMocks(this); @@ -439,9 +449,9 @@ public class ManualVspToscaManagerImplTest { private void validateSubstitutionCapabilities(Map<String, List<String>> capabilities, String componentName) { - List<String> supportedCapabilities = GeneratorUtils.supportedCapabilities; - Assert.assertEquals(supportedCapabilities.size(), capabilities.size()); - for (String capability : supportedCapabilities) { + List<String> SupportedCapabilities = supportedCapabilities; + Assert.assertEquals(SupportedCapabilities.size(), capabilities.size()); + for (String capability : SupportedCapabilities) { String expectedCapabilityId = capability + "_" + componentName; Assert.assertEquals(true, capabilities.containsKey(expectedCapabilityId)); List<String> expectedCapabilityValue = new ArrayList<>(2); @@ -454,10 +464,10 @@ public class ManualVspToscaManagerImplTest { private void validateSubstitutionRequirements(Map<String, List<String>> requirements, List<Nic> nics) { - List<String> supportedRequirements = GeneratorUtils.supportedRequirements; + List<String> SupportedRequirements = supportedRequirements; for(Nic nic : nics) { String nicNodeTemplateId = nic.getName() + PORT_NODE_TEMPLATE_ID_SUFFIX; - for (String requirement : supportedRequirements) { + for (String requirement : SupportedRequirements) { String expectedRequirementId = requirement + "_" + nicNodeTemplateId; Assert.assertEquals(true, requirements.containsKey(expectedRequirementId)); List<String> expectedRequirementValue = new ArrayList<>(2); @@ -498,11 +508,11 @@ public class ManualVspToscaManagerImplTest { List<Map<String, RequirementDefinition>> requirements = deploymentFlavorNodeType.getRequirements(); - List<String> supportedRequirements = GeneratorUtils.supportedRequirements; + List<String> SupportedRequirements = supportedRequirements; for (Nic nic : nics) { boolean found = false; String nicNodeTemplateId = nic.getName() + PORT_NODE_TEMPLATE_ID_SUFFIX; - for (String requirementId : supportedRequirements) { + for (String requirementId : SupportedRequirements) { String expectedRequirementId = requirementId + "_" + nicNodeTemplateId; for (Map<String, RequirementDefinition> requirement : requirements) { if (requirement.containsKey(expectedRequirementId)) { @@ -515,8 +525,8 @@ public class ManualVspToscaManagerImplTest { } Map<String, CapabilityDefinition> capabilities = deploymentFlavorNodeType.getCapabilities(); - List<String> supportedCapabilities = GeneratorUtils.supportedCapabilities; - for (String capabilityId : supportedCapabilities) { + List<String> SupportedCapabilities = supportedCapabilities; + for (String capabilityId : SupportedCapabilities) { String expectedCapabilityId = capabilityId + "_" + componentName; Assert.assertEquals (true, capabilities.containsKey(expectedCapabilityId)); } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImplTest.java index 534c630e40..e4dd39cfda 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/MonitoringUploadsManagerImplTest.java @@ -5,6 +5,8 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.openecomp.core.enrichment.types.MonitoringUploadType; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentArtifactDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentMonitoringUploadEntity; import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.MonitoringUploadStatus; @@ -27,6 +29,8 @@ import static org.mockito.Mockito.verify; public class MonitoringUploadsManagerImplTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private static final String USER1 = "ComponentsUploadTestUser"; private static final String COMPONENT_ID = "COMPONENT_ID"; private static final String VSP_ID = "vspId"; @@ -66,6 +70,7 @@ public class MonitoringUploadsManagerImplTest { MonitoringUploadType.VES_EVENTS, USER1); Assert.fail(); } catch (Exception exception) { + log.debug("",exception); Assert.assertEquals(exception.getMessage(), "Invalid zip file"); } } @@ -80,6 +85,7 @@ public class MonitoringUploadsManagerImplTest { MonitoringUploadType.SNMP_TRAP, USER1); Assert.fail(); } catch (Exception exception) { + log.debug("",exception); Assert.assertEquals(exception.getMessage(), "Zip file should not contain folders"); } } @@ -94,6 +100,7 @@ public class MonitoringUploadsManagerImplTest { MonitoringUploadType.VES_EVENTS, USER1); Assert.fail(); } catch (Exception exception) { + log.debug("",exception); Assert.assertEquals(exception.getMessage(), "Wrong VES EVENT Artifact was uploaded - all files contained in Artifact must be YAML " + "files (using .yaml/.yml extensions)"); @@ -157,7 +164,7 @@ public class MonitoringUploadsManagerImplTest { try { return url.openStream(); } catch (IOException exception) { - exception.printStackTrace(); + log.debug("",exception); return null; } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImplTest.java index f8710b8cc6..ebdbc6af7d 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NetworkManagerImplTest.java @@ -25,6 +25,8 @@ import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.Spy; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; @@ -49,6 +51,8 @@ import static org.mockito.Mockito.verify; public class NetworkManagerImplTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private static final String USER1 = "networksTestUser1"; private static final String USER2 = "networksTestUser2"; private static final String VSP_ID = "vsp"; @@ -239,6 +243,7 @@ public class NetworkManagerImplTest { networkManager.createNetwork(network, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -249,6 +254,7 @@ public class NetworkManagerImplTest { networkManager.getNetwork(vspId, version, networkId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -259,6 +265,7 @@ public class NetworkManagerImplTest { networkManager.updateNetwork(new NetworkEntity(vspId, version, networkId), user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -269,6 +276,7 @@ public class NetworkManagerImplTest { networkManager.listNetworks(vspId, version, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -279,6 +287,7 @@ public class NetworkManagerImplTest { networkManager.deleteNetwork(vspId, version, networkId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImplTest.java index fe275e9d68..ba04e91c63 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/NicManagerImplTest.java @@ -1,16 +1,22 @@ package org.openecomp.sdc.vendorsoftwareproduct.impl; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; + import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; import org.mockito.Spy; import org.openecomp.sdc.common.errors.CoreException; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.NetworkManager; import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager; import org.openecomp.sdc.vendorsoftwareproduct.types.CompositionEntityResponse; @@ -29,13 +35,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.never; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - public class NicManagerImplTest { + + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private static final String NIC_NOT_EXIST_MSG = "Vendor Software Product NIC with Id nic1 does not exist for Vendor Software Product with " + "id VSP_ID and version 0.1"; @@ -129,6 +132,7 @@ public class NicManagerImplTest { try { NicEntity created = nicManager.createNic(nicEntity,USER); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(VendorSoftwareProductErrorCodes.NIC_NAME_FORMAT_NOT_ALLOWED, exception.code().id()); } @@ -154,6 +158,7 @@ public class NicManagerImplTest { try { NicEntity created = nicManager.createNic(nicEntity,USER); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals("Invalid request, NIC with name "+ nic.getName() + " already exist for component with ID "+ nicEntity.getComponentId() +".", exception.code().message()); @@ -176,6 +181,7 @@ public class NicManagerImplTest { try { NicEntity created = nicManager.createNic(nicEntity,USER); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals("Invalid request,NetworkId not allowed for External Networks", exception.code().message()); Assert.assertEquals(VendorSoftwareProductErrorCodes.NETWORKID_NOT_ALLOWED_FOR_EXTERNAL_NETWORK, @@ -198,6 +204,7 @@ public class NicManagerImplTest { try { NicEntity created = nicManager.createNic(nicEntity,USER); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals("Invalid request, Network Description not allowed for Internal Networks", exception.code().message()); Assert.assertEquals(VendorSoftwareProductErrorCodes @@ -344,6 +351,7 @@ public class NicManagerImplTest { Assert.fail(); } catch (CoreException ex) { + log.debug("",ex); Assert.assertEquals(VendorSoftwareProductErrorCodes.NIC_NAME_FORMAT_NOT_ALLOWED, ex.code().id()); } @@ -442,6 +450,7 @@ public class NicManagerImplTest { nicManager.createNic(nic, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -452,6 +461,7 @@ public class NicManagerImplTest { nicManager.getNic(vspId, version, componentId, nicId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -462,6 +472,7 @@ public class NicManagerImplTest { nicManager.updateNic(new NicEntity(vspId, version, componentId, nicId), user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -473,6 +484,7 @@ public class NicManagerImplTest { nicManager.deleteNic(vspId, version, componentId, nicId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImplTest.java index f756e44776..478bdfbbba 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/ProcessManagerImplTest.java @@ -11,6 +11,8 @@ import org.openecomp.sdc.activitylog.dao.type.ActivityLogEntity; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessType; @@ -35,6 +37,7 @@ import static org.mockito.Matchers.eq; public class ProcessManagerImplTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); private static final String USER1 = "processesTestUser"; private static final String VSP_ID = "vsp"; @@ -315,6 +318,7 @@ public class ProcessManagerImplTest { processManager.getProcess(vspId, version, componentId, processId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -327,6 +331,7 @@ public class ProcessManagerImplTest { .updateProcess(new ProcessEntity(vspId, version, componentId, processId), user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -337,6 +342,7 @@ public class ProcessManagerImplTest { processManager.getProcessArtifact(vspId, version, componentId, processId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -350,6 +356,7 @@ public class ProcessManagerImplTest { vspId, version, componentId, processId, user); Assert.fail(); } catch (CoreException exception) { + log.error("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } @@ -360,6 +367,7 @@ public class ProcessManagerImplTest { processManager.deleteProcessArtifact(vspId, VERSION, componentId, processId, user); Assert.fail(); } catch (CoreException exception) { + log.debug("",exception); Assert.assertEquals(exception.code().id(), expectedErrorCode); } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java index e0e00f8d9d..77a847a2af 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImplTest.java @@ -40,6 +40,8 @@ import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.common.errors.Messages; import org.openecomp.sdc.healing.api.HealingManager; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.datatypes.model.CapabilityDefinition; import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; @@ -101,6 +103,9 @@ import static org.mockito.Mockito.verify; public class VendorSoftwareProductManagerImplTest { + + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private static final String INVALID_VERSION_MSG = "Invalid requested version."; private static String VSP_ID = "vspId"; @@ -669,6 +674,7 @@ public class VendorSoftwareProductManagerImplTest { url.openStream(), USER1, "zip", "notZipFile"); candidateManager.process(VSP_ID, VERSION01, USER1); } catch (Exception ce) { + log.debug("",ce); Assert.assertEquals(ce.getMessage(), Messages.CREATE_MANIFEST_FROM_ZIP.getErrorMessage()); } @@ -688,14 +694,19 @@ public class VendorSoftwareProductManagerImplTest { throws IOException { List<String> fileNames = new ArrayList<>(); - ZipInputStream zip = new ZipInputStream(new FileInputStream(csar)); - ZipEntry ze; - - while ((ze = zip.getNextEntry()) != null) { - String name = ze.getName(); - if (name.contains(folderName)) { - fileNames.add(name); + FileInputStream fileInputStream = new FileInputStream(csar); + try { + ZipInputStream zip = new ZipInputStream(fileInputStream); + ZipEntry ze; + + while ((ze = zip.getNextEntry()) != null) { + String name = ze.getName(); + if (name.contains(folderName)) { + fileNames.add(name); + } } + }finally { + fileInputStream.close(); } return fileNames; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImplTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImplTest.java index a85153ecef..2f85f30dc5 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImplTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImplTest.java @@ -23,6 +23,8 @@ package org.openecomp.sdc.vendorsoftwareproduct.services.impl.composition; import org.apache.commons.io.FileUtils; import org.mockito.InjectMocks; import org.mockito.MockitoAnnotations; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; import org.openecomp.sdc.tosca.services.ToscaUtil; @@ -52,6 +54,10 @@ import java.util.Map; */ public class CompositionDataExtractorImplTest { + + private static final Logger log = (Logger) LoggerFactory.getLogger + (CompositionDataExtractorImplTest.class.getName()); + @InjectMocks private static CompositionDataExtractorImpl compositionDataExtractor; @@ -108,6 +114,7 @@ public class CompositionDataExtractorImplTest { try { yamlFile.close(); } catch (IOException ignore) { + log.debug("",ignore); } } catch (FileNotFoundException exception) { throw exception; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java index 42eee1fb10..2174a6894a 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/TreeBaseTest.java @@ -22,6 +22,8 @@ package org.openecomp.sdc.vendorsoftwareproduct.tree; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.heat.services.tree.HeatTreeManager; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import java.io.File; import java.net.URISyntaxException; @@ -32,6 +34,8 @@ import java.net.URL; */ public class TreeBaseTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + String INPUT_DIR; @@ -44,18 +48,21 @@ public class TreeBaseTest { try { inputDir = new File(url.toURI()); } catch (URISyntaxException exception) { - exception.printStackTrace(); + log.debug("",exception); } - File[] files = inputDir.listFiles(); - for (File inputFile : files) { - try { - heatTreeManager.addFile(inputFile.getName(), FileUtils.loadFileToInputStream( - INPUT_DIR.replace("/", File.separator) + File.separator + inputFile.getName())); - } catch (Exception e) { - e.printStackTrace(); - throw e; + + if(inputDir != null) { + File[] files = inputDir.listFiles(); + for (File inputFile : files) { + try { + heatTreeManager.addFile(inputFile.getName(), FileUtils.loadFileToInputStream( + INPUT_DIR.replace("/", File.separator) + File.separator + inputFile.getName())); + } catch (Exception e) { + throw e; + } } } return heatTreeManager; + } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java index dfb7409bd0..df386b12cd 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/tree/UploadFileTest.java @@ -21,6 +21,9 @@ package org.openecomp.sdc.vendorsoftwareproduct.tree; +import static org.mockito.Matchers.any; +import static org.mockito.Mockito.doReturn; + import org.mockito.InjectMocks; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -29,6 +32,8 @@ import org.openecomp.core.model.dao.ServiceModelDao; import org.openecomp.core.model.types.ServiceElement; import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum; import org.openecomp.sdc.healing.api.HealingManager; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/utils/VSPCommon.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/utils/VSPCommon.java index 6bfe9e5eac..947f33922e 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/utils/VSPCommon.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/utils/VSPCommon.java @@ -21,6 +21,8 @@ package org.openecomp.sdc.vendorsoftwareproduct.utils; import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; import org.openecomp.sdc.versioning.dao.types.Version; @@ -35,6 +37,8 @@ import java.util.zip.ZipOutputStream; public class VSPCommon { + private static final Logger log = (Logger) LoggerFactory.getLogger(VSPCommon.class.getName()); + public static VspDetails createVspDetails(String id, Version version, String name, String desc, String vendorName, String vlm, String icon, String category, String subCategory, @@ -92,7 +96,7 @@ public class VSPCommon { zos.write(data); zos.closeEntry(); } catch (IOException exception) { - exception.printStackTrace(); + log.debug("",exception); } } } diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/utils/ZipFileUtils.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/utils/ZipFileUtils.java index 12324ed777..b2a6f2fe87 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/utils/ZipFileUtils.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/utils/ZipFileUtils.java @@ -20,6 +20,9 @@ package org.openecomp.sdc.vendorsoftwareproduct.utils; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; + import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.File; @@ -33,6 +36,7 @@ import java.util.zip.ZipOutputStream; * @since November 08, 2016 */ public class ZipFileUtils { + private static final Logger log = (Logger) LoggerFactory.getLogger(ZipFileUtils.class.getName()); public InputStream getZipInputStream(String name) { URL url = getClass().getResource(name); File templateDir = new File(url.getFile()); @@ -44,7 +48,7 @@ public class ZipFileUtils { try { zos.close(); } catch (IOException exception) { - exception.printStackTrace(); + log.debug("",exception); } return new ByteArrayInputStream(baos.toByteArray()); } diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java index 3b464ca107..b41d6647f5 100644 --- a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/CoreException.java @@ -22,7 +22,7 @@ package org.openecomp.sdc.common.errors; public class CoreException extends RuntimeException { - private ErrorCode errorCode; + private final ErrorCode errorCode; public CoreException(ErrorCode errorCode) { this(errorCode, null); diff --git a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java index 8bcb0a5ffe..72ad3335a4 100644 --- a/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java +++ b/openecomp-be/lib/openecomp-common-lib/src/main/java/org/openecomp/sdc/common/errors/Messages.java @@ -22,7 +22,7 @@ package org.openecomp.sdc.common.errors; public enum Messages { - CANT_LOAD_CLASS("Can't load class %s. Error: %s"), + CANT_LOAD_HEALING_CLASS("Can't load healing class %s."), VERSION_UPGRADE("Item %s is of old version. A check out was made in order to get new " + "functionalities"), diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java index 6d92330493..6b5c5f94c4 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-config-lib/src/test/java/org/openecomp/sdc/applicationconfig/dao/ApplicationConfigImplDaoTest.java @@ -30,6 +30,8 @@ import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; @@ -48,6 +50,11 @@ public class ApplicationConfigImplDaoTest { private static ApplicationConfig applicationConfig = ApplicationConfigFactory.getInstance().createInterface(); + private final static Logger log = (Logger) LoggerFactory.getLogger + (ApplicationConfigImplDaoTest.class.getName()); + + private final Logger logger = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @BeforeClass public static void init() { try { @@ -64,6 +71,7 @@ public class ApplicationConfigImplDaoTest { applicationConfigDao.create(applicationConfigEntity3); } catch (Exception e) { + log.debug("",e); throw new CoreException(new ErrorCode.ErrorCodeBuilder(). withCategory(ErrorCategory.APPLICATION). withId(SCHEMA_GENERATOR_INITIALIZATION_ERROR). @@ -91,6 +99,7 @@ public class ApplicationConfigImplDaoTest { try { applicationConfig.getConfigurationData("test - namespace", "aaa"); } catch (CoreException ce) { + logger.debug("", ce); Assert.assertEquals(ce.getMessage(), "Configuration for namespace test - namespace and key aaa was not found"); } diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java index d664cbee38..31822b6bdc 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-facade-lib/openecomp-facade-core/src/main/java/org/openecomp/core/factory/FactoryConfig.java @@ -35,7 +35,6 @@ public final class FactoryConfig { INSTANCE = CommonMethods.newInstance( "org.openecomp.core.factory.FactoriesConfigImpl", FactoriesConfiguration.class); } catch (Exception exception) { - exception.printStackTrace(); throw exception; } } diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java index 4ecc26879a..93410bc581 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraNoSqlDbImpl.java @@ -28,6 +28,8 @@ import org.openecomp.core.utilities.CommonMethods; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import java.util.Set; import java.util.stream.Collectors; @@ -38,6 +40,8 @@ class CassandraNoSqlDbImpl implements NoSqlDb { private final String keySpace; private final MappingManager mappingManager; + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + public CassandraNoSqlDbImpl(Session session) { this.session = session; @@ -109,6 +113,7 @@ class CassandraNoSqlDbImpl implements NoSqlDb { .collect(Collectors.toSet()); return versions.stream().collect(Collectors.joining(",")); } catch (Exception e){ + log.debug("",e); return "Failed to retrieve version"; } } diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java index 7b9b2ca84f..4bc8262439 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/impl/cassandra/CassandraSessionFactory.java @@ -20,12 +20,13 @@ package org.openecomp.core.nosqldb.impl.cassandra; -import com.google.common.base.Optional; - import com.datastax.driver.core.Cluster; import com.datastax.driver.core.SSLOptions; import com.datastax.driver.core.Session; +import com.google.common.base.Optional; import org.openecomp.core.nosqldb.util.CassandraUtils; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import java.io.FileInputStream; import java.io.IOException; @@ -36,11 +37,14 @@ import java.security.NoSuchAlgorithmException; import java.security.SecureRandom; import java.security.UnrecoverableKeyException; import java.security.cert.CertificateException; -import java.util.Objects; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; public class CassandraSessionFactory { + + private static final Logger log = (Logger) LoggerFactory.getLogger + (CassandraSessionFactory.class.getName()); + public static Session getSession() { return ReferenceHolder.CASSANDRA; } @@ -112,7 +116,7 @@ public class CassandraSessionFactory { ctx.init(null, tmf.getTrustManagers(), new SecureRandom()); } catch (Exception exception) { - exception.printStackTrace(); + log.debug("",exception); } finally { if (tsf != null) { tsf.close(); diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java index c00db41ed9..1f5e20fd0b 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/main/java/org/openecomp/core/nosqldb/util/ConfigurationManager.java @@ -20,6 +20,8 @@ package org.openecomp.core.nosqldb.util; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.services.YamlUtil; import java.io.FileInputStream; @@ -58,6 +60,8 @@ public class ConfigurationManager { private static ConfigurationManager instance = null; private final LinkedHashMap<String, Object> cassandraConfiguration; + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + private ConfigurationManager() { YamlUtil yamlUtil = new YamlUtil(); @@ -227,7 +231,7 @@ public class ConfigurationManager { try { is = new FileInputStream(file); } catch (FileNotFoundException exception) { - exception.printStackTrace(); + log.debug("",exception); } return is; } diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java index fc96335daf..5c4f951a7b 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-nosqldb-lib/openecomp-nosqldb-core/src/test/java/org/openecomp/core/nosqldb/NoSqlDbTest.java @@ -32,7 +32,7 @@ import java.util.List; public class NoSqlDbTest { - private static NoSqlDb noSqlDb; + private NoSqlDb noSqlDb; /* @Test diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java index 0fb587cc68..6ff213c34c 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/file/FileUtils.java @@ -23,6 +23,8 @@ package org.openecomp.core.utilities.file; import org.apache.commons.io.FilenameUtils; import org.apache.commons.io.IOUtils; import org.openecomp.core.utilities.json.JsonUtil; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.services.YamlUtil; import java.io.ByteArrayInputStream; @@ -43,6 +45,8 @@ import java.util.zip.ZipInputStream; */ public class FileUtils { + //private final static Logger log = (Logger) LoggerFactory.getLogger(FileUtils.class.getName()); + /** * Allows to consume an input stream open against a resource with a given file name. * diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java index 5f0bc90845..8454bc61a8 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-utilities-lib/src/main/java/org/openecomp/core/utilities/json/JsonUtil.java @@ -117,6 +117,7 @@ public class JsonUtil { try { is.close(); } catch (IOException ignore) { + logger.debug("",ignore); //do nothing } } @@ -136,6 +137,7 @@ public class JsonUtil { try { return new JsonParser().parse(json).isJsonObject(); } catch (JsonSyntaxException jse) { + logger.debug("",jse); return false; } } diff --git a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java index f4e8688d63..2ba447fd6a 100644 --- a/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java +++ b/openecomp-be/lib/openecomp-core-lib/openecomp-zusammen-lib/openecomp-zusammen-api/src/main/java/org/openecomp/core/zusammen/api/ZusammenAdaptor.java @@ -12,7 +12,6 @@ import com.amdocs.zusammen.datatypes.item.Item; import com.amdocs.zusammen.datatypes.item.ItemVersion; import com.amdocs.zusammen.datatypes.item.ItemVersionData; import com.amdocs.zusammen.datatypes.itemversion.Tag; -import org.apache.commons.lang3.tuple.ImmutablePair; import java.util.Collection; import java.util.Optional; diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java index a2ce153a82..211d9a21b2 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-api/src/main/java/org/openecomp/sdc/healing/api/HealingManager.java @@ -23,6 +23,7 @@ package org.openecomp.sdc.healing.api; import org.openecomp.sdc.healing.types.HealCode; import java.util.Map; +import java.util.Optional; /** * Created by Talio on 11/29/2016. @@ -30,5 +31,5 @@ import java.util.Map; public interface HealingManager { Object heal(HealCode code, Map<String, Object> healParameters); - void healAll(Map<String, Object> healParameters); + Optional<String> healAll(Map<String, Object> healParameters); } diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java index 0f2c0e7ee1..16f9c60d7f 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-core/src/main/java/org/openecomp/sdc/healing/impl/HealingManagerImpl.java @@ -20,6 +20,7 @@ package org.openecomp.sdc.healing.impl; +import org.openecomp.core.utilities.CommonMethods; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.core.utilities.json.JsonUtil; import org.openecomp.sdc.common.errors.Messages; @@ -33,8 +34,10 @@ import org.openecomp.sdc.logging.types.LoggerErrorCode; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; -import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; import java.util.Map; +import java.util.Optional; /** * Created by Talio on 11/29/2016. @@ -45,34 +48,53 @@ public class HealingManagerImpl implements HealingManager { @Override public Object heal(HealCode code, Map<String, Object> healParameters) { - String implClassName = healerCodeToImplClass.get(code.name()); - try { - Healer healerImpl = getHealerImplInstance(implClassName); - return healerImpl.heal(healParameters); + ArrayList<String> healingFailureMessages = new ArrayList<>(); + + Object result = + heal(healParameters, healerCodeToImplClass.get(code.name()), healingFailureMessages); + + if (!healingFailureMessages.isEmpty()) { + throw new RuntimeException(CommonMethods.listToSeparatedString(healingFailureMessages, '\n')); + } + return result; + } + @Override + public Optional<String> healAll(Map<String, Object> healParameters) { + ArrayList<String> healingFailureMessages = new ArrayList<>(); + + for (String implClassName : healerCodeToImplClass.values()) { + heal(healParameters, implClassName, healingFailureMessages); + } + + return healingFailureMessages.isEmpty() ? Optional.empty() + : Optional.of(CommonMethods.listToSeparatedString(healingFailureMessages, '\n')); + } + + private Object heal(Map<String, Object> healParameters, String healerImplClassName, + ArrayList<String> healingFailureMessages) { + Healer healerImpl; + try { + healerImpl = getHealerImplInstance(healerImplClassName); } catch (Exception e) { MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(), LoggerErrorCode .DATA_ERROR.getErrorCode(), LoggerErrorDescription.CANT_HEAL); - throw new RuntimeException(String.format(Messages.CANT_LOAD_CLASS.getErrorMessage(), - implClassName, e.getMessage())); + healingFailureMessages + .add(String.format(Messages.CANT_LOAD_HEALING_CLASS.getErrorMessage(), + healerImplClassName)); + return null; } - } - @Override - public void healAll(Map<String, Object> healParameters) { - for (String implClassName : healerCodeToImplClass.values()) { - try { - Healer healerImpl = getHealerImplInstance(implClassName); - healerImpl.heal(healParameters); - } catch (Exception e) { - MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, - LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(), LoggerErrorCode - .DATA_ERROR.getErrorCode(), LoggerErrorDescription.CANT_HEAL); - throw new RuntimeException(String.format(Messages.CANT_LOAD_CLASS.getErrorMessage(), - implClassName, e.getMessage())); - } + try { + return healerImpl.heal(healParameters); + } catch (Exception e) { + MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, + LoggerTragetServiceName.SELF_HEALING, ErrorLevel.ERROR.name(), LoggerErrorCode + .DATA_ERROR.getErrorCode(), LoggerErrorDescription.CANT_HEAL); + healingFailureMessages.add(e.getMessage()); } + return null; } private static Map<String, String> initHealers() { @@ -80,10 +102,8 @@ public class HealingManagerImpl implements HealingManager { } private Healer getHealerImplInstance(String implClassName) - throws ClassNotFoundException, NoSuchMethodException, InstantiationException, - IllegalAccessException, java.lang.reflect.InvocationTargetException { - Class<?> clazz = Class.forName(implClassName); - Constructor<?> constructor = clazz.getConstructor(); - return (Healer) constructor.newInstance(); + throws InstantiationException, IllegalAccessException, InvocationTargetException, + NoSuchMethodException, ClassNotFoundException { + return (Healer) Class.forName(implClassName).getConstructor().newInstance(); } } diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java index 2e63a8d50a..d061556e4c 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ComponentQuestionnaireHealer.java @@ -12,8 +12,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComputeEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ImageEntity; @@ -178,8 +176,7 @@ public class ComponentQuestionnaireHealer implements Healer { JsonObject computeQuestionnaireJsonObject = new JsonObject(); computeQuestionnaireJsonObject.add(VM_SIZING, vmSizing); - String computeQuestionnaire = computeQuestionnaireJsonObject != null ? - computeQuestionnaireJsonObject.toString() : null; + String computeQuestionnaire = computeQuestionnaireJsonObject.toString(); computeDao.updateQuestionnaireData(computeEntity.getVspId(), computeEntity.getVersion(), computeEntity.getComponentId(), computeEntity.getId(), computeQuestionnaire); compute.remove(VM_SIZING); diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/CompositionDataHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/CompositionDataHealer.java index 9800d02ba6..e3701743ec 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/CompositionDataHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/CompositionDataHealer.java @@ -31,6 +31,8 @@ import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum; import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.common.utils.SdcCommon; import org.openecomp.sdc.healing.interfaces.Healer; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; @@ -92,6 +94,8 @@ public class CompositionDataHealer implements Healer { private static CompositionEntityDataManager compositionEntityDataManager = CompositionEntityDataManagerFactory.getInstance().createInterface(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + public CompositionDataHealer() { } @@ -288,6 +292,7 @@ public class CompositionDataHealer implements Healer { serviceModelDao.storeServiceModel(vspId, version, translatorOutput.getToscaServiceModel()); } catch (Exception e) { + log.debug("", e); return Optional.empty(); } @@ -304,6 +309,7 @@ public class CompositionDataHealer implements Healer { OnboardingTypesEnum.ZIP, uploadData.getContentData().array()); return HeatToToscaUtil.loadAndTranslateTemplateData(fileContentHandler); } catch (Exception e) { + log.debug("", e); return null; } } diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/FileDataStructureHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/FileDataStructureHealer.java index 0d484440cf..4a0a5f9d63 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/FileDataStructureHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/FileDataStructureHealer.java @@ -27,6 +27,8 @@ import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.common.utils.SdcCommon; import org.openecomp.sdc.datatypes.error.ErrorMessage; import org.openecomp.sdc.healing.interfaces.Healer; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory; @@ -51,6 +53,8 @@ public class FileDataStructureHealer implements Healer { CandidateServiceFactory.getInstance().createInterface(); private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + public FileDataStructureHealer() { } @@ -104,6 +108,7 @@ public class FileDataStructureHealer implements Healer { healingResult = getFileDataStructureFromJson(candidateDataEntity.getFilesDataStructure()); }catch (Exception e){ + log.debug("", e); return Optional.empty(); } diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/HeatToToscaTranslationHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/HeatToToscaTranslationHealer.java index 44b6062e89..32cd8cbae3 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/HeatToToscaTranslationHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/HeatToToscaTranslationHealer.java @@ -12,6 +12,8 @@ import org.openecomp.core.utilities.orchestration.OnboardingTypesEnum; import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.common.utils.SdcCommon; import org.openecomp.sdc.healing.interfaces.Healer; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; @@ -34,6 +36,8 @@ public class HeatToToscaTranslationHealer implements Healer { templateDao = ServiceTemplateDaoFactory.getInstance().createInterface(); private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + public HeatToToscaTranslationHealer(){ } @@ -58,24 +62,25 @@ public class HeatToToscaTranslationHealer implements Healer { .getContentData().array()); translatorOutput = HeatToToscaUtil.loadAndTranslateTemplateData(fileContentHandler); - }catch (Exception e){ + } catch (Exception e) { + log.debug("", e); return Optional.empty(); } - if(Objects.isNull(translatorOutput)){ + if (Objects.isNull(translatorOutput)) { return Optional.empty(); - } + } else { - if (translatorOutput != null && translatorOutput.getToscaServiceModel() == null) { - return Optional.empty(); - } + if (translatorOutput.getToscaServiceModel() == null) { + return Optional.empty(); + } //templateDao.deleteAll(vspId, version); - serviceModelDao.deleteAll(vspId,version); - serviceModelDao.storeServiceModel(vspId, version, - translatorOutput.getToscaServiceModel()); - mdcDataDebugMessage.debugExitMessage("VSP id", vspId); + serviceModelDao.deleteAll(vspId, version); + serviceModelDao.storeServiceModel(vspId, version, translatorOutput.getToscaServiceModel()); + mdcDataDebugMessage.debugExitMessage("VSP id", vspId); - return translatorOutput; + return translatorOutput; + } } } diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java index 4e8de71ea3..130405be1d 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/SubEntitiesQuestionnaireHealer.java @@ -67,9 +67,9 @@ public class SubEntitiesQuestionnaireHealer implements Healer { : (Version) healingParams.get(SdcCommon.VERSION); Collection<ComponentEntity> componentEntities = - componentDao.listCompositionAndQuestionnaire(vspId, version); - networkDao.list(new NetworkEntity(vspId, version,null)); + + networkDao.list(new NetworkEntity(vspId, version, null)); Collection<NicEntity> nicEntities = vendorSoftwareProductDao.listNicsByVsp(vspId, version); @@ -90,7 +90,8 @@ public class SubEntitiesQuestionnaireHealer implements Healer { for (Object entity : compositionEntities) { CompositionEntity compositionEntity = (CompositionEntity) entity; - if (Objects.isNull(compositionEntity.getQuestionnaireData())) { + if (Objects.isNull(compositionEntity.getQuestionnaireData()) || + "".equals(compositionEntity.getQuestionnaireData())) { compositionEntity.setVersion(newVersion); updateNullQuestionnaire(compositionEntity, type); } diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java index f92fbd1730..58ba3b7c35 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/ValidationStructureHealer.java @@ -9,6 +9,8 @@ import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.structure.Artifact; import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; import org.openecomp.sdc.heat.datatypes.structure.ValidationStructureList; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; @@ -34,6 +36,7 @@ public class ValidationStructureHealer implements Healer { VendorSoftwareProductInfoDaoFactory.getInstance().createInterface(); private static final OrchestrationTemplateDao orchestrationTemplateDao = OrchestrationTemplateDaoFactory.getInstance().createInterface(); + private static final Logger logger = LoggerFactory.getLogger(JsonUtil.class); @Override public Object heal(Map<String, Object> healingParams) throws Exception { @@ -51,6 +54,7 @@ public class ValidationStructureHealer implements Healer { JsonUtil.json2Object(orchestrationTemplate.getValidationData(), OldValidationStructureTree .class); } catch (Exception e){ + logger.debug("",e); return Optional.empty(); } diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java index 6a82d8fa49..4accd790ab 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VlmVersionHealer.java @@ -11,14 +11,12 @@ import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacade; import org.openecomp.sdc.vendorlicense.facade.VendorLicenseFacadeFactory; import org.openecomp.sdc.vendorlicense.types.VersionedVendorLicenseModel; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; import org.openecomp.sdc.versioning.dao.types.Version; import java.util.ArrayList; -import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Objects; @@ -55,6 +53,7 @@ public class VlmVersionHealer implements Healer { vendorLicenseModel = vendorLicenseFacade.getVendorLicenseModel(vspDetails.getVendorId(), null, user); } catch (Exception e){ + logger.debug("" + e); logger.debug("No Vlm was found for Vsp " + vspDetails.getName()); return Optional.empty(); } diff --git a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspQuestionnaireHealer.java b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspQuestionnaireHealer.java index 78f2997660..0952a4c88f 100644 --- a/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspQuestionnaireHealer.java +++ b/openecomp-be/lib/openecomp-healing-lib/openecomp-sdc-healing-impl/src/main/java/org/openecomp/sdc/healing/healers/VspQuestionnaireHealer.java @@ -23,9 +23,9 @@ package org.openecomp.sdc.healing.healers; import org.openecomp.core.utilities.json.JsonSchemaDataGenerator; import org.openecomp.sdc.common.utils.SdcCommon; import org.openecomp.sdc.healing.interfaces.Healer; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; @@ -44,6 +44,8 @@ public class VspQuestionnaireHealer implements Healer { VendorSoftwareProductInfoDaoFactory.getInstance().createInterface(); private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + public VspQuestionnaireHealer() { } @@ -80,6 +82,7 @@ public class VspQuestionnaireHealer implements Healer { questionnaireData = new JsonSchemaDataGenerator(generatedSchema).generateData(); vspInfoDao.updateQuestionnaireData(vspId, version, questionnaireData); }catch(Exception e){ + log.debug("", e); return Optional.empty(); } mdcDataDebugMessage.debugExitMessage(null, null); diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java index 249dcaf4a5..f0bb253a4b 100644 --- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/HeatBoolean.java @@ -24,6 +24,8 @@ import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.heat.services.ErrorCodes; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import java.util.HashSet; import java.util.Set; @@ -33,6 +35,8 @@ public class HeatBoolean { private static Set<Object> heatFalse; private static Set<Object> heatTrue; + private final static Logger log = (Logger) LoggerFactory.getLogger(HeatBoolean.class.getName()); + static { @@ -90,6 +94,7 @@ public class HeatBoolean { Boolean answer = eval(value); return true; } catch (CoreException ce) { + log.debug("",ce); return false; } } diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java index dd487603e1..81bf2fa5a9 100644 --- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/datatypes/manifest/FileData.java @@ -31,7 +31,7 @@ import java.util.function.Predicate; public class FileData { - public static Set<Type> heatFileTypes = + protected static final Set<Type> heatFileTypes = new HashSet<>(Arrays.asList(Type.HEAT, Type.HEAT_NET, Type.HEAT_VOL)); private Boolean isBase; private String file; diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java index def773d712..372c09cffe 100644 --- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManager.java @@ -23,7 +23,6 @@ package org.openecomp.sdc.heat.services.tree; import org.openecomp.core.utilities.file.FileContentHandler; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.core.utilities.json.JsonUtil; -import org.openecomp.sdc.tosca.services.YamlUtil; import org.openecomp.core.validation.types.GlobalValidationContext; import org.openecomp.sdc.common.utils.SdcCommon; import org.openecomp.sdc.datatypes.error.ErrorMessage; @@ -34,6 +33,7 @@ import org.openecomp.sdc.heat.datatypes.structure.Artifact; import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; +import org.openecomp.sdc.tosca.services.YamlUtil; import java.io.InputStream; import java.util.HashMap; @@ -101,10 +101,14 @@ public class HeatTreeManager { .values().stream().filter(heatStructureTree -> tree.getHeat().contains(heatStructureTree)) .forEach(heatStructureTree -> tree.getHeat().remove(heatStructureTree)); - heatContentMap.getFileList().stream().filter(fileName -> !manifestFiles.contains(fileName)) + heatContentMap.getFileList().stream().filter(fileName -> isNotInManifestFiles(fileName)) .forEach(fileName -> addTreeOther(fileName)); } + private boolean isNotInManifestFiles(String fileName) { + return !manifestFiles.contains(fileName); + } + private void addTreeOther(String fileName) { if (tree.getOther() == null) { tree.setOther(new HashSet<>()); @@ -132,7 +136,9 @@ public class HeatTreeManager { Set<String> artifactSet = HeatTreeManagerUtil.getArtifactFiles(filename, hot, globalContext); addHeatArtifactFiles(fileHeatStructureTree, artifactSet); - } catch (Exception ignore) { /* invalid yaml no need to process reference */ } + } catch (Exception ignore) { /* invalid yaml no need to process reference */ + logger.debug("",ignore); + } } diff --git a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java index b8df50b87c..3802018c99 100644 --- a/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java +++ b/openecomp-be/lib/openecomp-heat-lib/src/main/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerUtil.java @@ -166,7 +166,7 @@ public class HeatTreeManagerUtil { Map<String, Object> resourceDefValueMap = resource.getProperties() == null ? null : (Map<String, Object>) resource.getProperties().get( PropertiesMapKeyTypes.RESOURCE_DEF.getKeyMap()); - if (MapUtils.isNotEmpty(resourceDefValueMap)) { + if (MapUtils.isNotEmpty(resourceDefValueMap) && resourceDefValueMap != null) { Object resourceDefType = resourceDefValueMap.get("type"); if (Objects.nonNull(resourceDefType)) { if (resourceDefType instanceof String) { diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java index c99eda7309..fc01e2e8b0 100644 --- a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java +++ b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/EnvironmentTest.java @@ -48,7 +48,7 @@ public class EnvironmentTest { } else { String heatResourceNameSuffix = heatResourceName.substring(lastIndexOfUnderscore + 1); try { - Integer.parseInt(heatResourceNameSuffix); + int heatResourceNameSuffixInt = Integer.parseInt(heatResourceNameSuffix); System.out.println(heatResourceName.substring(0, lastIndexOfUnderscore)); } catch (NumberFormatException ignored) { System.out.println(heatResourceName); diff --git a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java index ec5c7526e3..3715b0f999 100644 --- a/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java +++ b/openecomp-be/lib/openecomp-heat-lib/src/test/java/org/openecomp/sdc/heat/datatypes/model/HeatOrchestrationTemplateTest.java @@ -22,6 +22,8 @@ package org.openecomp.sdc.heat.datatypes.model; import org.junit.Assert; import org.junit.Test; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.services.YamlUtil; import java.io.InputStream; @@ -32,6 +34,8 @@ import java.util.Map; public class HeatOrchestrationTemplateTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @Test public void testYamlToServiceTemplateObj() { YamlUtil yamlUtil = new YamlUtil(); @@ -99,6 +103,7 @@ public class HeatOrchestrationTemplateTest { yamlUtil.yamlToObject(yml, HeatOrchestrationTemplate.class); Assert.assertNotNull(heatOrchestrationTemplate); } catch (Exception ignored) { + log.debug("",ignored); } } diff --git a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/annotations/Debug.java b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/annotations/Debug.java index b00b85a814..049481141a 100644 --- a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/annotations/Debug.java +++ b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-api/src/main/java/org/openecomp/sdc/logging/api/annotations/Debug.java @@ -20,11 +20,6 @@ package org.openecomp.sdc.logging.api.annotations; -import java.lang.annotation.ElementType; -import java.lang.annotation.Retention; -import java.lang.annotation.RetentionPolicy; -import java.lang.annotation.Target; - /** * Created by TALIO on 12/26/2016. */ diff --git a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/impl/MdcDataDebugMessage.java b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/impl/MdcDataDebugMessage.java index 01bc6f446e..b21504d752 100644 --- a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/impl/MdcDataDebugMessage.java +++ b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/context/impl/MdcDataDebugMessage.java @@ -33,7 +33,7 @@ import java.util.Map; public class MdcDataDebugMessage extends MdcData { - private static Logger logger; + private Logger logger; private static Map<String, String> mapExitOrEntryToMessage; static { diff --git a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java index f617ea6500..31b89464c9 100644 --- a/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java +++ b/openecomp-be/lib/openecomp-logging-lib/openecomp-sdc-logging-core/src/main/java/org/openecomp/sdc/logging/servlet/LoggingFilter.java @@ -21,6 +21,8 @@ package org.openecomp.sdc.logging.servlet; import org.omg.CORBA.Request; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.slf4j.MDC; import javax.servlet.*; @@ -61,6 +63,8 @@ public class LoggingFilter implements Filter { private static final HostAddressCache HOST_ADDRESS = new HostAddressCache(); private static final String UNKNOWN = "UNKNOWN"; + private final static Logger log = (Logger) LoggerFactory.getLogger(LoggingFilter.class.getName()); + public void destroy() { } @@ -128,6 +132,7 @@ public class LoggingFilter implements Filter { lastUpdated.set(current); // set now to register the attempt even if failed hostAddress = InetAddress.getLocalHost(); } catch (UnknownHostException e) { + log.debug("",e); hostAddress = null; } } diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java index fd6c76c92c..25cd06d3ce 100644 --- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/ActionConstants.java @@ -24,7 +24,7 @@ package org.openecomp.sdc.action; public class ActionConstants { // - public static final long MAX_ACTION_ARTIFACT_SIZE = 20 * 1024 * 1024; //20 MB + public static final long MAX_ACTION_ARTIFACT_SIZE = 20 * 1024 * 1024L; //20 MB //REST layer constants public static final String X_OPEN_ECOMP_INSTANCE_ID_HEADER_PARAM = "X-OPEN-ECOMP-InstanceID"; public static final String X_OPEN_ECOMP_REQUEST_ID_HEADER_PARAM = "X-OPEN-ECOMP-RequestID"; diff --git a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java index b7672644d2..cde97bc151 100644 --- a/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java +++ b/openecomp-be/lib/openecomp-sdc-action-lib/openecomp-sdc-action-api/src/main/java/org/openecomp/sdc/action/types/Action.java @@ -244,4 +244,31 @@ public class Action implements Comparable { return Integer.compare(objVersion.getMajor(), thisVersion.getMajor()); } + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Action action = (Action) o; + + if (!version.equals(action.version)) { + return false; + } + if (!name.equals(action.name)) { + return false; + } + + return true; + } + + @Override + public int hashCode() { + int result = version.hashCode(); + result = 31 * result + name.hashCode(); + return result; + } } diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java index 293e4dec2a..1b9e119fbf 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-core/src/test/java/org/openecomp/sdc/enrichment/impl/EnrichmentManagerImplTest.java @@ -22,15 +22,15 @@ package org.openecomp.sdc.enrichment.impl; import static org.junit.Assert.assertEquals; -import org.openecomp.core.enrichment.api.EnrichmentManager; import org.openecomp.core.enrichment.factory.EnrichmentManagerFactory; import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; +import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil; import org.openecomp.sdc.tosca.services.ToscaFileOutputService; import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; -import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil; -import org.openecomp.sdc.versioning.dao.types.Version; import org.testng.Assert; import org.testng.annotations.Test; @@ -53,6 +53,9 @@ import java.util.zip.ZipInputStream; public class EnrichmentManagerImplTest { + private final static Logger log = (Logger) LoggerFactory.getLogger + (EnrichmentManagerImplTest.class.getName()); + private static ToscaServiceModel loadToscaServiceModel(String serviceTemplatesPath, String globalServiceTemplatesPath, @@ -103,6 +106,7 @@ public class EnrichmentManagerImplTest { try { yamlFile.close(); } catch (IOException ignore) { + log.debug("",ignore); } } catch (FileNotFoundException e) { throw e; diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java index ffc27106bb..57c1d19f03 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/ExternalArtifactEnricher.java @@ -67,7 +67,7 @@ public class ExternalArtifactEnricher extends Enricher { externalArtifactEnricherInstance.enrich(this.data); } } catch (Exception e) { - e.printStackTrace(); + logger.debug("",e); logger.error(e.getMessage()); } diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricher.java index 44c1ef8c72..ff0e9b4838 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricher.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/external/artifact/MonitoringMibEnricher.java @@ -34,6 +34,8 @@ import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.datatypes.error.ErrorMessage; import org.openecomp.sdc.enrichment.EnrichmentInfo; import org.openecomp.sdc.enrichment.inter.ExternalArtifactEnricherInterface; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; import org.openecomp.sdc.tosca.services.DataModelUtil; @@ -61,6 +63,7 @@ public class MonitoringMibEnricher implements ExternalArtifactEnricherInterface private ComponentArtifactDao componentArtifactDao; private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); /** * Enrich map. * @@ -225,6 +228,7 @@ public class MonitoringMibEnricher implements ExternalArtifactEnricherInterface mibs = FileUtils .getFileContentMapFromZip(FileUtils.toByteArray(monitoringArtifactInfo.getContent())); } catch (IOException ioException) { + log.debug("",ioException); ErrorMessage.ErrorMessageUtil .addMessage(mibServiceArtifact.getName() + "." + type.name(), errors) .add(new ErrorMessage(ErrorLevel.ERROR, Messages.INVALID_ZIP_FILE.getErrorMessage())); diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java index 854d84ad84..f1804c8f62 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/main/java/org/openecomp/sdc/enrichment/impl/tosca/ToscaEnricher.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.enrichment.impl.tosca; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.datatypes.error.ErrorMessage; import org.openecomp.sdc.enrichment.inter.Enricher; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; diff --git a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/BaseToscaEnrichmentTest.java b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/BaseToscaEnrichmentTest.java index 4196168b2c..0001cdf404 100644 --- a/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/BaseToscaEnrichmentTest.java +++ b/openecomp-be/lib/openecomp-sdc-enrichment-lib/openecomp-sdc-enrichment-impl/src/test/java/org/openecomp/sdc/enrichment/impl/tosca/BaseToscaEnrichmentTest.java @@ -21,6 +21,8 @@ package org.openecomp.sdc.enrichment.impl.tosca; import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; import org.openecomp.sdc.tosca.services.ToscaFileOutputService; @@ -45,6 +47,9 @@ public class BaseToscaEnrichmentTest { protected String outputFilesPath; + private final static Logger log = (Logger) LoggerFactory.getLogger + (BaseToscaEnrichmentTest.class.getName()); + public static ToscaServiceModel loadToscaServiceModel(String serviceTemplatesPath, String globalServiceTemplatesPath, String entryDefinitionServiceTemplate) @@ -93,6 +98,7 @@ public class BaseToscaEnrichmentTest { try { yamlFile.close(); } catch (IOException ignore) { + log.debug("",ignore); } } catch (FileNotFoundException exception) { throw exception; diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java index 1c13fbe760..2ef31d4597 100644 --- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-api/src/main/java/org/openecomp/core/model/dao/ServiceModelDao.java @@ -20,12 +20,9 @@ package org.openecomp.core.model.dao; -import org.openecomp.core.model.types.ServiceArtifact; import org.openecomp.sdc.versioning.dao.VersionableDao; import org.openecomp.sdc.versioning.dao.types.Version; -import java.util.List; - public interface ServiceModelDao<M, E> extends VersionableDao { M getServiceModel(String vspId, Version version); diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java index e774eb6b1d..965bc89ca8 100644 --- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-core/src/main/java/org/openecomp/sdc/model/impl/AbstractServiceModelDao.java @@ -27,13 +27,14 @@ import org.openecomp.core.model.types.ServiceElement; import org.openecomp.core.model.types.ServiceTemplate; import org.openecomp.core.utilities.file.FileContentHandler; import org.openecomp.core.utilities.file.FileUtils; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.datatypes.model.Import; import org.openecomp.sdc.tosca.datatypes.model.Old1610ServiceTemplate; import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil; import org.openecomp.sdc.versioning.dao.VersionableDao; import org.openecomp.sdc.versioning.dao.types.Version; -import sun.misc.IOUtils; import java.io.InputStream; import java.util.ArrayList; @@ -48,6 +49,8 @@ public class AbstractServiceModelDao implements VersionableDao { protected ServiceTemplateDaoInter templateDao; protected ServiceArtifactDaoInter artifactDao; + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @Override public void registerVersioning(String versionableEntityType) { templateDao.registerVersioning(versionableEntityType); @@ -170,6 +173,7 @@ public class AbstractServiceModelDao implements VersionableDao { return new ToscaExtensionYamlUtil().yamlToObject(serviceTemplateContent, org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate.class); }catch (Exception e){ + log.debug("",e); System.out.println("Found vsp with old-versioned tosca service template"); Old1610ServiceTemplate old1610ServiceTemplate = new ToscaExtensionYamlUtil().yamlToObject(serviceTemplateContent, diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/EnrichedServiceModelDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/EnrichedServiceModelDaoZusammenImpl.java index b038c70372..d018c9a87c 100644 --- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/EnrichedServiceModelDaoZusammenImpl.java +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/EnrichedServiceModelDaoZusammenImpl.java @@ -14,7 +14,6 @@ import org.openecomp.core.zusammen.api.ZusammenUtil; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; -import org.openecomp.sdc.versioning.dao.types.Version; public class EnrichedServiceModelDaoZusammenImpl extends ServiceModelDaoZusammenImpl implements EnrichedServiceModelDao<ToscaServiceModel, ServiceElement> { diff --git a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java index a7fecdd806..88a1c756c9 100644 --- a/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java +++ b/openecomp-be/lib/openecomp-sdc-model-lib/openecomp-sdc-model-impl/src/main/java/org/openecomp/sdc/model/impl/zusammen/ServiceModelDaoZusammenImpl.java @@ -186,6 +186,7 @@ public class ServiceModelDaoZusammenImpl return new ToscaExtensionYamlUtil(). yamlToObject(yamlContent, ServiceTemplate.class); }catch (Exception e){ + logger.debug("",e); return null; } } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/ComputeFlavor.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/ComputeFlavor.java index d888bd311b..e34627d62b 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/ComputeFlavor.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/ComputeFlavor.java @@ -41,21 +41,23 @@ public class ComputeFlavor { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; ComputeFlavor other = (ComputeFlavor) obj; - if (num_cpus != other.num_cpus) - return false; - if (this.disk_size == null) { - if (other.disk_size != null) + if(other != null) { + if (num_cpus != other.num_cpus) return false; - } else if (!disk_size.equals(other.disk_size)) - return false; - if (this.mem_size == null) { - if (other.mem_size != null) + if (this.disk_size == null) { + if (other.disk_size != null) + return false; + } else if (!disk_size.equals(other.disk_size)) return false; - } else if (!mem_size.equals(other.mem_size)) - return false; + if (this.mem_size == null) { + if (other.mem_size != null) + return false; + } else if (!mem_size.equals(other.mem_size)) + return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/DeploymentFlavorModel.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/DeploymentFlavorModel.java index a0d5f40b8c..3bc338361e 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/DeploymentFlavorModel.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/DeploymentFlavorModel.java @@ -53,29 +53,31 @@ public class DeploymentFlavorModel { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; DeploymentFlavorModel other = (DeploymentFlavorModel) obj; - if (this.sp_part_number == null) { - if (other.sp_part_number != null) + if (other != null) { + if (this.sp_part_number == null) { + if (other.sp_part_number != null) + return false; + } else if (!sp_part_number.equals(other.sp_part_number)) return false; - } else if (!sp_part_number.equals(other.sp_part_number)) - return false; - if (this.vendor_info == null) { - if (other.vendor_info != null) + if (this.vendor_info == null) { + if (other.vendor_info != null) + return false; + } else if (!vendor_info.equals(other.vendor_info)) return false; - } else if (!vendor_info.equals(other.vendor_info)) - return false; - if (this.compute_flavor == null) { - if (other.compute_flavor != null) + if (this.compute_flavor == null) { + if (other.compute_flavor != null) + return false; + } else if (!compute_flavor.equals(other.compute_flavor)) return false; - } else if (!compute_flavor.equals(other.compute_flavor)) - return false; - if (this.license_flavor == null) { - if (other.license_flavor != null) + if (this.license_flavor == null) { + if (other.license_flavor != null) + return false; + } else if (!license_flavor.equals(other.license_flavor)) return false; - } else if (!license_flavor.equals(other.license_flavor)) - return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/LicenseFlavor.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/LicenseFlavor.java index f459d9e993..1cdeaca562 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/LicenseFlavor.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/LicenseFlavor.java @@ -24,14 +24,16 @@ public class LicenseFlavor { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; LicenseFlavor other = (LicenseFlavor) obj; - if (this.feature_group_uuid == null) { - if (other.feature_group_uuid != null) + if (other != null) { + if (this.feature_group_uuid == null) { + if (other.feature_group_uuid != null) + return false; + } else if (!feature_group_uuid.equals(other.feature_group_uuid)) return false; - } else if (!feature_group_uuid.equals(other.feature_group_uuid)) - return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/MultiFlavorVfcImage.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/MultiFlavorVfcImage.java index 6cd713e2d1..560a7765f2 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/MultiFlavorVfcImage.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/MultiFlavorVfcImage.java @@ -54,29 +54,31 @@ public class MultiFlavorVfcImage { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; MultiFlavorVfcImage other = (MultiFlavorVfcImage) obj; - if (this.file_name == null) { - if (other.file_name != null) + if (other != null) { + if (this.file_name == null) { + if (other.file_name != null) + return false; + } else if (!file_name.equals(other.file_name)) return false; - } else if (!file_name.equals(other.file_name)) - return false; - if (this.file_hash == null) { - if (other.file_hash != null) + if (this.file_hash == null) { + if (other.file_hash != null) + return false; + } else if (!file_hash.equals(other.file_hash)) return false; - } else if (!file_hash.equals(other.file_hash)) - return false; - if (this.file_hash_type == null) { - if (other.file_hash_type != null) + if (this.file_hash_type == null) { + if (other.file_hash_type != null) + return false; + } else if (!file_hash_type.equals(other.file_hash_type)) return false; - } else if (!file_hash_type.equals(other.file_hash_type)) - return false; - if (this.software_version == null) { - if (other.software_version != null) + if (this.software_version == null) { + if (other.software_version != null) + return false; + } else if (!software_version.equals(other.software_version)) return false; - } else if (!software_version.equals(other.software_version)) - return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VendorInfo.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VendorInfo.java index 22348f3083..0c2be2508c 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VendorInfo.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VendorInfo.java @@ -32,19 +32,21 @@ public class VendorInfo { public boolean equals(Object obj) { if (this == obj) return true; - if (getClass() != obj.getClass()) + if (obj != null && getClass() != obj.getClass()) return false; VendorInfo other = (VendorInfo) obj; - if (this.manufacturer_reference_number == null) { - if (other.manufacturer_reference_number != null) + if (other != null) { + if (this.manufacturer_reference_number == null) { + if (other.manufacturer_reference_number != null) + return false; + } else if (!manufacturer_reference_number.equals(other.manufacturer_reference_number)) return false; - } else if (!manufacturer_reference_number.equals(other.manufacturer_reference_number)) - return false; - if (this.vendor_model == null) { - if (other.vendor_model != null) + if (this.vendor_model == null) { + if (other.vendor_model != null) + return false; + } else if (!vendor_model.equals(other.vendor_model)) return false; - } else if (!vendor_model.equals(other.vendor_model)) - return false; + } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VspModelInfo.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VspModelInfo.java index 025db1cafc..4372e7f98a 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VspModelInfo.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-api/src/main/java/org/openecomp/sdc/generator/datatypes/tosca/VspModelInfo.java @@ -82,51 +82,53 @@ public class VspModelInfo { if (this == obj) { return true; } - if (getClass() != obj.getClass()) { + if (obj != null && getClass() != obj.getClass()) { return false; } VspModelInfo other = (VspModelInfo) obj; - if (this.releaseVendor == null) { - if (other.releaseVendor != null) { + if(other != null) { + if (this.releaseVendor == null) { + if (other.releaseVendor != null) { + return false; + } + } else if (!releaseVendor.equals(other.releaseVendor)) { return false; } - } else if (!releaseVendor.equals(other.releaseVendor)) { - return false; - } - if (this.components == null) { - if (other.components != null) { + if (this.components == null) { + if (other.components != null) { + return false; + } + } else if (!components.equals(other.components)) { return false; } - } else if (!components.equals(other.components)) { - return false; - } - if (this.allowedFlavors == null) { - if (other.allowedFlavors != null) { + if (this.allowedFlavors == null) { + if (other.allowedFlavors != null) { + return false; + } + } else if (!allowedFlavors.equals(other.allowedFlavors)) { return false; } - } else if (!allowedFlavors.equals(other.allowedFlavors)) { - return false; - } - if (this.multiFlavorVfcImages == null) { - if (other.multiFlavorVfcImages != null) { + if (this.multiFlavorVfcImages == null) { + if (other.multiFlavorVfcImages != null) { + return false; + } + } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) { return false; } - } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) { - return false; - } - if (this.multiFlavorVfcImages == null) { - if (other.multiFlavorVfcImages != null) { + if (this.multiFlavorVfcImages == null) { + if (other.multiFlavorVfcImages != null) { + return false; + } + } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) { return false; } - } else if (!multiFlavorVfcImages.equals(other.multiFlavorVfcImages)) { - return false; - } - if (this.nics == null) { - if (other.nics != null) { + if (this.nics == null) { + if (other.nics != null) { + return false; + } + } else if (!nics.equals(other.nics)) { return false; } - } else if (!nics.equals(other.nics)) { - return false; } return true; } diff --git a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java index 59b06ba7a8..7e493f2151 100644 --- a/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java +++ b/openecomp-be/lib/openecomp-sdc-tosca-generator-lib/openecomp-sdc-tosca-generator-core/src/main/java/org/openecomp/sdc/generator/core/utils/GeneratorUtils.java @@ -18,12 +18,9 @@ import org.openecomp.sdc.tosca.datatypes.model.RequirementDefinition; import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; import org.openecomp.sdc.tosca.services.DataModelUtil; import org.openecomp.sdc.tosca.services.ToscaAnalyzerService; +import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil; import org.openecomp.sdc.tosca.services.ToscaUtil; import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl; -import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil; -import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; import java.util.ArrayList; import java.util.Arrays; @@ -37,8 +34,8 @@ import java.util.Map; */ public class GeneratorUtils { - public static List<String> supportedCapabilities = new ArrayList<>(); - public static List<String> supportedRequirements = new ArrayList<>(); + private static List<String> supportedCapabilities = new ArrayList<>(); + private static List<String> supportedRequirements = new ArrayList<>(); protected static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); static { diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/main/java/com/att/sdc/tosca/datatypes/AttToscaPolicyType.java b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/main/java/com/att/sdc/tosca/datatypes/AttToscaPolicyType.java index 8881ec5e40..fd893730c4 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/main/java/com/att/sdc/tosca/datatypes/AttToscaPolicyType.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/main/java/com/att/sdc/tosca/datatypes/AttToscaPolicyType.java @@ -10,12 +10,14 @@ import org.openecomp.sdc.tosca.services.ConfigConstants; public class AttToscaPolicyType { private static Configuration config = ConfigurationManager.lookup(); - public static String POLICY_TYPE_PREFIX = + public static final String POLICY_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_POLICY_TYPE); - public static String PLACEMENT_VALET_AFFINITY = POLICY_TYPE_PREFIX + "placement.valet.Affinity"; - public static String PLACEMENT_VALET_EXCLUSIVITY = + public static final String PLACEMENT_VALET_AFFINITY = POLICY_TYPE_PREFIX + "placement.valet" + + ".Affinity"; + public static final String PLACEMENT_VALET_EXCLUSIVITY = POLICY_TYPE_PREFIX + "placement.valet.Exclusivity"; - public static String PLACEMENT_VALET_DIVERSITY = POLICY_TYPE_PREFIX + "placement.valet.Diversity"; + public static final String PLACEMENT_VALET_DIVERSITY = POLICY_TYPE_PREFIX + "placement.valet" + + ".Diversity"; } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/main/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/main/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImpl.java index e303276538..176c7c5e65 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/main/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/main/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationValetGroupAssignmentImpl.java @@ -289,7 +289,7 @@ public class ResourceTranslationValetGroupAssignmentImpl extends ResourceTransla groupName = (String) groupNameProperty; } - if (!Strings.isNullOrEmpty(groupName)) { + if (groupName != null && !Strings.isNullOrEmpty(groupName)) { groupName = groupName.replace(" ", "_"); resourceId += "_" + groupName; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java index e8fddc3108..05bc7cb5f1 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/att-sdc-translator-impl/src/test/java/com/att/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseResourceTranslationTest.java @@ -36,6 +36,8 @@ import org.openecomp.sdc.datatypes.error.ErrorMessage; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; import org.openecomp.sdc.heat.datatypes.manifest.ManifestFile; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -86,6 +88,8 @@ public class BaseResourceTranslationTest { private final String MANIFEST_NAME = SdcCommon.MANIFEST_NAME; private String validationFilename = "validationOutput.json"; + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @Before public void setUp() throws IOException { initTranslatorAndTranslate(); @@ -286,6 +290,7 @@ public class BaseResourceTranslationTest { } } catch (Exception e) { + log.debug("",e); Assert.fail(e.getMessage()); } return serviceTemplateMap; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/TranslationContext.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/TranslationContext.java index f5ad2a1d3c..a0034a3828 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/TranslationContext.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/TranslationContext.java @@ -587,6 +587,15 @@ public class TranslationContext { } + public Set<String> getServiceTemplatesWithoutNodeTemplateSection() { + return serviceTemplatesWithoutNodeTemplateSection; + } + + public void setServiceTemplatesWithoutNodeTemplateSection( + Set<String> serviceTemplatesWithoutNodeTemplateSection) { + this.serviceTemplatesWithoutNodeTemplateSection = serviceTemplatesWithoutNodeTemplateSection; + } + public void addServiceTemplateWithoutNodeTemplates(String serviceTemplateName){ this.serviceTemplatesWithoutNodeTemplateSection.add(serviceTemplateName); } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/composition/NodeTemplateInformation.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/composition/NodeTemplateInformation.java index bd1263da5f..cbcf02e9a6 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/composition/NodeTemplateInformation.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/composition/NodeTemplateInformation.java @@ -1,7 +1,6 @@ package org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.composition; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; -import org.openecomp.sdc.translator.services.heattotosca.UnifiedCompositionService; /** * Created by Talio on 4/4/2017. diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/NestedTemplateConsolidationData.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/NestedTemplateConsolidationData.java index b07c2039b8..0f41b00309 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/NestedTemplateConsolidationData.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/datatypes/heattotosca/unifiedmodel/consolidation/NestedTemplateConsolidationData.java @@ -1,8 +1,5 @@ package org.openecomp.sdc.translator.datatypes.heattotosca.unifiedmodel.consolidation; -import java.util.List; - - /** * The type nested template consolidation data. */ diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java index e09be6cdd9..54a0285026 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/impl/heattotosca/HeatToToscaTranslatorImpl.java @@ -21,8 +21,6 @@ package org.openecomp.sdc.translator.impl.heattotosca; import org.apache.commons.collections4.MapUtils; -import org.openecomp.config.api.Configuration; -import org.openecomp.config.api.ConfigurationManager; import org.openecomp.core.translator.api.HeatToToscaTranslator; import org.openecomp.core.translator.datatypes.TranslatorOutput; import org.openecomp.core.utilities.file.FileUtils; @@ -32,7 +30,6 @@ import org.openecomp.core.validation.factory.ValidationManagerFactory; import org.openecomp.core.validation.util.MessageContainerUtil; import org.openecomp.sdc.common.errors.Messages; import org.openecomp.sdc.common.utils.SdcCommon; -import org.openecomp.sdc.datatypes.configuration.ImplementationConfiguration; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.datatypes.error.ErrorMessage; import org.openecomp.sdc.heat.datatypes.manifest.FileData; @@ -40,7 +37,6 @@ import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; import org.openecomp.sdc.heat.datatypes.manifest.ManifestFile; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; -import org.openecomp.sdc.translator.services.heattotosca.ConfigConstants; import org.openecomp.sdc.translator.services.heattotosca.ConsolidationService; import org.openecomp.sdc.translator.services.heattotosca.TranslationService; import org.openecomp.sdc.translator.services.heattotosca.UnifiedCompositionManager; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtil.java index 74deb0487a..b86038d175 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtil.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationDataUtil.java @@ -340,14 +340,15 @@ public class ConsolidationDataUtil { if(Objects.isNull(entityConsolidationData)){ return; } + if (entityConsolidationData != null) { + if (entityConsolidationData.getNodesConnectedOut() == null) { + entityConsolidationData.setNodesConnectedOut(new HashMap<>()); + } - if (entityConsolidationData.getNodesConnectedOut() == null) { - entityConsolidationData.setNodesConnectedOut(new HashMap<>()); + entityConsolidationData.getNodesConnectedOut() + .computeIfAbsent(nodeTemplateId, k -> new ArrayList<>()) + .add(requirementAssignmentData); } - - entityConsolidationData.getNodesConnectedOut() - .computeIfAbsent(nodeTemplateId, k -> new ArrayList<>()) - .add(requirementAssignmentData); } /** @@ -398,14 +399,16 @@ public class ConsolidationDataUtil { serviceTemplate, translateTo.getHeatFileName(), dependentNodeTemplateId); } - if (entityConsolidationData.getNodesConnectedIn() == null) { - entityConsolidationData.setNodesConnectedIn(new HashMap<>()); - } + if (entityConsolidationData != null) { + if (entityConsolidationData.getNodesConnectedIn() == null) { + entityConsolidationData.setNodesConnectedIn(new HashMap<>()); + } - entityConsolidationData.getNodesConnectedIn() - .computeIfAbsent(sourceNodeTemplateId, k -> new ArrayList<>()) - .add(requirementAssignmentData); + entityConsolidationData.getNodesConnectedIn() + .computeIfAbsent(sourceNodeTemplateId, k -> new ArrayList<>()) + .add(requirementAssignmentData); + } } /** diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/NameExtractor.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/NameExtractor.java index fc4c3f8841..e732080cb5 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/NameExtractor.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/NameExtractor.java @@ -21,11 +21,6 @@ package org.openecomp.sdc.translator.services.heattotosca; import org.openecomp.sdc.heat.datatypes.model.Resource; -import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; - -import java.util.List; -import java.util.Map; -import java.util.Optional; public interface NameExtractor { diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/NameExtractorUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/NameExtractorUtil.java index 8241603fed..b4d41f5b6c 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/NameExtractorUtil.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/NameExtractorUtil.java @@ -20,13 +20,10 @@ package org.openecomp.sdc.translator.services.heattotosca; -import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedPropertyVal; -import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; import org.openecomp.sdc.translator.datatypes.heattotosca.PropertyRegexMatcher; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Optional; import java.util.regex.Pattern; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java index a86f584bf0..d194a70e97 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ContrailTranslationHelper.java @@ -21,16 +21,14 @@ package org.openecomp.sdc.translator.services.heattotosca.helper; import org.openecomp.core.utilities.file.FileUtils; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.heat.datatypes.HeatBoolean; import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; -import org.openecomp.sdc.tosca.services.ToscaConstants; import org.openecomp.sdc.tosca.datatypes.ToscaFunctions; import org.openecomp.sdc.translator.datatypes.heattotosca.PropertyRegexMatcher; +import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; import org.openecomp.sdc.translator.services.heattotosca.ConfigConstants; import org.openecomp.sdc.translator.services.heattotosca.NameExtractor; -import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; import java.util.ArrayList; import java.util.Collections; @@ -127,17 +125,17 @@ public class ContrailTranslationHelper { tokenPropertyValue.get("token").add(stringWithToken); } else if (refParameter instanceof String) { if (includeBooleanValue) { - StringBuffer booleanBuffer = new StringBuffer(); + StringBuilder booleanBuilder = new StringBuilder(); String[] booleanValueList = ((String) refParameter).split(tokenChar); for (int i = 0; i < booleanValueList.length; i++) { if (i == 0) { - booleanBuffer.append(HeatBoolean.eval(booleanValueList[i])); + booleanBuilder.append(HeatBoolean.eval(booleanValueList[i])); } else { - booleanBuffer.append(tokenChar); - booleanBuffer.append(HeatBoolean.eval(booleanValueList[i])); + booleanBuilder.append(tokenChar); + booleanBuilder.append(HeatBoolean.eval(booleanValueList[i])); } } - tokenPropertyValue.get("token").add(booleanBuffer.toString()); + tokenPropertyValue.get("token").add(booleanBuilder.toString()); } else { tokenPropertyValue.get("token").add(refParameter); } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ResourceTranslationNeutronPortHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ResourceTranslationNeutronPortHelper.java index a99c95c148..23f8e3695d 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ResourceTranslationNeutronPortHelper.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/ResourceTranslationNeutronPortHelper.java @@ -2,7 +2,6 @@ package org.openecomp.sdc.translator.services.heattotosca.helper; import java.util.ArrayList; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java index f1cb33372e..ef75f315f6 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/helper/VolumeTranslationHelper.java @@ -23,19 +23,18 @@ package org.openecomp.sdc.translator.services.heattotosca.helper; import static org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes.CINDER_VOLUME_RESOURCE_TYPE; import org.apache.commons.collections4.CollectionUtils; -import org.openecomp.sdc.common.utils.CommonUtil; -import org.openecomp.sdc.logging.api.Logger; -import org.openecomp.sdc.tosca.services.YamlUtil; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; import org.openecomp.sdc.heat.datatypes.model.Output; import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; +import org.openecomp.sdc.tosca.services.YamlUtil; import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; +import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; import org.openecomp.sdc.translator.datatypes.heattotosca.to.ResourceFileDataAndIDs; import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; -import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.ResourceTranslationBase; import java.util.ArrayList; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetAttrImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetAttrImpl.java index 6f7d7a921e..b2909d15b3 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetAttrImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/functiontranslation/FunctionTranslationGetAttrImpl.java @@ -20,6 +20,7 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.functiontranslation; +import org.apache.commons.lang3.StringUtils; import org.openecomp.sdc.tosca.services.YamlUtil; import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; import org.openecomp.sdc.heat.datatypes.model.Resource; @@ -323,7 +324,7 @@ public class FunctionTranslationGetAttrImpl implements FunctionTranslation { if (attributeParamList.size() < 3) { return null; } - StringBuffer attributeFullPath = new StringBuffer(); + StringBuilder attributeFullPath = new StringBuilder(); attributeFullPath.append(attributeParamList.get(1)); for (int j = 2; j <= attributeIndex; j++) { if (isInteger(attributeParamList.get(j))) { @@ -340,11 +341,16 @@ public class FunctionTranslationGetAttrImpl implements FunctionTranslation { return false; } - try { + /*try { Integer.parseInt(String.valueOf(inputNumber)); return true; } catch (NumberFormatException exception) { return false; + }*/ + if(StringUtils.isNumeric(String.valueOf(inputNumber))){ + return true; + } else { + return false; } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailPortToNetResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailPortToNetResourceConnection.java index efa0ddd8a9..272211f7cf 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailPortToNetResourceConnection.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailPortToNetResourceConnection.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VlanToInterfaceResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VlanToInterfaceResourceConnection.java index a757730cb1..65b1d469ab 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VlanToInterfaceResourceConnection.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VlanToInterfaceResourceConnection.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VmInterfaceToNetResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VmInterfaceToNetResourceConnection.java index 944afb0fc3..5afbf5be54 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VmInterfaceToNetResourceConnection.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ContrailV2VmInterfaceToNetResourceConnection.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/PortToNetResourceConnection.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/PortToNetResourceConnection.java index d3e8676ca1..25a604469e 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/PortToNetResourceConnection.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/PortToNetResourceConnection.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceConnectionUsingRequirementHelper.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceConnectionUsingRequirementHelper.java index 6ddd0c7334..d1962d8196 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceConnectionUsingRequirementHelper.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceConnectionUsingRequirementHelper.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; import org.openecomp.sdc.tosca.datatypes.model.NodeType; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeImpl.java index 04e71cc2c7..78d09577d9 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationCinderVolumeImpl.java @@ -20,14 +20,12 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.heat.datatypes.HeatBoolean; import org.openecomp.sdc.heat.services.HeatConstants; import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; import org.openecomp.sdc.tosca.services.DataModelUtil; import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; -import org.openecomp.sdc.translator.services.heattotosca.Constants; import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailNetworkPolicyImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailNetworkPolicyImpl.java index 374858be0c..999441deb7 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailNetworkPolicyImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailNetworkPolicyImpl.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java index 3b9eb08f53..0b7e9eacfe 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailServiceInstanceImpl.java @@ -638,7 +638,7 @@ public class ResourceTranslationContrailServiceInstanceImpl extends ResourceTran NodeTemplate computeNodeTemplate = new NodeTemplate(); computeNodeTemplate.setType(computeNodeTypeId); - if (!computeNodeTemplateProperties.isEmpty()) { + if (computeNodeTemplateProperties != null && !computeNodeTemplateProperties.isEmpty()) { computeNodeTemplate.setProperties(computeNodeTemplateProperties); } String computeNodeTemplateId = translateTo.getTranslatedId(); diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VirtualNetworkImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VirtualNetworkImpl.java index d39d0f1c45..10ccf0f560 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VirtualNetworkImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VirtualNetworkImpl.java @@ -21,11 +21,10 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; import org.apache.commons.collections.CollectionUtils; -import org.openecomp.sdc.common.utils.CommonUtil; -import org.openecomp.sdc.logging.api.Logger; -import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; import org.openecomp.sdc.heat.datatypes.model.Resource; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaCapabilityType; import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; import org.openecomp.sdc.tosca.datatypes.ToscaRelationshipType; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImpl.java index e0e6c459a1..76396f77bc 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailV2VlanSubInterfaceImpl.java @@ -20,12 +20,11 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; -import org.openecomp.sdc.logging.api.Logger; -import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.heat.services.HeatConstants; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; import org.openecomp.sdc.tosca.services.DataModelUtil; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailVirtualNetworkImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailVirtualNetworkImpl.java index a6fc9ac2c1..f0c3c8b3f1 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailVirtualNetworkImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationContrailVirtualNetworkImpl.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; import org.openecomp.sdc.tosca.services.DataModelUtil; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNestedImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNestedImpl.java index 843d9fabc6..c29409fe48 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNestedImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNestedImpl.java @@ -20,6 +20,7 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; +import org.apache.commons.collections4.MapUtils; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.heat.datatypes.manifest.FileData; import org.openecomp.sdc.logging.api.Logger; @@ -31,12 +32,15 @@ import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; import org.openecomp.sdc.tosca.services.DataModelUtil; import org.openecomp.sdc.tosca.services.ToscaUtil; import org.openecomp.sdc.tosca.services.impl.ToscaAnalyzerServiceImpl; +import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; import org.openecomp.sdc.translator.services.heattotosca.ConsolidationDataUtil; import org.openecomp.sdc.translator.services.heattotosca.Constants; import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; import org.openecomp.sdc.translator.services.heattotosca.TranslationService; +import java.util.Objects; + public class ResourceTranslationNestedImpl extends ResourceTranslationBase { protected static Logger logger = @@ -46,8 +50,9 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { public void translate(TranslateTo translateTo) { mdcDataDebugMessage.debugEntryMessage(null, null); + TranslationContext context = translateTo.getContext(); FileData nestedFileData = - HeatToToscaUtil.getFileData(translateTo.getResource().getType(), translateTo.getContext()); + HeatToToscaUtil.getFileData(translateTo.getResource().getType(), context); if (nestedFileData == null) { logger.warn("Nested File '" + translateTo.getResource().getType() + "' is not exist, therefore, the nested resource with the ID '" @@ -58,7 +63,7 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { String substitutionNodeTypeKey = ToscaNodeType.ABSTRACT_NODE_TYPE_PREFIX + "heat." + templateName; - if (!translateTo.getContext().getTranslatedServiceTemplates() + if (!context.getTranslatedServiceTemplates() .containsKey(translateTo.getResource().getType())) { //substitution service template @@ -68,7 +73,7 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { //global substitution service template ServiceTemplate globalSubstitutionServiceTemplate = new HeatToToscaUtil() .fetchGlobalSubstitutionServiceTemplate(translateTo.getServiceTemplate(), - translateTo.getContext()); + context); //substitution node type NodeType substitutionNodeType = new ToscaAnalyzerServiceImpl() @@ -78,14 +83,22 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { substitutionNodeType); //substitution mapping HeatToToscaUtil - .handleSubstitutionMapping(translateTo.getContext(), substitutionNodeTypeKey, + .handleSubstitutionMapping(context, substitutionNodeTypeKey, nestedSubstitutionServiceTemplate, substitutionNodeType); //add new nested service template - translateTo.getContext().getTranslatedServiceTemplates() + context.getTranslatedServiceTemplates() .put(translateTo.getResource().getType(), nestedSubstitutionServiceTemplate); } + ServiceTemplate substitutionServiceTemplate = context.getTranslatedServiceTemplates() + .get(translateTo.getResource().getType()); + + if(DataModelUtil.isNodeTemplateSectionMissingFromServiceTemplate(substitutionServiceTemplate)){ + handleSubstitutionServiceTemplateWithoutNodeTemplates(translateTo, context, templateName); + mdcDataDebugMessage.debugExitMessage(null, null); + return; + } NodeTemplate substitutionNodeTemplate = HeatToToscaUtil.createAbstractSubstitutionNodeTemplate(translateTo, templateName, substitutionNodeTypeKey); @@ -100,6 +113,13 @@ public class ResourceTranslationNestedImpl extends ResourceTranslationBase { mdcDataDebugMessage.debugExitMessage(null, null); } + private void handleSubstitutionServiceTemplateWithoutNodeTemplates(TranslateTo translateTo, + TranslationContext context, + String templateName) { + context.addServiceTemplateWithoutNodeTemplates(templateName); + context.getTranslatedServiceTemplates().remove(translateTo.getResource().getType()); + } + private ServiceTemplate createSubstitutionServiceTemplate(TranslateTo translateTo, FileData nestedFileData, String templateName) { diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImpl.java index f1bd6790c2..76a900f32e 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronPortImpl.java @@ -33,14 +33,13 @@ import org.openecomp.sdc.translator.datatypes.heattotosca.AttachedResourceId; import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslateTo; import org.openecomp.sdc.translator.datatypes.heattotosca.to.TranslatedHeatResource; import org.openecomp.sdc.translator.services.heattotosca.ConsolidationDataUtil; -import org.openecomp.sdc.translator.services.heattotosca.Constants; import org.openecomp.sdc.translator.services.heattotosca.ConsolidationEntityType; +import org.openecomp.sdc.translator.services.heattotosca.Constants; import org.openecomp.sdc.translator.services.heattotosca.HeatToToscaUtil; import org.openecomp.sdc.translator.services.heattotosca.ResourceTranslationFactory; import org.openecomp.sdc.translator.services.heattotosca.helper.ResourceTranslationNeutronPortHelper; import org.openecomp.sdc.translator.services.heattotosca.mapping.TranslatorHeatToToscaPropertyConverter; -import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronSecurityGroupImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronSecurityGroupImpl.java index 96e79aca60..94c853f750 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronSecurityGroupImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronSecurityGroupImpl.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.tosca.datatypes.ToscaNodeType; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; import org.openecomp.sdc.tosca.services.DataModelUtil; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronSubnetImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronSubnetImpl.java index 76a8c447d1..5f8aead6e5 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronSubnetImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationNeutronSubnetImpl.java @@ -153,6 +153,7 @@ public class ResourceTranslationNeutronSubnetImpl extends ResourceTranslationBas Boolean booleanValue = HeatBoolean.eval(defaultVal); dhcpParameterDefinition.set_default(booleanValue); } catch (CoreException coreException) { + logger.debug("",coreException); //if value is not valid value for boolean set with dhcp_enabled default value = true dhcpParameterDefinition.set_default(true); logger.warn("Parameter '" + dhcpEnabledParameterName + "' used for " diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationResourceGroupImpl.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationResourceGroupImpl.java index 5d25c7ef25..7083ae0449 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationResourceGroupImpl.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/ResourceTranslationResourceGroupImpl.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation; import org.openecomp.sdc.common.errors.CoreException; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.datatypes.error.ErrorLevel; import org.openecomp.sdc.heat.datatypes.model.HeatResourcesTypes; import org.openecomp.sdc.heat.datatypes.model.Resource; @@ -45,6 +44,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Optional; public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBase { @@ -72,7 +72,7 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas logger.warn("Resource '" + translateTo.getResourceId() + "' of type'" + HeatResourcesTypes.RESOURCE_GROUP_RESOURCE_TYPE.getHeatResource() + "' with resourceDef which is not pointing to nested heat file is not supported and " - + "will be ignored in the translation "); + + "will be ignored in the translation "); mdcDataDebugMessage.debugExitMessage(null, null); return; @@ -88,17 +88,19 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas translateTo.getHeatOrchestrationTemplate(), nestedResource, translateTo.getResourceId(), translateTo.getContext()); if (substitutionNodeTemplateId.isPresent()) { - NodeTemplate substitutionNodeTemplate = DataModelUtil - .getNodeTemplate(translateTo.getServiceTemplate(), substitutionNodeTemplateId.get()); - Map serviceTemplateFilter = (Map<String, Object>) substitutionNodeTemplate.getProperties() - .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME); - - populateServiceTemplateFilterProperties(translateTo, substitutionNodeTemplate, - serviceTemplateFilter); - handlingIndexVar(translateTo, substitutionNodeTemplate); - DataModelUtil - .addNodeTemplate(translateTo.getServiceTemplate(), substitutionNodeTemplateId.get(), - substitutionNodeTemplate); + NodeTemplate substitutionNodeTemplate = + DataModelUtil.getNodeTemplate(translateTo.getServiceTemplate(), substitutionNodeTemplateId.get()); + if(!Objects.isNull(substitutionNodeTemplate)) { + Map serviceTemplateFilter = (Map<String, Object>) substitutionNodeTemplate.getProperties() + .get(ToscaConstants.SERVICE_TEMPLATE_FILTER_PROPERTY_NAME); + + populateServiceTemplateFilterProperties(translateTo, substitutionNodeTemplate, + serviceTemplateFilter); + handlingIndexVar(translateTo, substitutionNodeTemplate); + DataModelUtil + .addNodeTemplate(translateTo.getServiceTemplate(), substitutionNodeTemplateId.get(), + substitutionNodeTemplate); + } } mdcDataDebugMessage.debugExitMessage(null, null); @@ -151,7 +153,7 @@ public class ResourceTranslationResourceGroupImpl extends ResourceTranslationBas mdcDataDebugMessage.debugEntryMessage(null, null); - if (propertyValue instanceof String && propertyValue != null) { + if (propertyValue != null && propertyValue instanceof String) { if (propertyValue.equals(indexVarValue)) { return getNewIndexVarValue(); } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java index 23a4d7317b..35b617be99 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/main/java/org/openecomp/sdc/translator/services/heattotosca/mapping/TranslatorHeatToToscaParameterConverter.java @@ -26,13 +26,10 @@ import org.openecomp.sdc.heat.datatypes.model.Output; import org.openecomp.sdc.heat.datatypes.model.Parameter; import org.openecomp.sdc.tosca.datatypes.model.Constraint; import org.openecomp.sdc.tosca.datatypes.model.EntrySchema; -import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; import org.openecomp.sdc.tosca.datatypes.model.ParameterDefinition; import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; -import org.openecomp.sdc.tosca.datatypes.model.Template; import org.openecomp.sdc.tosca.datatypes.model.heatextend.ParameterDefinitionExt; import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; -import org.openecomp.sdc.translator.services.heattotosca.ConsolidationDataUtil; import org.openecomp.sdc.translator.services.heattotosca.FunctionTranslationFactory; import java.util.ArrayList; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java index 43f4065044..27298ff9b4 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/TestUtils.java @@ -27,6 +27,8 @@ import org.junit.Assert; import org.openecomp.core.translator.api.HeatToToscaTranslator; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.common.utils.SdcCommon; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.datatypes.model.GroupDefinition; import org.openecomp.sdc.tosca.datatypes.model.NodeTemplate; @@ -50,6 +52,8 @@ public class TestUtils { private static String zipFilename = "VSP.zip"; private static String validationFilename = "validationOutput.json"; + private static Logger logger = (Logger) LoggerFactory.getLogger(TestUtils.class); + private TestUtils() { } @@ -105,6 +109,7 @@ public class TestUtils { serviceTemplateMap.put(fileList[i], serviceTemplate); } } catch (Exception e) { + logger.debug("",e); Assert.fail(e.getMessage()); } return serviceTemplateMap; @@ -162,6 +167,7 @@ public class TestUtils { try { yamlFile.close(); } catch (IOException ignore) { + logger.debug("",ignore); } } catch (FileNotFoundException e) { throw e; @@ -207,6 +213,7 @@ public class TestUtils { try { yamlFile.close(); } catch (IOException ignore) { + logger.debug("",ignore); } } catch (FileNotFoundException e) { throw e; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java index f81da11bc9..640da0c12b 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/impl/heattotosca/nested/single/TranslateHeatNestedSingle.java @@ -20,21 +20,38 @@ package org.openecomp.sdc.translator.impl.heattotosca.nested.single; +import org.junit.Before; import org.junit.Test; -import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.ConsolidationDataTestUtil; import org.openecomp.sdc.translator.services.heattotosca.buildconsolidationdata.TestConstants; import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseResourceTranslationTest; +import java.io.IOException; + public class TranslateHeatNestedSingle extends BaseResourceTranslationTest { - { - inputFilesPath = "/mock/heat/nested/single/inputs"; - outputFilesPath = "/mock/heat/nested/single/expectedoutputfiles"; + @Override + @Before + public void setUp() throws IOException { + // do not delete this function. it prevents the superclass setup from running } + @Test public void testTranslate() throws Exception { + inputFilesPath = "/mock/heat/nested/single/inputs"; + outputFilesPath = "/mock/heat/nested/single/expectedoutputfiles"; + + initTranslatorAndTranslate(); testTranslation(); validateNestedTemplateConsolidationData(TestConstants.TEST_SINGLE_NESTED_RESOURCE); } + + @Test + public void testTranslateNestedWithoutNodeTemplates() throws IOException { + inputFilesPath = "/mock/heat/nested/nestedwithoutNodeTemplates/inputs"; + outputFilesPath = "/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles"; + + initTranslatorAndTranslate(); + testTranslation(); + } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java index 03dd30fd09..085c329e7f 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/ConsolidationServiceTest.java @@ -1,10 +1,14 @@ package org.openecomp.sdc.translator.services.heattotosca; +import static org.mockito.Matchers.any; +import static org.mockito.Matchers.eq; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; + import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.Pair; import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.mockito.ArgumentCaptor; import org.mockito.Captor; @@ -30,11 +34,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import static org.mockito.Matchers.any; -import static org.mockito.Matchers.eq; -import static org.mockito.Mockito.times; -import static org.mockito.Mockito.verify; - /** * Created by TALIO on 3/7/2017. */ diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java index c333391b9b..53dd79e5c8 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/buildconsolidationdata/ConsolidationDataTestUtil.java @@ -125,11 +125,14 @@ public class ConsolidationDataTestUtil { } for(String consolidatedKey : consolidatedMap.keySet()){ List<String> consolidatedList = consolidatedMap.get(consolidatedKey); - List<String> expectedList = expectedMap.get(consolidatedKey); - if(expectedList == null ){ - Assert.fail(); - } if(!CollectionUtils.isEqualCollection(consolidatedList,expectedList)){ - Assert.fail(); + if (expectedMap != null) { + List<String> expectedList = expectedMap.get(consolidatedKey); + if (expectedList == null) { + Assert.fail(); + } + if (!CollectionUtils.isEqualCollection(consolidatedList, expectedList)) { + Assert.fail(); + } } } } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionMixPatternFullTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionMixPatternFullTest.java index 149f276903..b1946b3f9b 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionMixPatternFullTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionMixPatternFullTest.java @@ -2,14 +2,17 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.fulltest; import org.junit.Assert; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest; import java.io.IOException; public class UnifiedCompositionMixPatternFullTest extends BaseFullTranslationTest { + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @Override @Before public void setUp() throws IOException { @@ -55,6 +58,7 @@ public class UnifiedCompositionMixPatternFullTest extends BaseFullTranslationTes try { testTranslationWithInit(); }catch(Exception e){ + log.debug("",e); Assert.assertEquals(e.getMessage(), "Resource with id lb_0_int_oam_int_0_port occures more " + "than once in different addOn files"); } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionNestedSingleComputeFullTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionNestedSingleComputeFullTest.java index cebe9ec505..a0ef039100 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionNestedSingleComputeFullTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/fulltest/UnifiedCompositionNestedSingleComputeFullTest.java @@ -1,7 +1,6 @@ package org.openecomp.sdc.translator.services.heattotosca.impl.fulltest; import org.junit.Before; -import org.junit.Ignore; import org.junit.Test; import org.openecomp.sdc.translator.services.heattotosca.impl.resourcetranslation.BaseFullTranslationTest; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java index 9f0a6d79b9..5de07203a1 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/java/org/openecomp/sdc/translator/services/heattotosca/impl/resourcetranslation/BaseFullTranslationTest.java @@ -25,8 +25,6 @@ import static org.junit.Assert.assertEquals; import org.apache.commons.collections4.MapUtils; import org.junit.Assert; import org.junit.Before; -import org.openecomp.config.api.Configuration; -import org.openecomp.config.api.ConfigurationManager; import org.openecomp.core.translator.api.HeatToToscaTranslator; import org.openecomp.core.translator.datatypes.TranslatorOutput; import org.openecomp.core.translator.factory.HeatToToscaTranslatorFactory; @@ -45,7 +43,6 @@ import org.openecomp.sdc.tosca.services.ToscaFileOutputService; import org.openecomp.sdc.tosca.services.impl.ToscaFileOutputServiceCsarImpl; import org.openecomp.sdc.translator.TestUtils; import org.openecomp.sdc.translator.datatypes.heattotosca.TranslationContext; -import org.openecomp.sdc.translator.services.heattotosca.ConfigConstants; import java.io.BufferedInputStream; import java.io.File; diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml new file mode 100644 index 0000000000..306576bed5 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/GlobalSubstitutionTypesServiceTemplate.yaml @@ -0,0 +1,3462 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: GlobalSubstitutionTypes +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +node_types: + org.openecomp.resource.abstract.nodes.heat.module_1_perimeta_swmu_a_child: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + vf_module_id: + type: string + description: Unique ID for this VF Module instance + required: true + status: SUPPORTED + ssc_a_name_0: + type: string + description: Name of Perimeta VM A instance + required: true + status: SUPPORTED + int_ha_network_plen: + type: float + description: Prefix length of subnet associated with internal HA network + required: true + status: SUPPORTED + constraints: + - in_range: + - 0 + - 31 + unused_port_net_id: + type: string + description: Service network unused port network UUID + required: true + status: SUPPORTED + perimeta_server_group: + type: string + description: Server group to use for these VMs + required: true + status: SUPPORTED + perimeta_config: + type: string + description: JSON orchestration template configuration for instance. + required: true + status: SUPPORTED + ssc_a_int_ha_ip_0: + type: string + description: Fixed IP address to use as HA IP of A instance. + required: true + status: SUPPORTED + vnf_name: + type: string + description: Unique name for this VNF instance + required: true + status: SUPPORTED + perimeta_untrusted_vlan_ids: + type: list + description: List of VLAN IDs to use on the untrusted/access network + required: true + status: SUPPORTED + entry_schema: + type: string + int_ha_net_id: + type: string + description: HA network id + required: true + status: SUPPORTED + ssc_b_int_ha_ip_0: + type: string + description: Fixed IP address to use as HA IPs of B instance. + required: true + status: SUPPORTED + ssc_mgmt_vip_0: + type: string + description: Management virtual IP address. + required: true + status: SUPPORTED + ssc_a_trusted_ip_0: + type: string + description: Fixed IP address to use as Trusted/core fixed IPs of A instance. + required: true + status: SUPPORTED + perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + required: true + status: SUPPORTED + vnf_id: + type: string + description: VNF ID of this deployment + required: true + status: SUPPORTED + availability_zone_0: + type: string + description: Availability zone for A instances. + required: true + status: SUPPORTED + ssc_trusted_vip_0: + type: string + description: Trusted/core virtual IP address. + required: true + status: SUPPORTED + ssc_untrusted_vip_0: + type: string + description: Untrusted/access virtual IP address + required: true + status: SUPPORTED + perimeta_sec_groups: + type: list + description: List of security groups to add on trusted interfaces. + required: true + status: SUPPORTED + entry_schema: + type: string + ssc_a_untrusted_v6_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access alternate fixed IP of A instance. + required: true + status: SUPPORTED + perimeta_untrusted_num_vlans: + type: float + description: number of VLANs to connect to the untrusted/access interface + required: true + status: SUPPORTED + constraints: + - in_range: + - 1 + - 1001 + ssc_rf_vip_0: + type: string + description: RF virtual IP address to use for SSC. + required: true + status: SUPPORTED + ssc_a_mgmt_ip_0: + type: string + description: Fixed IP address to use as management IP of A instance. + required: true + status: SUPPORTED + trusted_net_id: + type: string + description: Trusted/core network UUID + required: true + status: SUPPORTED + ssc_untrusted_parent_vip_0: + type: string + description: Untrusted/access parent virtual IP address + required: true + status: SUPPORTED + ssc_untrusted_v6_vip_0: + type: string + description: Untrusted/access alternate virtual IP address + required: true + status: SUPPORTED + ssc_a_rf_ip_0: + type: string + description: RF fixed IP address to use for SSC A. + required: true + status: SUPPORTED + vm_role: + type: string + description: Role of these VMs + required: true + status: SUPPORTED + ssc_a_untrusted_parent_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of A parent instance. + required: true + status: SUPPORTED + perimeta_untrusted_vlan_networks: + type: list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + required: true + status: SUPPORTED + entry_schema: + type: string + ssc_a_untrusted_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of A instance. + required: true + status: SUPPORTED + perimeta_image_name: + type: string + description: Glance image for Perimeta instance + required: true + status: SUPPORTED + mgmt_net_id: + type: string + description: Management network id + required: true + status: SUPPORTED + int_untrusted_parent_net_id: + type: string + description: internal Untrusted/access parent network id + required: true + status: SUPPORTED + perimeta_flavor_name: + type: string + description: Flavor to use for creating VM instances + required: true + status: SUPPORTED + requirements: + - dependency_perimeta_ssc_a_ha_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_a_ha_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_a_untrusted_parent_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_a_untrusted_parent_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_a_mgmt_1_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_a_mgmt_1_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_a_trusted_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_a_trusted_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_a_unused_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_a_unused_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_a_mgmt_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_a_mgmt_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_a_server_0: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - local_storage_perimeta_ssc_a_server_0: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + capabilities: + disk.ephemeral.size_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + instance_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_a_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_a_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_a_mgmt_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_a_mgmt_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_a_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + endpoint_perimeta_ssc_a_server_0: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory.usage_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.requests.rate_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_a_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_a_mgmt_1_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + disk.read.bytes_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_a_mgmt_1_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + disk.write.bytes.rate_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.requests.rate_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_a_server_0: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + disk.device.iops_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_a_mgmt_1_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_a_trusted_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_a_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.requests_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.capacity_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + os_perimeta_ssc_a_server_0: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + disk.read.bytes.rate_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_a_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_a_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + cpu_util_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_a_untrusted_parent_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.allocation_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.bytes_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_a_unused_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_a_trusted_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.latency_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_a_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_a_server_0: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + disk.read.requests_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_a_ha_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + scalable_perimeta_ssc_a_server_0: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + disk.usage_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_a_untrusted_parent_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_a_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_a_ha_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + cpu.delta_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.usage_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.iops_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_a_trusted_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_a_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_a_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.bytes.rate_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_a_untrusted_parent_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + disk.root.size_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.allocation_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.requests_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.bytes_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.requests.rate_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.bytes_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_a_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_a_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + cpu_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_a_unused_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.requests_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.bytes.rate_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_a_unused_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + host_perimeta_ssc_a_server_0: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_a_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_a_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_a_mgmt_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + disk.device.capacity_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_a_ha_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + vcpus_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_a_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.latency_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory.resident_perimeta_ssc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.module_1_perimeta_swmu_b_child: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + vf_module_id: + type: string + description: Unique ID for this VF Module instance + required: true + status: SUPPORTED + int_ha_network_plen: + type: float + description: Prefix length of subnet associated with internal HA network + required: true + status: SUPPORTED + constraints: + - in_range: + - 0 + - 31 + unused_port_net_id: + type: string + description: Service network unused port network UUID + required: true + status: SUPPORTED + perimeta_server_group: + type: string + description: Server group to use for these VMs + required: true + status: SUPPORTED + ssc_b_name_0: + type: string + description: Name of Perimeta VM B instance + required: true + status: SUPPORTED + ssc_a_int_ha_ip_0: + type: string + description: Fixed IP address to use as HA IPs of A instance. + required: true + status: SUPPORTED + ssc_b_untrusted_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of B instance. + required: true + status: SUPPORTED + ssc_b_mgmt_ip_0: + type: string + description: Fixed IP address to use as management IP of B instance. + required: true + status: SUPPORTED + ssc_b_untrusted_parent_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of B parent instance. + required: true + status: SUPPORTED + vnf_name: + type: string + description: Unique name for this VNF instance + required: true + status: SUPPORTED + perimeta_untrusted_vlan_ids: + type: list + description: List of VLAN IDs to use on the untrusted/access network + required: true + status: SUPPORTED + entry_schema: + type: string + int_ha_net_id: + type: string + description: HA network id + required: true + status: SUPPORTED + ssc_b_int_ha_ip_0: + type: string + description: Fixed IP address to use as HA IP of B instance. + required: true + status: SUPPORTED + ssc_mgmt_vip_0: + type: string + description: Management virtual IP address. + required: true + status: SUPPORTED + perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + required: true + status: SUPPORTED + vnf_id: + type: string + description: VNF ID of this deployment + required: true + status: SUPPORTED + availability_zone_1: + type: string + description: Availability zone for B instances. May be the same as A instance. + required: true + status: SUPPORTED + ssc_trusted_vip_0: + type: string + description: Trusted/core virtual IP address. + required: true + status: SUPPORTED + ssc_untrusted_vip_0: + type: string + description: Untrusted/access virtual IP address + required: true + status: SUPPORTED + perimeta_sec_groups: + type: list + description: List of security groups to add on trusted interfaces. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_untrusted_num_vlans: + type: float + description: number of VLANs to connect to the untrusted/access interface + required: true + status: SUPPORTED + constraints: + - in_range: + - 1 + - 1001 + ssc_rf_vip_0: + type: string + description: RF virtual IP address to use for SSC. + required: true + status: SUPPORTED + ssc_b_trusted_ip_0: + type: string + description: Fixed IP address to use as Trusted/core fixed IPs of B instance. + required: true + status: SUPPORTED + trusted_net_id: + type: string + description: Trusted/core network UUID + required: true + status: SUPPORTED + ssc_untrusted_parent_vip_0: + type: string + description: Untrusted/access parent virtual IP address + required: true + status: SUPPORTED + ssc_untrusted_v6_vip_0: + type: string + description: Untrusted/access alternate virtual IP address + required: true + status: SUPPORTED + ssc_b_untrusted_v6_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access alternate fixed IP of B instance. + required: true + status: SUPPORTED + vm_role: + type: string + description: Role of these VMs + required: true + status: SUPPORTED + perimeta_untrusted_vlan_networks: + type: list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_image_name: + type: string + description: Glance image for Perimeta instance + required: true + status: SUPPORTED + ssc_b_rf_ip_0: + type: string + description: RF fixed IP address to use for SSC B. + required: true + status: SUPPORTED + mgmt_net_id: + type: string + description: Management network id + required: true + status: SUPPORTED + int_untrusted_parent_net_id: + type: string + description: internal Untrusted/access parent network id + required: true + status: SUPPORTED + perimeta_flavor_name: + type: string + description: Flavor to use for creating VM instances + required: true + status: SUPPORTED + requirements: + - dependency_perimeta_ssc_b_trusted_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_b_trusted_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_b_untrusted_parent_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_b_untrusted_parent_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_b_mgmt_1_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_b_mgmt_1_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_b_unused_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_b_unused_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_b_server_0: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - local_storage_perimeta_ssc_b_server_0: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - dependency_perimeta_ssc_b_mgmt_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_b_mgmt_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_ssc_b_ha_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_ssc_b_ha_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + host_perimeta_ssc_b_server_0: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + vcpus_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_b_mgmt_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_b_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.requests_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + os_perimeta_ssc_b_server_0: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + memory_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.bytes.rate_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_b_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.read.bytes_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.allocation_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.requests.rate_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_b_trusted_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + disk.device.iops_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_b_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.usage_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + cpu_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_b_mgmt_1_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_b_unused_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + endpoint_perimeta_ssc_b_server_0: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_b_server_0: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + disk.device.read.requests_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_b_mgmt_1_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + cpu.delta_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.requests_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.bytes_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.root.size_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory.resident_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.ephemeral.size_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + instance_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_b_untrusted_parent_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_b_trusted_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_b_mgmt_1_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.bytes_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.latency_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_b_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_b_unused_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_b_ha_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_b_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.capacity_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_b_ha_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_b_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_b_untrusted_parent_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + binding_perimeta_ssc_b_server_0: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + scalable_perimeta_ssc_b_server_0: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + disk.device.latency_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_b_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.bytes.rate_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.read.requests_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_b_untrusted_parent_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + disk.usage_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_b_ha_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_b_trusted_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.allocation_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_b_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.iops_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.bytes_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_b_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_b_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.requests.rate_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_ssc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_b_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory.usage_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_b_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_b_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_ssc_b_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_b_unused_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_ssc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_ssc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + cpu_util_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.bytes.rate_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.capacity_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_ssc_b_mgmt_1_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_ssc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_ssc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.read.bytes.rate_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.requests.rate_perimeta_ssc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_ssc_b_mgmt_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_ssc_b_mgmt_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_ssc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_ssc_b_unused_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.module_2_perimeta_sw_a_child: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + vf_module_id: + type: string + description: Unique ID for this VF Module instance + required: true + status: SUPPORTED + int_ha_network_plen: + type: float + description: Prefix length of subnet associated with internal HA network + required: true + status: SUPPORTED + constraints: + - in_range: + - 0 + - 31 + perimeta_config: + type: string + description: JSON orchestration template configuration for instance. + required: true + status: SUPPORTED + vnf_name: + type: string + description: Unique name for this VNF instance + required: true + status: SUPPORTED + perimeta_untrusted_vlan_ids: + type: list + description: List of VLAN IDs to use on the untrusted/access network + required: true + status: SUPPORTED + entry_schema: + type: string + int_ha_net_id: + type: string + description: HA network id + required: true + status: SUPPORTED + perimeta_instance_index: + type: float + description: Index of instance among multiple instances. Use to retrieve correct parameter for this instance when passed all parameters for all instances. + required: true + status: SUPPORTED + constraints: + - in_range: + - 0 + - 19 + perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + required: true + status: SUPPORTED + perimeta_server_groups: + type: list + description: Server groups to use for these VMs + required: true + status: SUPPORTED + entry_schema: + type: string + vnf_id: + type: string + description: VNF ID of this deployment + required: true + status: SUPPORTED + availability_zone_0: + type: string + description: Availability zone for A instances. + required: true + status: SUPPORTED + rtp_msc_mgmt_vips: + type: list + description: List of management virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_sec_groups: + type: list + description: List of security groups to add on trusted interfaces. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_untrusted_parent_vips: + type: list + description: List of Untrusted/access parent virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_untrusted_num_vlans: + type: float + description: number of VLANs to connect to the untrusted/access interface + required: true + status: SUPPORTED + constraints: + - in_range: + - 1 + - 1001 + rtp_msc_a_int_ha_ips: + type: list + description: List of fixed IP addresses to use as HA IPs of A instances. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_a_untrusted_parent_ips: + type: list + description: List of fixed IP addresses to use as Untrusted/access parent fixed IPs of A instances. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_a_trusted_ips: + type: list + description: List of fixed IP addresses to use as Trusted/core fixed IPs of A instances. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_untrusted_vips: + type: list + description: List of Untrusted/access virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + trusted_net_id: + type: string + description: Trusted/core network UUID + required: true + status: SUPPORTED + rtp_msc_b_int_ha_ips: + type: list + description: List of fixed IP addresses to use as HA IPs of B instances. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_a_mgmt_ips: + type: list + description: List of fixed IP addresses to use as management IPs of A instances. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_a_untrusted_ips: + type: list + description: List of fixed IP addresses to use as Untrusted/access fixed IPs of A instances. + required: true + status: SUPPORTED + entry_schema: + type: string + vm_role: + type: string + description: Role of these VMs + required: true + status: SUPPORTED + rtp_msc_untrusted_v6_vips: + type: list + description: List of Untrusted/access alternate virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_untrusted_vlan_networks: + type: list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_a_untrusted_v6_ips: + type: list + description: List of fixed IP addresses to use as Untrusted/access alternate fixed IPs of A instances. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_image_name: + type: string + description: Glance image for Perimeta instance + required: true + status: SUPPORTED + mgmt_net_id: + type: string + description: Management network id + required: true + status: SUPPORTED + int_untrusted_parent_net_id: + type: string + description: internal Untrusted/access parent network id + required: true + status: SUPPORTED + rtp_msc_a_names: + type: list + description: List of names of Perimeta VM A instances, indexed by perimeta_instance_index + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_flavor_name: + type: string + description: Flavor to use for creating VM instances + required: true + status: SUPPORTED + rtp_msc_trusted_vips: + type: list + description: List of Trusted/core virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + requirements: + - dependency_perimeta_rtp_msc_a_trusted_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_rtp_msc_a_trusted_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_rtp_msc_a_ha_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_rtp_msc_a_ha_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_rtp_msc_a_untrusted_parent_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_rtp_msc_a_untrusted_parent_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_rtp_msc_a_server_0: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - local_storage_perimeta_rtp_msc_a_server_0: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - dependency_perimeta_rtp_msc_a_mgmt_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_rtp_msc_a_mgmt_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + attachment_perimeta_rtp_msc_a_ha_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + disk.device.read.requests_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_rtp_msc_a_mgmt_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_a_trusted_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + disk.device.latency_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + vcpus_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory.resident_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_rtp_msc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_rtp_msc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + cpu_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.capacity_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_rtp_msc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_rtp_msc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.read.bytes_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_rtp_msc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + os_perimeta_rtp_msc_a_server_0: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_a_ha_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.allocation_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.requests.rate_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_rtp_msc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_rtp_msc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.iops_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_a_mgmt_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_rtp_msc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_rtp_msc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.usage_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.bytes_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_rtp_msc_a_trusted_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_rtp_msc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + disk.usage_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_a_ha_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + disk.iops_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.allocation_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.bytes.rate_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.capacity_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_rtp_msc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.ephemeral.size_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_rtp_msc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + cpu_util_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_rtp_msc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_rtp_msc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_rtp_msc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + scalable_perimeta_rtp_msc_a_server_0: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + host_perimeta_rtp_msc_a_server_0: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + disk.device.read.requests.rate_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_rtp_msc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_rtp_msc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_rtp_msc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.root.size_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_rtp_msc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.bytes.rate_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_rtp_msc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + endpoint_perimeta_rtp_msc_a_server_0: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_a_server_0: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_rtp_msc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_a_server_0: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + disk.device.write.requests.rate_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_a_trusted_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + instance_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.read.bytes.rate_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_a_mgmt_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + disk.latency_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_rtp_msc_a_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.bytes_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_rtp_msc_a_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.read.requests_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.bytes.rate_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.bytes_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_rtp_msc_a_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_rtp_msc_a_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.requests_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.requests_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + cpu.delta_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory.usage_perimeta_rtp_msc_a_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + org.openecomp.resource.abstract.nodes.heat.vlan_subinterface_dual: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + perimeta_parent_interface: + type: string + description: Parent Contrail interface + required: true + status: SUPPORTED + perimeta_v6_vip_0: + type: string + description: virtual IPv6 address associated with subinterfaces + required: true + status: SUPPORTED + perimeta_subinterface_name_prefix: + type: string + description: Combined with subinterface_instance_index, this is used as the name of the subinterface resource + required: true + status: SUPPORTED + perimeta_vlan_networks: + type: list + description: List of Contrail VLAN networks to use for the subinterfaces. The order and number of these must match the VLAN ID list + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_subinterface_instance_index: + type: float + description: Index of instance among multiple instances. Use to retrieve correct parameter for this instance when passed all parameters for all instances. + required: true + status: SUPPORTED + constraints: + - in_range: + - 1 + - 1001 + perimeta_ip_0: + type: string + description: IPv4 address associated with subinterfaces + required: true + status: SUPPORTED + perimeta_vip_0: + type: string + description: virtual IPv4 address associated with subinterfaces + required: true + status: SUPPORTED + perimeta_vlan_ids: + type: list + description: List of VLAN IDs to use for subinterfaces + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_mac_address: + type: string + description: MAC address to use for subinterface + required: true + status: SUPPORTED + perimeta_v6_ip_0: + type: string + description: IPv6 address associated with subinterfaces + required: true + status: SUPPORTED + org.openecomp.resource.abstract.nodes.heat.module_2_perimeta_sw_b_child: + derived_from: org.openecomp.resource.abstract.nodes.AbstractSubstitute + properties: + vf_module_id: + type: string + description: Unique ID for this VF Module instance + required: true + status: SUPPORTED + int_ha_network_plen: + type: float + description: Prefix length of subnet associated with internal HA network + required: true + status: SUPPORTED + constraints: + - in_range: + - 0 + - 31 + rtp_msc_b_untrusted_v6_ips: + type: list + description: List of fixed IP addresses to use as Untrusted/access alternate fixed IPs of B instances. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_b_mgmt_ips: + type: list + description: List of fixed IP addresses to use as management IPs of B instances. + required: true + status: SUPPORTED + entry_schema: + type: string + vnf_name: + type: string + description: Unique name for this VNF instance + required: true + status: SUPPORTED + perimeta_untrusted_vlan_ids: + type: list + description: List of VLAN IDs to use on the untrusted/access network + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_b_names: + type: list + description: List of names of Perimeta VM B instances, indexed by perimeta_instance_index + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_b_untrusted_ips: + type: list + description: List of fixed IP addresses to use as Untrusted/access fixed IPs of B instances. + required: true + status: SUPPORTED + entry_schema: + type: string + int_ha_net_id: + type: string + description: HA network id + required: true + status: SUPPORTED + perimeta_instance_index: + type: float + description: Index of instance among multiple instances. Use to retrieve correct parameter for this instance when passed all parameters for all instances. + required: true + status: SUPPORTED + constraints: + - in_range: + - 0 + - 19 + perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + required: true + status: SUPPORTED + perimeta_server_groups: + type: list + description: Server groups to use for these VMs + required: true + status: SUPPORTED + entry_schema: + type: string + vnf_id: + type: string + description: VNF ID of this deployment + required: true + status: SUPPORTED + availability_zone_1: + type: string + description: Availability zone for B instances. May be the same as A instance. + required: true + status: SUPPORTED + rtp_msc_mgmt_vips: + type: list + description: List of management virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_sec_groups: + type: list + description: List of security groups to add on trusted interfaces. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_untrusted_parent_vips: + type: list + description: List of Untrusted/access parent virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_untrusted_num_vlans: + type: float + description: number of VLANs to connect to the untrusted/access interface + required: true + status: SUPPORTED + constraints: + - in_range: + - 1 + - 1001 + rtp_msc_a_int_ha_ips: + type: list + description: List of fixed IP addresses to use as HA IPs of A instances. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_b_trusted_ips: + type: list + description: List of fixed IP addresses to use as Trusted/core fixed IPs of B instances. + required: true + status: SUPPORTED + entry_schema: + type: string + rtp_msc_untrusted_vips: + type: list + description: List of Untrusted/access virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + trusted_net_id: + type: string + description: Trusted/core network UUID + required: true + status: SUPPORTED + rtp_msc_b_int_ha_ips: + type: list + description: List of fixed IP addresses to use as HA IPs of B instances. + required: true + status: SUPPORTED + entry_schema: + type: string + vm_role: + type: string + description: Role of these VMs + required: true + status: SUPPORTED + rtp_msc_untrusted_v6_vips: + type: list + description: List of Untrusted/access alternate virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_untrusted_vlan_networks: + type: list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + required: true + status: SUPPORTED + entry_schema: + type: string + perimeta_image_name: + type: string + description: Glance image for Perimeta instance + required: true + status: SUPPORTED + rtp_msc_b_untrusted_parent_ips: + type: list + description: List of fixed IP addresses to use as Untrusted/access parent fixed IPs of B instances. + required: true + status: SUPPORTED + entry_schema: + type: string + mgmt_net_id: + type: string + description: Management network id + required: true + status: SUPPORTED + int_untrusted_parent_net_id: + type: string + description: internal Untrusted/access parent network id + required: true + status: SUPPORTED + perimeta_flavor_name: + type: string + description: Flavor to use for creating VM instances + required: true + status: SUPPORTED + rtp_msc_trusted_vips: + type: list + description: List of Trusted/core virtual IP addresses for all instances. + required: true + status: SUPPORTED + entry_schema: + type: string + requirements: + - dependency_perimeta_rtp_msc_b_trusted_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_rtp_msc_b_trusted_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_rtp_msc_b_mgmt_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_rtp_msc_b_mgmt_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_rtp_msc_b_server_0: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - local_storage_perimeta_rtp_msc_b_server_0: + capability: tosca.capabilities.Attachment + node: tosca.nodes.BlockStorage + relationship: tosca.relationships.AttachesTo + occurrences: + - 0 + - UNBOUNDED + - dependency_perimeta_rtp_msc_b_ha_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_rtp_msc_b_ha_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + - dependency_perimeta_rtp_msc_b_untrusted_parent_0_port: + capability: tosca.capabilities.Node + node: tosca.nodes.Root + relationship: tosca.relationships.DependsOn + occurrences: + - 0 + - UNBOUNDED + - link_perimeta_rtp_msc_b_untrusted_parent_0_port: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + occurrences: + - 1 + - 1 + capabilities: + attachment_perimeta_rtp_msc_b_mgmt_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + disk.read.requests_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_rtp_msc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_rtp_msc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_rtp_msc_b_trusted_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + disk.device.read.requests.rate_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_rtp_msc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_rtp_msc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.latency_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_rtp_msc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.requests_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.bytes.rate_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_b_server_0: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_rtp_msc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.ephemeral.size_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_rtp_msc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_rtp_msc_b_ha_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + disk.capacity_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_rtp_msc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + cpu_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.capacity_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_b_ha_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + disk.device.usage_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.allocation_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.requests.rate_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_rtp_msc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.root.size_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + cpu_util_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.latency_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + attachment_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: tosca.capabilities.Attachment + occurrences: + - 1 + - UNBOUNDED + os_perimeta_rtp_msc_b_server_0: + type: tosca.capabilities.OperatingSystem + occurrences: + - 1 + - UNBOUNDED + disk.device.write.bytes.rate_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_rtp_msc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.bytes_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_rtp_msc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_rtp_msc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.iops_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_rtp_msc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.bytes_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_rtp_msc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_rtp_msc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + instance_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.requests.rate_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes_perimeta_rtp_msc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_rtp_msc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + vcpus_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory.resident_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes_perimeta_rtp_msc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_b_mgmt_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + endpoint_perimeta_rtp_msc_b_server_0: + type: tosca.capabilities.Endpoint.Admin + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_rtp_msc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.requests_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_rtp_msc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.read.bytes_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.write.bytes.rate_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.packets.rate_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + memory.usage_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + scalable_perimeta_rtp_msc_b_server_0: + type: tosca.capabilities.Scalable + occurrences: + - 1 + - UNBOUNDED + cpu.delta_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.write.bytes_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.allocation_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + disk.usage_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_b_mgmt_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + host_perimeta_rtp_msc_b_server_0: + type: tosca.capabilities.Container + valid_source_types: + - tosca.nodes.SoftwareComponent + occurrences: + - 1 + - UNBOUNDED + network.outpoing.packets_perimeta_rtp_msc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_b_trusted_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_b_trusted_0_port: + type: tosca.capabilities.network.Bindable + valid_source_types: + - org.openecomp.resource.cp.nodes.heat.network.contrailV2.VLANSubInterface + occurrences: + - 0 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_rtp_msc_b_mgmt_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.outgoing.bytes.rate_perimeta_rtp_msc_b_ha_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.iops_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.device.read.requests_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + network.incoming.bytes.rate_perimeta_rtp_msc_b_untrusted_parent_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + feature_perimeta_rtp_msc_b_ha_0_port: + type: tosca.capabilities.Node + occurrences: + - 1 + - UNBOUNDED + binding_perimeta_rtp_msc_b_server_0: + type: tosca.capabilities.network.Bindable + occurrences: + - 1 + - UNBOUNDED + network.outgoing.packets.rate_perimeta_rtp_msc_b_trusted_0_port: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED + disk.read.bytes.rate_perimeta_rtp_msc_b_server_0: + type: org.openecomp.capabilities.metric.Ceilometer + description: A node type that includes the Metric capability indicates that it can be monitored using ceilometer. + occurrences: + - 1 + - UNBOUNDED
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/MainServiceTemplate.yaml new file mode 100644 index 0000000000..1993eeaf1a --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/MainServiceTemplate.yaml @@ -0,0 +1,1302 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: Main +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +topology_template: + inputs: + ssc_a_name_0: + hidden: false + immutable: false + type: string + description: Name of VM A of SSC + constraints: + - pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,29}$' + mgmt_net_plen: + hidden: false + immutable: false + type: float + description: Management network prefix length + constraints: + - in_range: + - 0 + - 32 + ssc_b_name_0: + hidden: false + immutable: false + type: string + description: Name of VM B of SSC + constraints: + - pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,29}$' + ssc_b_untrusted_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IPv4 address on Untrusted/access network for SSC B. + ssc_b_untrusted_parent_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IPv4 address on Untrusted/access parent network for SSC B. + perimeta_untrusted_vlan_ids: + hidden: false + immutable: false + type: list + description: List of VLAN IDs to use on the untrusted/access network + entry_schema: + type: string + ssc_json_radius_servername: + hidden: false + immutable: false + type: string + description: IP Address or hostname of RADIUS server + ssc_mgmt_vip_0: + hidden: false + immutable: false + type: string + description: Management virtual IP address to use for SSC. + rtp_msc_json_use_radius_authentication: + hidden: false + immutable: false + type: string + description: Json prefix, used to indicate if user account authentication is done externally through Radius + constraints: + - valid_values: + - ' ' + - '// not using Radius ' + ssc_trusted_vip_0: + hidden: false + immutable: false + type: string + description: Virtual IPv4 address on Trusted/core network for SSC. + ssc_untrusted_vip_0: + hidden: false + immutable: false + type: string + description: Virtual IPv4 address on Untrusted/access network for SSC. + perimeta_untrusted_num_vlans: + hidden: false + immutable: false + type: float + description: number of VLANs to connect to the untrusted/access interface + constraints: + - in_range: + - 1 + - 1001 + rtp_msc_mgmt_vips: + hidden: false + immutable: false + type: list + description: List of management virtual IP addresses to use for RTP MSC. + entry_schema: + type: string + ssc_a_json_prefix: + hidden: false + immutable: false + type: string + description: Json prefix, used to create the correct json file depending on the operation being performed + default: ' ' + constraints: + - valid_values: + - ' ' + - '// healing, not required ' + rtp_msc_a_untrusted_parent_ips: + hidden: false + immutable: false + type: list + description: List of fixed IPv4 addresses on Untrusted/access parent network for RTP MSC A. + entry_schema: + type: string + ssc_b_trusted_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IPv4 address on Trusted/core network for SSC B. + shared_perimeta_ssc_server_group: + hidden: false + immutable: false + type: string + description: Server group to use for these VMs + ssc_json_radius_timeout: + hidden: false + immutable: false + type: float + description: Timeout for connect requests to RADIUS server + constraints: + - in_range: + - 1 + - 60 + rtp_msc_untrusted_vips: + hidden: false + immutable: false + type: list + description: List of virtual IPv4 addresses on Untrusted/access network for RTP MSC. + entry_schema: + type: string + rtp_msc_json_radius_servername: + hidden: false + immutable: false + type: string + description: IP Address or hostname of RADIUS server + rtp_msc_vnfcnames: + hidden: false + immutable: false + type: list + description: List of vnfc names of the RTP MSC. This is the name associated with the perimeta pair and corresponds to the VIP + entry_schema: + type: string + ssc_image_name: + hidden: false + immutable: false + type: string + description: Glance image to use for launching SSC Perimeta instances. + default: ISBC_SBC_v4.0.40_SU12.qcow2 + constraints: [ + ] + perimeta_max_rtp_msc_count: + hidden: false + immutable: false + type: float + description: Max number of RTP MSCs in a site. + default: 8 + constraints: + - in_range: + - 0 + - 20 + trusted_net_id: + hidden: false + immutable: false + type: string + description: Network ID of Trusted/core network. + constraints: [ + ] + ntp_server_ip_addrs: + hidden: false + immutable: false + type: string + description: NTP server IPv4 addresses, separated by commas. These must be accessible from the management network + constraints: + - pattern: ((?:\d{1,3}\.){3}\d{1,3},)*((?:\d{1,3}\.){3}\d{1,3}) + rtp_msc_json_radius_default: + hidden: false + immutable: false + type: string + description: Default authentication level for RADIUS users + constraints: + - valid_values: + - no-access + - read-only + - support + - restricted-admin + - admin + rtp_msc_a_vnfcnames: + hidden: false + immutable: false + type: list + description: List of vnfc names of the A of RTP MSC + entry_schema: + type: string + ssc_b_untrusted_v6_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IPv6 address on Untrusted/access network for SSC B. + rtp_msc_b_index: + hidden: false + immutable: false + type: float + description: Index of RTP MSC to instantiate / heal. + constraints: + - in_range: + - 0 + - 19 + rtp_msc_untrusted_v6_vips: + hidden: false + immutable: false + type: list + description: List of virtual IPv6 addresses on Untrusted/access network for RTP MSC. + entry_schema: + type: string + shared_ssc_unused_net_id: + hidden: false + immutable: false + type: string + description: Unused network ID + ssc_b_rf_ip_0: + hidden: false + immutable: false + type: string + description: RF fixed IP address to use for SSC B. + rtp_msc_b_untrusted_parent_ips: + hidden: false + immutable: false + type: list + description: List of fixed IPv4 addresses on Untrusted/access parent network for RTP MSC B. + entry_schema: + type: string + ssc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for creating SSC VM instance + default: gv.c8r16d160 + constraints: [ + ] + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Management network ID + constraints: [ + ] + ssc_json_radius_secret: + hidden: false + immutable: false + type: string + description: Shared secret to use for the RADIUS Server + rtp_msc_a_names: + hidden: false + immutable: false + type: list + description: List of names of VM A of RTP MSC + entry_schema: + type: string + shared_int_ha_net_id: + hidden: false + immutable: false + type: string + description: HA network id + constraints: [ + ] + ssc_vnfcname_0: + hidden: false + immutable: false + type: string + description: Name of vnfc of SSC. This is the name associated with the perimeta pair and corresponds to the VIP + constraints: + - pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,31}$' + rtp_msc_trusted_vips: + hidden: false + immutable: false + type: list + description: List of virtual IPv4 addresses on Trusted/core network for RTP MSC. + entry_schema: + type: string + rtp_msc_json_radius_port: + hidden: false + immutable: false + type: float + description: Port to use to connect to RADIUS server + constraints: + - in_range: + - 0 + - 65535 + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF Module instance + ssc_json_radius_port: + hidden: false + immutable: false + type: float + description: Port to use to connect to RADIUS server + constraints: + - in_range: + - 0 + - 65535 + rtp_msc_b_untrusted_v6_ips: + hidden: false + immutable: false + type: list + description: List of fixed IPv6 addresses on Untrusted/access network for RTP MSC B. + entry_schema: + type: string + rtp_msc_b_mgmt_ips: + hidden: false + immutable: false + type: list + description: List of management fixed IP addresses to use for RTP MSC B. + entry_schema: + type: string + ssc_a_int_ha_ip_0: + hidden: false + immutable: false + type: string + description: HA fixed IP address to use for SSC A. + ssc_b_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Management fixed IP address to use for SSC B. + vnf_name: + hidden: false + immutable: false + type: string + description: Unique name for this VNF instance + rtp_msc_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for creating RTP MSC VM instance + default: gv.c8r16d160 + constraints: [ + ] + perimeta_int_ha_net_prefix_v4: + hidden: false + immutable: false + type: string + description: IPv4 subnet prefix for internal HA network + default: 172.26.1.4 + rtp_msc_b_names: + hidden: false + immutable: false + type: list + description: List of names of VM B of RTP MSC + entry_schema: + type: string + rtp_msc_b_untrusted_ips: + hidden: false + immutable: false + type: list + description: List of fixed IPv4 addresses on Untrusted/access network for RTP MSC B. + entry_schema: + type: string + perimeta_ssh_key: + hidden: false + immutable: false + type: string + description: SSH public key + default: ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXvSadEWp+nsz3gEAAAAAAAAAAbggQ3t06mqFIauHfUYMiKZ3EUX3jDFf/uGQoNsIZU6SNE/gl3tY4fFvO8Yzj8OY/vstHHvEadbY5aXNE6kd39ik20uRNbeZLT+pRllBwVKBSVnFqG3kBDvNWmBIenlPZzu3Ay0LYT/aDq6fZaz8Mqy8hzhpAAAAAAAAAAEmS/ESYY4UMs/aF2fVGmCLqudSjLpSsyD8lXag2dmeiT7cTdwRkgtDNTULXCPVucolVZwZF9BxXPNK++B+fL/ZY4MrXHXgZYGEElrMCFYkQFb3jQv3XQtxZ6gVByrzgGc9eiU7tkCgY2cVfb22iIs9n Generated-by-Nova + rtp_msc_a_index: + hidden: false + immutable: false + type: float + description: Index of RTP MSC to instantiate / heal. + constraints: + - in_range: + - 0 + - 19 + rtp_msc_json_v41: + hidden: false + immutable: false + type: string + description: Json prefix, used to ensure that the json tags will be recognised by the server loading them + default: ' ' + constraints: + - valid_values: + - ' ' + - '// older perimeta, parameter not required ' + shared_perimeta_rtp_msc_server_groups: + hidden: false + immutable: false + type: list + description: Server group to use for these VMs + entry_schema: + type: string + rtp_msc_a_json_prefix: + hidden: false + immutable: false + type: string + description: Json prefix, used to create the correct json file depending on the operation being performed + default: ' ' + constraints: + - valid_values: + - ' ' + - '// healing, not required ' + ssc_b_int_ha_ip_0: + hidden: false + immutable: false + type: string + description: HA fixed IP address to use for SSC B. + rtp_msc_b_vnfcnames: + hidden: false + immutable: false + type: list + description: List of vnfc names of VM B of RTP MSC + entry_schema: + type: string + ssc_a_trusted_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IPv4 address on Trusted/core network for SSC A. + vnf_id: + hidden: false + immutable: false + type: string + description: ID of VNF + availability_zone_0: + hidden: false + immutable: false + type: string + description: Availability zone for A instances. + availability_zone_1: + hidden: false + immutable: false + type: string + description: Availability zone for B instances. + perimeta_int_ha_net_prefix_len_v4: + hidden: false + immutable: false + type: float + description: Prefix length of subnet associated with internal HA network + default: 26 + constraints: + - in_range: + - 0 + - 31 + ssc_a_untrusted_v6_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IPv6 address on Untrusted/access network for SSC A. + rtp_msc_untrusted_parent_vips: + hidden: false + immutable: false + type: list + description: List of virtual IPv4 addresses on Untrusted/access parent network for RTP MSC. + entry_schema: + type: string + shared_int_ha_net_prefix_len_v4: + hidden: false + immutable: false + type: float + description: Prefix length of subnet associated with internal HA network + constraints: + - in_range: + - 0 + - 31 + ssc_rf_vip_0: + hidden: false + immutable: false + type: string + description: RF virtual IP address to use for SSC. + rtp_msc_a_int_ha_ips: + hidden: false + immutable: false + type: list + description: List of HA fixed IP addresses to use for RTP MSC A. + entry_schema: + type: string + shared_perimeta_keypair: + hidden: false + immutable: false + type: string + description: Keypair to use for accessing this Perimeta instance + shared_int_untrusted_parent_net_id: + hidden: false + immutable: false + type: string + description: untrusted parent network id + ssc_a_vnfcname_0: + hidden: false + immutable: false + type: string + description: vnfc name of VM A of SSC + constraints: + - pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,31}$' + rtp_msc_json_radius_secret: + hidden: false + immutable: false + type: string + description: Shared secret to use for the RADIUS Server + rtp_msc_b_trusted_ips: + hidden: false + immutable: false + type: list + description: List of fixed IPv4 addresses on Trusted/core network for RTP MSC B. + entry_schema: + type: string + rtp_msc_a_trusted_ips: + hidden: false + immutable: false + type: list + description: List of fixed IPv4 addresses on Trusted/core network for RTP MSC A. + entry_schema: + type: string + rtp_msc_image_name: + hidden: false + immutable: false + type: string + description: Glance image to use for launching RTP MSC Perimeta instances. + default: ISBC_SBC_v4.0.40_SU12.qcow2 + constraints: [ + ] + ssc_a_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Management fixed IP address to use for SSC A. + ssc_untrusted_parent_vip_0: + hidden: false + immutable: false + type: string + description: Virtual IPv4 address on Untrusted/access parent network for SSC. + rtp_msc_b_int_ha_ips: + hidden: false + immutable: false + type: list + description: List of HA fixed IP addresses to use for RTP MSC B. + entry_schema: + type: string + ssc_untrusted_v6_vip_0: + hidden: false + immutable: false + type: string + description: Virtual IPv6 address on Untrusted/access network for SSC. + rtp_msc_a_mgmt_ips: + hidden: false + immutable: false + type: list + description: List of management fixed IP addresses to use for RTP MSC A. + entry_schema: + type: string + rtp_msc_a_untrusted_ips: + hidden: false + immutable: false + type: list + description: List of fixed IPv4 addresses on Untrusted/access network for RTP MSC A. + entry_schema: + type: string + ssc_a_rf_ip_0: + hidden: false + immutable: false + type: string + description: RF fixed IP address to use for SSC A. + ssc_json_use_radius_authentication: + hidden: false + immutable: false + type: string + description: Json prefix, used to indicate if user account authentication is done externally through Radius + constraints: + - valid_values: + - ' ' + - '// not using Radius ' + ssc_a_untrusted_parent_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IPv4 address on Untrusted/access parent network for SSC A. + perimeta_untrusted_vlan_networks: + hidden: false + immutable: false + type: list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + entry_schema: + type: string + ssc_a_untrusted_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IPv4 address on Untrusted/access network for SSC A. + rtp_msc_a_untrusted_v6_ips: + hidden: false + immutable: false + type: list + description: List of fixed IPv6 addresses on Untrusted/access network for RTP MSC A. + entry_schema: + type: string + mgmt_net_default_gateway: + hidden: false + immutable: false + type: string + description: Default gateway for management network + rtp_msc_json_radius_timeout: + hidden: false + immutable: false + type: float + description: Timeout for connect requests to RADIUS server + constraints: + - in_range: + - 1 + - 60 + ssc_b_vnfcname_0: + hidden: false + immutable: false + type: string + description: vnfc name of VM B of SSC + constraints: + - pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,31}$' + ssc_json_v41: + hidden: false + immutable: false + type: string + description: Json prefix, used to ensure that the json tags will be recognised by the server loading them + default: ' ' + constraints: + - valid_values: + - ' ' + - '// older perimeta, parameter not required ' + ssc_json_radius_default: + hidden: false + immutable: false + type: string + description: Default authentication level for RADIUS users + constraints: + - valid_values: + - no-access + - read-only + - support + - restricted-admin + - admin + shared_perimeta_sec_groups: + hidden: false + immutable: false + type: list + description: List of security groups to add on all interfaces. + entry_schema: + type: string + node_templates: + perimeta_rtp_msc_a: + type: org.openecomp.resource.abstract.nodes.heat.module_2_perimeta_sw_a_child + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + int_ha_network_plen: + get_input: shared_int_ha_net_prefix_len_v4 + perimeta_config: + str_replace: + template: + get_artifact: + - SELF + - rtp_msc_a_template + params: + $RADIUS_SERVERNAME: + get_input: rtp_msc_json_radius_servername + $REMOTE_MGMT_IP_ADDR: + get_input: + - rtp_msc_b_mgmt_ips + - get_input: rtp_msc_a_index + $VIRT_MGMT_IP_ADDR: + get_input: + - rtp_msc_mgmt_vips + - get_input: rtp_msc_a_index + $LOCAL_MGMT_IP_ADDR: + get_input: + - rtp_msc_a_mgmt_ips + - get_input: rtp_msc_a_index + $MGMT_NETWORK_DEFAULT_GATEWAY: + get_input: mgmt_net_default_gateway + $RADIUS_DEFAULT: + get_input: rtp_msc_json_radius_default + $COMPLETION_PARAMS: '' + $RADIUS_PORT: + get_input: rtp_msc_json_radius_port + $NTP_SERVER_IP_ADDRS: + get_input: ntp_server_ip_addrs + $HEALING_OR_INSTANTIATION: + get_input: rtp_msc_a_json_prefix + $RADIUS_SECRET: + get_input: rtp_msc_json_radius_secret + $RADIUS_TIMEOUT: + get_input: rtp_msc_json_radius_timeout + $41ORABOVE: + get_input: rtp_msc_json_v41 + $SYSTEM_NAME: + get_input: + - rtp_msc_vnfcnames + - get_input: rtp_msc_a_index + $USERADIUSAUTH: + get_input: rtp_msc_json_use_radius_authentication + $MGMT_NETWORK_PLEN: + get_input: mgmt_net_plen + $VM_NAME_A: + get_input: + - rtp_msc_a_vnfcnames + - get_input: rtp_msc_a_index + $VM_NAME_B: + get_input: + - rtp_msc_b_vnfcnames + - get_input: rtp_msc_a_index + vnf_name: + get_input: vnf_name + perimeta_untrusted_vlan_ids: + get_input: perimeta_untrusted_vlan_ids + int_ha_net_id: + get_input: shared_int_ha_net_id + perimeta_instance_index: + get_input: rtp_msc_a_index + service_template_filter: + substitute_service_template: module_2_perimeta_sw_a_childServiceTemplate.yaml + perimeta_keypair: + get_input: shared_perimeta_keypair + perimeta_server_groups: + get_input: shared_perimeta_rtp_msc_server_groups + vnf_id: + get_input: vnf_id + availability_zone_0: + get_input: availability_zone_0 + rtp_msc_mgmt_vips: + get_input: rtp_msc_mgmt_vips + perimeta_sec_groups: + get_input: shared_perimeta_sec_groups + rtp_msc_untrusted_parent_vips: + get_input: rtp_msc_untrusted_parent_vips + perimeta_untrusted_num_vlans: + get_input: perimeta_untrusted_num_vlans + rtp_msc_a_int_ha_ips: + get_input: rtp_msc_a_int_ha_ips + rtp_msc_a_untrusted_parent_ips: + get_input: rtp_msc_a_untrusted_parent_ips + rtp_msc_a_trusted_ips: + get_input: rtp_msc_a_trusted_ips + rtp_msc_untrusted_vips: + get_input: rtp_msc_untrusted_vips + trusted_net_id: + get_input: trusted_net_id + rtp_msc_b_int_ha_ips: + get_input: rtp_msc_b_int_ha_ips + rtp_msc_a_mgmt_ips: + get_input: rtp_msc_a_mgmt_ips + rtp_msc_a_untrusted_ips: + get_input: rtp_msc_a_untrusted_ips + vm_role: msc + rtp_msc_untrusted_v6_vips: + get_input: rtp_msc_untrusted_v6_vips + perimeta_untrusted_vlan_networks: + get_input: perimeta_untrusted_vlan_networks + rtp_msc_a_untrusted_v6_ips: + get_input: rtp_msc_a_untrusted_v6_ips + perimeta_image_name: + get_input: rtp_msc_image_name + mgmt_net_id: + get_input: mgmt_net_id + int_untrusted_parent_net_id: + get_input: shared_int_untrusted_parent_net_id + rtp_msc_a_names: + get_input: rtp_msc_a_names + perimeta_flavor_name: + get_input: rtp_msc_flavor_name + rtp_msc_trusted_vips: + get_input: rtp_msc_trusted_vips + requirements: + - link_perimeta_rtp_msc_a_ha_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_internal_ha_net_0 + relationship: tosca.relationships.network.LinksTo + - link_perimeta_rtp_msc_a_untrusted_parent_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_int_untrusted_parent_net_0 + relationship: tosca.relationships.network.LinksTo + artifacts: + rtp_msc_a_template: + type: tosca.artifacts.Deployment + file: ../Artifacts/rtp_msc_a_template.json + shared_perimeta_internal_ha_net_0: + type: org.openecomp.resource.vl.nodes.heat.network.contrailV2.VirtualNetwork + properties: + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_enable_dhcp: false + network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: + get_input: perimeta_int_ha_net_prefix_len_v4 + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: + get_input: perimeta_int_ha_net_prefix_v4 + network_name: + str_replace: + template: $VF_NAME_int_ha_net_0 + params: + $VF_NAME: + get_input: vnf_name + network_ipam_refs: + - UNSUPPORTED_RESOURCE_perimeta_internal_ha_ipam_net_0 + perimeta_rtp_msc_b: + type: org.openecomp.resource.abstract.nodes.heat.module_2_perimeta_sw_b_child + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + int_ha_network_plen: + get_input: shared_int_ha_net_prefix_len_v4 + rtp_msc_b_untrusted_v6_ips: + get_input: rtp_msc_b_untrusted_v6_ips + rtp_msc_b_mgmt_ips: + get_input: rtp_msc_b_mgmt_ips + vnf_name: + get_input: vnf_name + perimeta_untrusted_vlan_ids: + get_input: perimeta_untrusted_vlan_ids + rtp_msc_b_names: + get_input: rtp_msc_b_names + rtp_msc_b_untrusted_ips: + get_input: rtp_msc_b_untrusted_ips + int_ha_net_id: + get_input: shared_int_ha_net_id + perimeta_instance_index: + get_input: rtp_msc_b_index + service_template_filter: + substitute_service_template: module_2_perimeta_sw_b_childServiceTemplate.yaml + perimeta_keypair: + get_input: shared_perimeta_keypair + perimeta_server_groups: + get_input: shared_perimeta_rtp_msc_server_groups + vnf_id: + get_input: vnf_id + availability_zone_1: + get_input: availability_zone_1 + rtp_msc_mgmt_vips: + get_input: rtp_msc_mgmt_vips + perimeta_sec_groups: + get_input: shared_perimeta_sec_groups + rtp_msc_untrusted_parent_vips: + get_input: rtp_msc_untrusted_parent_vips + perimeta_untrusted_num_vlans: + get_input: perimeta_untrusted_num_vlans + rtp_msc_a_int_ha_ips: + get_input: rtp_msc_a_int_ha_ips + rtp_msc_b_trusted_ips: + get_input: rtp_msc_b_trusted_ips + rtp_msc_untrusted_vips: + get_input: rtp_msc_untrusted_vips + trusted_net_id: + get_input: trusted_net_id + rtp_msc_b_int_ha_ips: + get_input: rtp_msc_b_int_ha_ips + vm_role: msc + rtp_msc_untrusted_v6_vips: + get_input: rtp_msc_untrusted_v6_vips + perimeta_untrusted_vlan_networks: + get_input: perimeta_untrusted_vlan_networks + perimeta_image_name: + get_input: rtp_msc_image_name + rtp_msc_b_untrusted_parent_ips: + get_input: rtp_msc_b_untrusted_parent_ips + mgmt_net_id: + get_input: mgmt_net_id + int_untrusted_parent_net_id: + get_input: shared_int_untrusted_parent_net_id + perimeta_flavor_name: + get_input: rtp_msc_flavor_name + rtp_msc_trusted_vips: + get_input: rtp_msc_trusted_vips + requirements: + - link_perimeta_rtp_msc_b_ha_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_internal_ha_net_0 + relationship: tosca.relationships.network.LinksTo + - link_perimeta_rtp_msc_b_untrusted_parent_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_int_untrusted_parent_net_0 + relationship: tosca.relationships.network.LinksTo + perimeta_ssc_a: + type: org.openecomp.resource.abstract.nodes.heat.module_1_perimeta_swmu_a_child + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + ssc_a_name_0: + get_input: ssc_a_name_0 + int_ha_network_plen: + get_input: shared_int_ha_net_prefix_len_v4 + perimeta_server_group: + get_input: shared_perimeta_ssc_server_group + unused_port_net_id: + get_input: shared_ssc_unused_net_id + perimeta_config: + str_replace: + template: + get_artifact: + - SELF + - ssc_a_template + params: + $RADIUS_SERVERNAME: + get_input: ssc_json_radius_servername + $REMOTE_MGMT_IP_ADDR: + get_input: ssc_b_mgmt_ip_0 + $VIRT_MGMT_IP_ADDR: + get_input: ssc_mgmt_vip_0 + $LOCAL_MGMT_IP_ADDR: + get_input: ssc_a_mgmt_ip_0 + $MGMT_NETWORK_DEFAULT_GATEWAY: + get_input: mgmt_net_default_gateway + $RADIUS_DEFAULT: + get_input: ssc_json_radius_default + $COMPLETION_PARAMS: '' + $RADIUS_PORT: + get_input: ssc_json_radius_port + $NTP_SERVER_IP_ADDRS: + get_input: ntp_server_ip_addrs + $HEALING_OR_INSTANTIATION: + get_input: ssc_a_json_prefix + $RADIUS_SECRET: + get_input: ssc_json_radius_secret + $RADIUS_TIMEOUT: + get_input: ssc_json_radius_timeout + $41ORABOVE: + get_input: ssc_json_v41 + $SYSTEM_NAME: + get_input: ssc_vnfcname_0 + $USERADIUSAUTH: + get_input: ssc_json_use_radius_authentication + $MGMT_NETWORK_PLEN: + get_input: mgmt_net_plen + $VM_NAME_A: + get_input: ssc_a_vnfcname_0 + $VM_NAME_B: + get_input: ssc_b_vnfcname_0 + ssc_a_int_ha_ip_0: + get_input: ssc_a_int_ha_ip_0 + vnf_name: + get_input: vnf_name + perimeta_untrusted_vlan_ids: + get_input: perimeta_untrusted_vlan_ids + int_ha_net_id: + get_input: shared_int_ha_net_id + ssc_b_int_ha_ip_0: + get_input: ssc_b_int_ha_ip_0 + ssc_mgmt_vip_0: + get_input: ssc_mgmt_vip_0 + service_template_filter: + substitute_service_template: module_1_perimeta_swmu_a_childServiceTemplate.yaml + ssc_a_trusted_ip_0: + get_input: ssc_a_trusted_ip_0 + perimeta_keypair: + get_input: shared_perimeta_keypair + vnf_id: + get_input: vnf_id + availability_zone_0: + get_input: availability_zone_0 + ssc_trusted_vip_0: + get_input: ssc_trusted_vip_0 + ssc_untrusted_vip_0: + get_input: ssc_untrusted_vip_0 + perimeta_sec_groups: + get_input: shared_perimeta_sec_groups + ssc_a_untrusted_v6_ip_0: + get_input: ssc_a_untrusted_v6_ip_0 + perimeta_untrusted_num_vlans: + get_input: perimeta_untrusted_num_vlans + ssc_rf_vip_0: + get_input: ssc_rf_vip_0 + ssc_a_mgmt_ip_0: + get_input: ssc_a_mgmt_ip_0 + trusted_net_id: + get_input: trusted_net_id + ssc_untrusted_parent_vip_0: + get_input: ssc_untrusted_parent_vip_0 + ssc_untrusted_v6_vip_0: + get_input: ssc_untrusted_v6_vip_0 + ssc_a_rf_ip_0: + get_input: ssc_a_rf_ip_0 + vm_role: ssc + ssc_a_untrusted_parent_ip_0: + get_input: ssc_a_untrusted_parent_ip_0 + perimeta_untrusted_vlan_networks: + get_input: perimeta_untrusted_vlan_networks + ssc_a_untrusted_ip_0: + get_input: ssc_a_untrusted_ip_0 + perimeta_image_name: + get_input: ssc_image_name + mgmt_net_id: + get_input: mgmt_net_id + int_untrusted_parent_net_id: + get_input: shared_int_untrusted_parent_net_id + perimeta_flavor_name: + get_input: ssc_flavor_name + requirements: + - link_perimeta_ssc_a_ha_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_internal_ha_net_0 + relationship: tosca.relationships.network.LinksTo + - link_perimeta_ssc_a_untrusted_parent_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_int_untrusted_parent_net_0 + relationship: tosca.relationships.network.LinksTo + - link_perimeta_ssc_a_unused_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_unused_net_0 + relationship: tosca.relationships.network.LinksTo + artifacts: + ssc_a_template: + type: tosca.artifacts.Deployment + file: ../Artifacts/ssc_a_template.json + shared_perimeta_rsg: + type: org.openecomp.resource.vfc.rules.nodes.heat.network.neutron.SecurityRules + properties: + name: + str_replace: + template: $VNF_NAME_shared_perimeta_RSG + params: + $VNF_NAME: + get_input: vnf_name + description: Security Group for Perimeta networks + rules: + - protocol: tcp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + port_range_max: 65535 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + port_range_max: 65535 + direction: egress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: egress + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: egress + - protocol: tcp + ethertype: IPv6 + remote_ip_prefix: ::/0 + port_range_max: 65535 + direction: egress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + remote_ip_prefix: ::/0 + port_range_max: 65535 + direction: egress + port_range_min: 1 + - protocol: tcp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + port_range_max: 65535 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + port_range_max: 65535 + direction: ingress + port_range_min: 1 + - protocol: icmp + ethertype: IPv4 + remote_ip_prefix: 0.0.0.0/0 + direction: ingress + - protocol: icmp + ethertype: IPv6 + remote_ip_prefix: ::/0 + direction: ingress + - protocol: tcp + ethertype: IPv6 + remote_ip_prefix: ::/0 + port_range_max: 65535 + direction: ingress + port_range_min: 1 + - protocol: udp + ethertype: IPv6 + remote_ip_prefix: ::/0 + port_range_max: 65535 + direction: ingress + port_range_min: 1 + shared_perimeta_unused_net_0: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_enabled: false + ip_version: 4 + network_name: + str_replace: + template: $VF_NAME_int_unused_net + params: + $VF_NAME: + get_input: vnf_name + subnets: + shared_perimeta_unused_net_0_subnet: + enable_dhcp: false + ip_version: 4 + cidr: 10.0.0.0/29 + gateway_ip: '' + requirements: + - dependency: + capability: tosca.capabilities.Node + node: shared_perimeta_unused_net_0 + relationship: tosca.relationships.DependsOn + perimeta_ssc_b: + type: org.openecomp.resource.abstract.nodes.heat.module_1_perimeta_swmu_b_child + directives: + - substitutable + properties: + vf_module_id: + get_input: vf_module_id + int_ha_network_plen: + get_input: shared_int_ha_net_prefix_len_v4 + perimeta_server_group: + get_input: shared_perimeta_ssc_server_group + unused_port_net_id: + get_input: shared_ssc_unused_net_id + ssc_b_name_0: + get_input: ssc_b_name_0 + ssc_a_int_ha_ip_0: + get_input: ssc_a_int_ha_ip_0 + ssc_b_untrusted_ip_0: + get_input: ssc_b_untrusted_ip_0 + ssc_b_mgmt_ip_0: + get_input: ssc_b_mgmt_ip_0 + ssc_b_untrusted_parent_ip_0: + get_input: ssc_b_untrusted_parent_ip_0 + vnf_name: + get_input: vnf_name + perimeta_untrusted_vlan_ids: + get_input: perimeta_untrusted_vlan_ids + int_ha_net_id: + get_input: shared_int_ha_net_id + ssc_b_int_ha_ip_0: + get_input: ssc_b_int_ha_ip_0 + ssc_mgmt_vip_0: + get_input: ssc_mgmt_vip_0 + service_template_filter: + substitute_service_template: module_1_perimeta_swmu_b_childServiceTemplate.yaml + perimeta_keypair: + get_input: shared_perimeta_keypair + vnf_id: + get_input: vnf_id + availability_zone_1: + get_input: availability_zone_1 + ssc_trusted_vip_0: + get_input: ssc_trusted_vip_0 + ssc_untrusted_vip_0: + get_input: ssc_untrusted_vip_0 + perimeta_sec_groups: + get_input: shared_perimeta_sec_groups + perimeta_untrusted_num_vlans: + get_input: perimeta_untrusted_num_vlans + ssc_rf_vip_0: + get_input: ssc_rf_vip_0 + ssc_b_trusted_ip_0: + get_input: ssc_b_trusted_ip_0 + trusted_net_id: + get_input: trusted_net_id + ssc_untrusted_parent_vip_0: + get_input: ssc_untrusted_parent_vip_0 + ssc_untrusted_v6_vip_0: + get_input: ssc_untrusted_v6_vip_0 + ssc_b_untrusted_v6_ip_0: + get_input: ssc_b_untrusted_v6_ip_0 + vm_role: ssc + perimeta_untrusted_vlan_networks: + get_input: perimeta_untrusted_vlan_networks + perimeta_image_name: + get_input: ssc_image_name + ssc_b_rf_ip_0: + get_input: ssc_b_rf_ip_0 + mgmt_net_id: + get_input: mgmt_net_id + int_untrusted_parent_net_id: + get_input: shared_int_untrusted_parent_net_id + perimeta_flavor_name: + get_input: ssc_flavor_name + requirements: + - link_perimeta_ssc_b_untrusted_parent_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_int_untrusted_parent_net_0 + relationship: tosca.relationships.network.LinksTo + - link_perimeta_ssc_b_unused_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_unused_net_0 + relationship: tosca.relationships.network.LinksTo + - link_perimeta_ssc_b_ha_0_port: + capability: tosca.capabilities.network.Linkable + node: shared_perimeta_internal_ha_net_0 + relationship: tosca.relationships.network.LinksTo + shared_perimeta_int_untrusted_parent_net_0: + type: org.openecomp.resource.vl.nodes.heat.network.neutron.Net + properties: + dhcp_enabled: false + ip_version: 4 + network_name: + str_replace: + template: $VF_NAME_int_untrusted_parent_net + params: + $VF_NAME: + get_input: vnf_name + subnets: + shared_perimeta_int_untrusted_parent_net_0_subnet: + enable_dhcp: false + ip_version: 4 + cidr: 11.0.0.0/24 + gateway_ip: '' + requirements: + - dependency: + capability: tosca.capabilities.Node + node: shared_perimeta_int_untrusted_parent_net_0 + relationship: tosca.relationships.DependsOn + groups: + base_perimeta_deployment_create_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/base_perimeta_deployment_create.yaml + description: | + HOT template to instantiate base shared resources for a Perimeta deployment + members: + - shared_perimeta_internal_ha_net_0 + - shared_perimeta_rsg + - shared_perimeta_unused_net_0 + - shared_perimeta_int_untrusted_parent_net_0 + module_2_perimeta_rtp_msc_a_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/module_2_perimeta_rtp_msc_a.yaml + description: | + HOT template to instantiate an A side Perimeta RTP MSC and optionally partner it with the corresponding B side + members: + - perimeta_rtp_msc_a + module_1_perimeta_ssc_b_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/module_1_perimeta_ssc_b.yaml + description: "HOT template to instantiate an B side Perimeta SSC \n" + members: + - perimeta_ssc_b + shared_perimeta_ssc_server_gp_group: + type: tosca.groups.Root + members: [ + ] + module_2_perimeta_rtp_msc_b_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/module_2_perimeta_rtp_msc_b.yaml + description: "HOT template to instantiate an B side Perimeta RTP MSC \n" + members: + - perimeta_rtp_msc_b + module_1_perimeta_ssc_a_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/module_1_perimeta_ssc_a.yaml + description: | + HOT template to instantiate an A side Perimeta SSC and optionally partner it with the corresponding B side + members: + - perimeta_ssc_a + outputs: + shared_int_ha_net_prefix_len_v4: + description: HA internal network IPv4 prefix length + value: + get_input: perimeta_int_ha_net_prefix_len_v4 + shared_perimeta_keypair: + description: SSH keypair for deployment + value: UNSUPPORTED_RESOURCE_shared_perimeta_keypair + shared_perimeta_rtp_msc_server_groups: + description: Perimeta RTP MSC Server groups + value: + list_join: + - ',' + - get_attr: + - shared_perimeta_rtp_msc_server_gps + - refs + policies: + shared_perimeta_ssc_server_gp_policy: + type: org.openecomp.policies.placement.Antilocate + properties: + name: + str_replace: + template: $VNF_NAME_shared_ssc_RSG_name_0 + params: + $VNF_NAME: + get_input: vnf_name + container_type: host + targets: + - shared_perimeta_ssc_server_gp_group diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_1_perimeta_swmu_a_childServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_1_perimeta_swmu_a_childServiceTemplate.yaml new file mode 100644 index 0000000000..8f8aae3642 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_1_perimeta_swmu_a_childServiceTemplate.yaml @@ -0,0 +1,831 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: module_1_perimeta_swmu_a_child +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.ssc_a: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF Module instance + ssc_a_name_0: + hidden: false + immutable: false + type: string + description: Name of Perimeta VM A instance + int_ha_network_plen: + hidden: false + immutable: false + type: float + description: Prefix length of subnet associated with internal HA network + constraints: + - in_range: + - 0 + - 31 + unused_port_net_id: + hidden: false + immutable: false + type: string + description: Service network unused port network UUID + perimeta_server_group: + hidden: false + immutable: false + type: string + description: Server group to use for these VMs + perimeta_config: + hidden: false + immutable: false + type: string + description: JSON orchestration template configuration for instance. + ssc_a_int_ha_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as HA IP of A instance. + vnf_name: + hidden: false + immutable: false + type: string + description: Unique name for this VNF instance + perimeta_untrusted_vlan_ids: + hidden: false + immutable: false + type: list + description: List of VLAN IDs to use on the untrusted/access network + entry_schema: + type: string + int_ha_net_id: + hidden: false + immutable: false + type: string + description: HA network id + ssc_b_int_ha_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as HA IPs of B instance. + ssc_mgmt_vip_0: + hidden: false + immutable: false + type: string + description: Management virtual IP address. + ssc_a_trusted_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as Trusted/core fixed IPs of A instance. + perimeta_keypair: + hidden: false + immutable: false + type: string + description: Keypair to use for accessing this Perimeta instance + vnf_id: + hidden: false + immutable: false + type: string + description: VNF ID of this deployment + availability_zone_0: + hidden: false + immutable: false + type: string + description: Availability zone for A instances. + ssc_trusted_vip_0: + hidden: false + immutable: false + type: string + description: Trusted/core virtual IP address. + ssc_untrusted_vip_0: + hidden: false + immutable: false + type: string + description: Untrusted/access virtual IP address + perimeta_sec_groups: + hidden: false + immutable: false + type: list + description: List of security groups to add on trusted interfaces. + entry_schema: + type: string + ssc_a_untrusted_v6_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as Untrusted/access alternate fixed IP of A instance. + perimeta_untrusted_num_vlans: + hidden: false + immutable: false + type: float + description: number of VLANs to connect to the untrusted/access interface + constraints: + - in_range: + - 1 + - 1001 + ssc_rf_vip_0: + hidden: false + immutable: false + type: string + description: RF virtual IP address to use for SSC. + ssc_a_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as management IP of A instance. + trusted_net_id: + hidden: false + immutable: false + type: string + description: Trusted/core network UUID + ssc_untrusted_parent_vip_0: + hidden: false + immutable: false + type: string + description: Untrusted/access parent virtual IP address + ssc_untrusted_v6_vip_0: + hidden: false + immutable: false + type: string + description: Untrusted/access alternate virtual IP address + ssc_a_rf_ip_0: + hidden: false + immutable: false + type: string + description: RF fixed IP address to use for SSC A. + vm_role: + hidden: false + immutable: false + type: string + description: Role of these VMs + ssc_a_untrusted_parent_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of A parent instance. + perimeta_untrusted_vlan_networks: + hidden: false + immutable: false + type: list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + entry_schema: + type: string + ssc_a_untrusted_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of A instance. + perimeta_image_name: + hidden: false + immutable: false + type: string + description: Glance image for Perimeta instance + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Management network id + int_untrusted_parent_net_id: + hidden: false + immutable: false + type: string + description: internal Untrusted/access parent network id + perimeta_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for creating VM instances + node_templates: + perimeta_ssc_a_ha_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_a_int_ha_ip_0 + mac_requirements: + mac_count_required: + is_required: false + name: + str_replace: + template: $VNF_NAME_$VM_ha_port + params: + $VM: + get_input: ssc_a_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: int_ha + network: + get_input: int_ha_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_a_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_a_untrusted_parent_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: true + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_a_untrusted_parent_ip_0 + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: ssc_untrusted_parent_vip_0 + name: + str_replace: + template: $VNF_NAME_$VM_untrusted_parent_port + params: + $VM: + get_input: ssc_a_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: int_untrusted_parent + network: + get_input: int_untrusted_parent_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_a_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_a_mgmt_1_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: true + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_a_rf_ip_0 + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: ssc_rf_vip_0 + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_1_port + params: + $VM: + get_input: ssc_a_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: mgmt + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_a_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_a_trusted_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: true + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_a_trusted_ip_0 + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: ssc_trusted_vip_0 + name: + str_replace: + template: $VNF_NAME_$VM_trusted_port + params: + $VM: + get_input: ssc_a_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: trusted + network: + get_input: trusted_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_a_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_a_unused_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + mac_requirements: + mac_count_required: + is_required: false + name: + str_replace: + template: $VNF_NAME_$VM_unused_port + params: + $VM: + get_input: ssc_a_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: unused_port + network: + get_input: unused_port_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_a_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_a_mgmt_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: true + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_a_mgmt_ip_0 + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: ssc_mgmt_vip_0 + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_0_port + params: + $VM: + get_input: ssc_a_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: mgmt + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_a_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_a_server_0: + type: org.openecomp.resource.vfc.nodes.heat.ssc_a + properties: + flavor: + get_input: perimeta_flavor_name + key_name: + get_input: perimeta_keypair + availability_zone: + get_input: availability_zone_0 + image: + get_input: perimeta_image_name + metadata: + vf_module_id: + get_input: vf_module_id + vm_role: + str_replace: + template: $ROLE_a + params: + $ROLE: + get_input: vm_role + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + msw_template_version: 17.07.04 - 2017-09-01 + config_drive: true + personality: + /opt/MetaSwitch/init/custom.ini: + get_artifact: + - SELF + - custom + user_data_format: RAW + name: + get_input: ssc_a_name_0 + scheduler_hints: + group: + get_input: perimeta_server_group + artifacts: + custom: + type: tosca.artifacts.Deployment + file: ../Artifacts/custom.ini + groups: + module_1_perimeta_swmu_a_child_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/module_1_perimeta_swmu_a_child.yaml + description: | + HOT template to instantiate an A side Perimeta SSC instance with 6 vNICs as part of a nested template + members: + - perimeta_ssc_a_ha_0_port + - perimeta_ssc_a_untrusted_parent_0_port + - perimeta_ssc_a_mgmt_1_port + - perimeta_ssc_a_trusted_0_port + - perimeta_ssc_a_unused_0_port + - perimeta_ssc_a_mgmt_0_port + - perimeta_ssc_a_server_0 + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.module_1_perimeta_swmu_a_child + capabilities: + disk.ephemeral.size_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.ephemeral.size + network.outgoing.packets.rate_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - network.outgoing.packets.rate + network.incoming.bytes.rate_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - network.incoming.bytes.rate + network.outgoing.bytes.rate_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - network.outgoing.bytes.rate + network.incoming.bytes.rate_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - network.incoming.bytes.rate + network.incoming.packets_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - network.incoming.packets + instance_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - instance + network.incoming.packets_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - network.incoming.packets + network.outgoing.packets.rate_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - network.outgoing.packets.rate + feature_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - feature + binding_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - binding + network.outpoing.packets_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - network.outpoing.packets + network.incoming.packets_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - network.incoming.packets + endpoint_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - endpoint + network.outgoing.bytes_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - network.outgoing.bytes + memory.usage_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - memory.usage + network.incoming.packets.rate_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - network.incoming.packets.rate + disk.device.read.requests.rate_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.read.requests.rate + network.incoming.bytes_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - network.incoming.bytes + network.outgoing.bytes.rate_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - network.outgoing.bytes.rate + network.outgoing.packets.rate_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - network.outgoing.packets.rate + feature_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - feature + disk.read.bytes_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.read.bytes + network.outpoing.packets_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - network.outpoing.packets + attachment_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - attachment + disk.write.bytes.rate_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.write.bytes.rate + disk.device.write.requests.rate_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.write.requests.rate + network.incoming.packets_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - network.incoming.packets + memory_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - memory + network.outgoing.packets.rate_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - network.outgoing.packets.rate + feature_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - feature + disk.device.iops_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.iops + binding_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - binding + network.outgoing.bytes_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - network.outgoing.bytes + attachment_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - attachment + network.outgoing.bytes.rate_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - network.outgoing.bytes.rate + network.outgoing.bytes_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - network.outgoing.bytes + disk.write.requests_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.write.requests + network.outgoing.bytes_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - network.outgoing.bytes + disk.capacity_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.capacity + os_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - os + disk.read.bytes.rate_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.read.bytes.rate + network.outgoing.bytes.rate_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - network.outgoing.bytes.rate + network.incoming.bytes.rate_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - network.incoming.bytes.rate + network.outgoing.bytes.rate_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - network.outgoing.bytes.rate + network.outgoing.bytes_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - network.outgoing.bytes + network.outpoing.packets_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - network.outpoing.packets + cpu_util_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - cpu_util + attachment_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - attachment + network.outgoing.bytes.rate_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - network.outgoing.bytes.rate + disk.allocation_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.allocation + disk.write.bytes_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.write.bytes + attachment_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - attachment + feature_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - feature + network.outpoing.packets_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - network.outpoing.packets + network.incoming.bytes_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - network.incoming.bytes + network.incoming.packets_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - network.incoming.packets + disk.device.latency_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.latency + network.incoming.bytes.rate_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - network.incoming.bytes.rate + binding_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - binding + disk.read.requests_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.read.requests + attachment_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - attachment + scalable_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - scalable + disk.usage_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.usage + feature_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - feature + network.incoming.packets.rate_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - network.incoming.packets.rate + feature_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - feature + cpu.delta_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - cpu.delta + disk.device.usage_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.usage + disk.iops_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.iops + binding_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - binding + network.incoming.bytes_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - network.incoming.bytes + network.incoming.packets_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - network.incoming.packets + disk.device.read.bytes.rate_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.read.bytes.rate + network.incoming.packets.rate_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - network.incoming.packets.rate + binding_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - binding + disk.root.size_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.root.size + network.incoming.bytes_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - network.incoming.bytes + network.incoming.packets.rate_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - network.incoming.packets.rate + disk.device.allocation_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.allocation + disk.device.write.requests_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.write.requests + disk.device.write.bytes_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.write.bytes + disk.write.requests.rate_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.write.requests.rate + network.outpoing.packets_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - network.outpoing.packets + disk.device.read.bytes_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.read.bytes + network.outgoing.bytes_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - network.outgoing.bytes + network.incoming.bytes_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - network.incoming.bytes + cpu_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - cpu + binding_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - binding + network.outgoing.packets.rate_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - network.outgoing.packets.rate + disk.device.read.requests_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.read.requests + network.outgoing.packets.rate_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - network.outgoing.packets.rate + disk.device.write.bytes.rate_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.write.bytes.rate + feature_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - feature + host_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - host + network.incoming.packets.rate_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - network.incoming.packets.rate + network.outpoing.packets_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - network.outpoing.packets + network.incoming.packets.rate_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - network.incoming.packets.rate + attachment_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - attachment + disk.device.capacity_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.device.capacity + binding_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - binding + vcpus_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - vcpus + network.incoming.bytes_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - network.incoming.bytes + network.incoming.bytes.rate_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - network.incoming.bytes.rate + disk.latency_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - disk.latency + memory.resident_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - memory.resident + network.incoming.bytes.rate_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - network.incoming.bytes.rate + requirements: + dependency_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - dependency + dependency_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - dependency + dependency_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - dependency + link_perimeta_ssc_a_mgmt_1_port: + - perimeta_ssc_a_mgmt_1_port + - link + local_storage_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - local_storage + link_perimeta_ssc_a_untrusted_parent_0_port: + - perimeta_ssc_a_untrusted_parent_0_port + - link + dependency_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - dependency + dependency_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - dependency + link_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - link + link_perimeta_ssc_a_trusted_0_port: + - perimeta_ssc_a_trusted_0_port + - link + link_perimeta_ssc_a_ha_0_port: + - perimeta_ssc_a_ha_0_port + - link + link_perimeta_ssc_a_unused_0_port: + - perimeta_ssc_a_unused_0_port + - link + dependency_perimeta_ssc_a_mgmt_0_port: + - perimeta_ssc_a_mgmt_0_port + - dependency + dependency_perimeta_ssc_a_server_0: + - perimeta_ssc_a_server_0 + - dependency
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_1_perimeta_swmu_b_childServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_1_perimeta_swmu_b_childServiceTemplate.yaml new file mode 100644 index 0000000000..99285a3be6 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_1_perimeta_swmu_b_childServiceTemplate.yaml @@ -0,0 +1,817 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: module_1_perimeta_swmu_b_child +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.ssc_b: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF Module instance + int_ha_network_plen: + hidden: false + immutable: false + type: float + description: Prefix length of subnet associated with internal HA network + constraints: + - in_range: + - 0 + - 31 + unused_port_net_id: + hidden: false + immutable: false + type: string + description: Service network unused port network UUID + perimeta_server_group: + hidden: false + immutable: false + type: string + description: Server group to use for these VMs + ssc_b_name_0: + hidden: false + immutable: false + type: string + description: Name of Perimeta VM B instance + ssc_a_int_ha_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as HA IPs of A instance. + ssc_b_untrusted_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of B instance. + ssc_b_mgmt_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as management IP of B instance. + ssc_b_untrusted_parent_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of B parent instance. + vnf_name: + hidden: false + immutable: false + type: string + description: Unique name for this VNF instance + perimeta_untrusted_vlan_ids: + hidden: false + immutable: false + type: list + description: List of VLAN IDs to use on the untrusted/access network + entry_schema: + type: string + int_ha_net_id: + hidden: false + immutable: false + type: string + description: HA network id + ssc_b_int_ha_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as HA IP of B instance. + ssc_mgmt_vip_0: + hidden: false + immutable: false + type: string + description: Management virtual IP address. + perimeta_keypair: + hidden: false + immutable: false + type: string + description: Keypair to use for accessing this Perimeta instance + vnf_id: + hidden: false + immutable: false + type: string + description: VNF ID of this deployment + availability_zone_1: + hidden: false + immutable: false + type: string + description: Availability zone for B instances. May be the same as A instance. + ssc_trusted_vip_0: + hidden: false + immutable: false + type: string + description: Trusted/core virtual IP address. + ssc_untrusted_vip_0: + hidden: false + immutable: false + type: string + description: Untrusted/access virtual IP address + perimeta_sec_groups: + hidden: false + immutable: false + type: list + description: List of security groups to add on trusted interfaces. + entry_schema: + type: string + perimeta_untrusted_num_vlans: + hidden: false + immutable: false + type: float + description: number of VLANs to connect to the untrusted/access interface + constraints: + - in_range: + - 1 + - 1001 + ssc_rf_vip_0: + hidden: false + immutable: false + type: string + description: RF virtual IP address to use for SSC. + ssc_b_trusted_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as Trusted/core fixed IPs of B instance. + trusted_net_id: + hidden: false + immutable: false + type: string + description: Trusted/core network UUID + ssc_untrusted_parent_vip_0: + hidden: false + immutable: false + type: string + description: Untrusted/access parent virtual IP address + ssc_untrusted_v6_vip_0: + hidden: false + immutable: false + type: string + description: Untrusted/access alternate virtual IP address + ssc_b_untrusted_v6_ip_0: + hidden: false + immutable: false + type: string + description: Fixed IP address to use as Untrusted/access alternate fixed IP of B instance. + vm_role: + hidden: false + immutable: false + type: string + description: Role of these VMs + perimeta_untrusted_vlan_networks: + hidden: false + immutable: false + type: list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + entry_schema: + type: string + perimeta_image_name: + hidden: false + immutable: false + type: string + description: Glance image for Perimeta instance + ssc_b_rf_ip_0: + hidden: false + immutable: false + type: string + description: RF fixed IP address to use for SSC B. + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Management network id + int_untrusted_parent_net_id: + hidden: false + immutable: false + type: string + description: internal Untrusted/access parent network id + perimeta_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for creating VM instances + node_templates: + perimeta_ssc_b_trusted_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: true + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_b_trusted_ip_0 + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: ssc_trusted_vip_0 + name: + str_replace: + template: $VNF_NAME_$VM_trusted_port + params: + $VM: + get_input: ssc_b_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: trusted + network: + get_input: trusted_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_b_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_b_untrusted_parent_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: true + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_b_untrusted_parent_ip_0 + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: ssc_untrusted_parent_vip_0 + name: + str_replace: + template: $VNF_NAME_$VM_untrusted_parent_port + params: + $VM: + get_input: ssc_b_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: int_untrusted_parent + network: + get_input: int_untrusted_parent_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_b_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_b_mgmt_1_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: true + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_b_rf_ip_0 + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: ssc_rf_vip_0 + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_1_port + params: + $VM: + get_input: ssc_b_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: mgmt + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_b_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_b_unused_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: false + floating_ip_count_required: + is_required: false + mac_requirements: + mac_count_required: + is_required: false + name: + str_replace: + template: $VNF_NAME_$VM_unused_port + params: + $VM: + get_input: ssc_b_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: unused_port + network: + get_input: unused_port_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_b_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_b_server_0: + type: org.openecomp.resource.vfc.nodes.heat.ssc_b + properties: + flavor: + get_input: perimeta_flavor_name + key_name: + get_input: perimeta_keypair + availability_zone: + get_input: availability_zone_1 + image: + get_input: perimeta_image_name + metadata: + vf_module_id: + get_input: vf_module_id + vm_role: + str_replace: + template: $ROLE_b + params: + $ROLE: + get_input: vm_role + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + msw_template_version: 17.07.04 - 2017-09-01 + config_drive: true + user_data_format: RAW + name: + get_input: ssc_b_name_0 + scheduler_hints: + group: + get_input: perimeta_server_group + perimeta_ssc_b_mgmt_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: true + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_b_mgmt_ip_0 + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: ssc_mgmt_vip_0 + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_0_port + params: + $VM: + get_input: ssc_b_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: mgmt + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_b_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_ssc_b_ha_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: ssc_b_int_ha_ip_0 + mac_requirements: + mac_count_required: + is_required: false + name: + str_replace: + template: $VNF_NAME_$VM_ha_port + params: + $VM: + get_input: ssc_b_name_0 + $VNF_NAME: + get_input: vnf_name + network_role_tag: int_ha + network: + get_input: int_ha_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_ssc_b_server_0 + relationship: tosca.relationships.network.BindsTo + groups: + module_1_perimeta_swmu_b_child_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/module_1_perimeta_swmu_b_child.yaml + description: | + HOT template to instantiate an B side Perimeta SSC instance with 6 vNICs as part of a nested template + members: + - perimeta_ssc_b_trusted_0_port + - perimeta_ssc_b_untrusted_parent_0_port + - perimeta_ssc_b_mgmt_1_port + - perimeta_ssc_b_unused_0_port + - perimeta_ssc_b_server_0 + - perimeta_ssc_b_mgmt_0_port + - perimeta_ssc_b_ha_0_port + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.module_1_perimeta_swmu_b_child + capabilities: + host_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - host + network.outgoing.packets.rate_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - network.outgoing.packets.rate + vcpus_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - vcpus + binding_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - binding + network.incoming.bytes_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - network.incoming.bytes + network.outpoing.packets_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - network.outpoing.packets + disk.write.requests_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.write.requests + os_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - os + memory_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - memory + disk.device.write.bytes.rate_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.write.bytes.rate + network.outgoing.bytes.rate_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - network.outgoing.bytes.rate + disk.read.bytes_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.read.bytes + network.outpoing.packets_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - network.outpoing.packets + network.outgoing.packets.rate_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - network.outgoing.packets.rate + disk.device.allocation_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.allocation + network.outgoing.packets.rate_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - network.outgoing.packets.rate + disk.write.requests.rate_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.write.requests.rate + network.incoming.bytes.rate_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - network.incoming.bytes.rate + binding_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - binding + disk.device.iops_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.iops + network.outgoing.packets.rate_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - network.outgoing.packets.rate + disk.device.usage_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.usage + cpu_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - cpu + feature_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - feature + network.outgoing.bytes.rate_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - network.outgoing.bytes.rate + feature_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - feature + endpoint_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - endpoint + feature_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - feature + disk.device.read.requests_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.read.requests + attachment_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - attachment + cpu.delta_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - cpu.delta + network.incoming.packets_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - network.incoming.packets + disk.device.write.requests_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.write.requests + disk.device.write.bytes_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.write.bytes + disk.root.size_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.root.size + network.incoming.bytes.rate_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - network.incoming.bytes.rate + memory.resident_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - memory.resident + network.incoming.packets.rate_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - network.incoming.packets.rate + disk.ephemeral.size_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.ephemeral.size + network.incoming.packets_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - network.incoming.packets + instance_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - instance + attachment_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - attachment + network.incoming.bytes_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - network.incoming.bytes + network.incoming.bytes_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - network.incoming.bytes + network.incoming.packets_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - network.incoming.packets + feature_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - feature + binding_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - binding + network.outpoing.packets_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - network.outpoing.packets + disk.device.read.bytes_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.read.bytes + network.outgoing.bytes.rate_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - network.outgoing.bytes.rate + disk.latency_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.latency + network.outgoing.bytes_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - network.outgoing.bytes + attachment_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - attachment + binding_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - binding + network.outgoing.bytes.rate_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - network.outgoing.bytes.rate + network.outgoing.bytes_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - network.outgoing.bytes + network.incoming.packets.rate_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - network.incoming.packets.rate + disk.device.capacity_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.capacity + feature_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - feature + network.incoming.bytes.rate_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - network.incoming.bytes.rate + binding_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - binding + binding_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - binding + scalable_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - scalable + disk.device.latency_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.latency + network.incoming.packets_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - network.incoming.packets + disk.write.bytes.rate_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.write.bytes.rate + disk.read.requests_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.read.requests + feature_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - feature + disk.usage_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.usage + attachment_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - attachment + attachment_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - attachment + network.outgoing.bytes.rate_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - network.outgoing.bytes.rate + disk.allocation_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.allocation + network.incoming.bytes.rate_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - network.incoming.bytes.rate + network.outgoing.bytes_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - network.outgoing.bytes + disk.iops_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.iops + disk.write.bytes_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.write.bytes + network.outpoing.packets_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - network.outpoing.packets + network.incoming.bytes_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - network.incoming.bytes + network.incoming.packets_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - network.incoming.packets + disk.device.read.requests.rate_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.read.requests.rate + network.incoming.packets.rate_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - network.incoming.packets.rate + network.incoming.packets_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - network.incoming.packets + network.outpoing.packets_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - network.outpoing.packets + network.outgoing.bytes_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - network.outgoing.bytes + network.incoming.bytes_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - network.incoming.bytes + network.incoming.packets.rate_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - network.incoming.packets.rate + memory.usage_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - memory.usage + network.incoming.bytes.rate_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - network.incoming.bytes.rate + network.incoming.packets.rate_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - network.incoming.packets.rate + network.outgoing.packets.rate_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - network.outgoing.packets.rate + network.incoming.bytes_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - network.incoming.bytes + network.outgoing.bytes_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - network.outgoing.bytes + network.outgoing.bytes.rate_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - network.outgoing.bytes.rate + network.outgoing.packets.rate_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - network.outgoing.packets.rate + cpu_util_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - cpu_util + disk.device.read.bytes.rate_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.read.bytes.rate + disk.capacity_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.capacity + network.incoming.packets.rate_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - network.incoming.packets.rate + network.outgoing.bytes_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - network.outgoing.bytes + network.outpoing.packets_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - network.outpoing.packets + disk.read.bytes.rate_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.read.bytes.rate + disk.device.write.requests.rate_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - disk.device.write.requests.rate + attachment_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - attachment + feature_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - feature + network.incoming.bytes.rate_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - network.incoming.bytes.rate + binding_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - binding + requirements: + link_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - link + dependency_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - dependency + dependency_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - dependency + dependency_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - dependency + local_storage_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - local_storage + link_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - link + dependency_perimeta_ssc_b_trusted_0_port: + - perimeta_ssc_b_trusted_0_port + - dependency + dependency_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - dependency + link_perimeta_ssc_b_mgmt_1_port: + - perimeta_ssc_b_mgmt_1_port + - link + link_perimeta_ssc_b_untrusted_parent_0_port: + - perimeta_ssc_b_untrusted_parent_0_port + - link + dependency_perimeta_ssc_b_server_0: + - perimeta_ssc_b_server_0 + - dependency + link_perimeta_ssc_b_unused_0_port: + - perimeta_ssc_b_unused_0_port + - link + dependency_perimeta_ssc_b_mgmt_0_port: + - perimeta_ssc_b_mgmt_0_port + - dependency + link_perimeta_ssc_b_ha_0_port: + - perimeta_ssc_b_ha_0_port + - link
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_2_perimeta_sw_a_childServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_2_perimeta_sw_a_childServiceTemplate.yaml new file mode 100644 index 0000000000..e1c87c0ea3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_2_perimeta_sw_a_childServiceTemplate.yaml @@ -0,0 +1,735 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: module_2_perimeta_sw_a_child +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.rtp_msc_a: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF Module instance + int_ha_network_plen: + hidden: false + immutable: false + type: float + description: Prefix length of subnet associated with internal HA network + constraints: + - in_range: + - 0 + - 31 + perimeta_config: + hidden: false + immutable: false + type: string + description: JSON orchestration template configuration for instance. + vnf_name: + hidden: false + immutable: false + type: string + description: Unique name for this VNF instance + perimeta_untrusted_vlan_ids: + hidden: false + immutable: false + type: list + description: List of VLAN IDs to use on the untrusted/access network + entry_schema: + type: string + int_ha_net_id: + hidden: false + immutable: false + type: string + description: HA network id + perimeta_instance_index: + hidden: false + immutable: false + type: float + description: Index of instance among multiple instances. Use to retrieve correct parameter for this instance when passed all parameters for all instances. + constraints: + - in_range: + - 0 + - 19 + perimeta_keypair: + hidden: false + immutable: false + type: string + description: Keypair to use for accessing this Perimeta instance + perimeta_server_groups: + hidden: false + immutable: false + type: list + description: Server groups to use for these VMs + entry_schema: + type: string + vnf_id: + hidden: false + immutable: false + type: string + description: VNF ID of this deployment + availability_zone_0: + hidden: false + immutable: false + type: string + description: Availability zone for A instances. + rtp_msc_mgmt_vips: + hidden: false + immutable: false + type: list + description: List of management virtual IP addresses for all instances. + entry_schema: + type: string + perimeta_sec_groups: + hidden: false + immutable: false + type: list + description: List of security groups to add on trusted interfaces. + entry_schema: + type: string + rtp_msc_untrusted_parent_vips: + hidden: false + immutable: false + type: list + description: List of Untrusted/access parent virtual IP addresses for all instances. + entry_schema: + type: string + perimeta_untrusted_num_vlans: + hidden: false + immutable: false + type: float + description: number of VLANs to connect to the untrusted/access interface + constraints: + - in_range: + - 1 + - 1001 + rtp_msc_a_int_ha_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as HA IPs of A instances. + entry_schema: + type: string + rtp_msc_a_untrusted_parent_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as Untrusted/access parent fixed IPs of A instances. + entry_schema: + type: string + rtp_msc_a_trusted_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as Trusted/core fixed IPs of A instances. + entry_schema: + type: string + rtp_msc_untrusted_vips: + hidden: false + immutable: false + type: list + description: List of Untrusted/access virtual IP addresses for all instances. + entry_schema: + type: string + trusted_net_id: + hidden: false + immutable: false + type: string + description: Trusted/core network UUID + rtp_msc_b_int_ha_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as HA IPs of B instances. + entry_schema: + type: string + rtp_msc_a_mgmt_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as management IPs of A instances. + entry_schema: + type: string + rtp_msc_a_untrusted_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as Untrusted/access fixed IPs of A instances. + entry_schema: + type: string + vm_role: + hidden: false + immutable: false + type: string + description: Role of these VMs + rtp_msc_untrusted_v6_vips: + hidden: false + immutable: false + type: list + description: List of Untrusted/access alternate virtual IP addresses for all instances. + entry_schema: + type: string + perimeta_untrusted_vlan_networks: + hidden: false + immutable: false + type: list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + entry_schema: + type: string + rtp_msc_a_untrusted_v6_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as Untrusted/access alternate fixed IPs of A instances. + entry_schema: + type: string + perimeta_image_name: + hidden: false + immutable: false + type: string + description: Glance image for Perimeta instance + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Management network id + int_untrusted_parent_net_id: + hidden: false + immutable: false + type: string + description: internal Untrusted/access parent network id + rtp_msc_a_names: + hidden: false + immutable: false + type: list + description: List of names of Perimeta VM A instances, indexed by perimeta_instance_index + entry_schema: + type: string + perimeta_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for creating VM instances + rtp_msc_trusted_vips: + hidden: false + immutable: false + type: list + description: List of Trusted/core virtual IP addresses for all instances. + entry_schema: + type: string + node_templates: + perimeta_rtp_msc_a_trusted_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: + - rtp_msc_a_trusted_ips + - get_input: perimeta_instance_index + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: + - rtp_msc_trusted_vips + - get_input: perimeta_instance_index + name: + str_replace: + template: $VNF_NAME_$VM_trusted_port + params: + $VM: + get_input: + - rtp_msc_a_names + - get_input: perimeta_instance_index + $VNF_NAME: + get_input: vnf_name + network_role_tag: trusted + network: + get_input: trusted_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_rtp_msc_a_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_rtp_msc_a_ha_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: + - rtp_msc_a_int_ha_ips + - get_input: perimeta_instance_index + mac_requirements: + mac_count_required: + is_required: false + name: + str_replace: + template: $VNF_NAME_$VM_ha_port + params: + $VM: + get_input: + - rtp_msc_a_names + - get_input: perimeta_instance_index + $VNF_NAME: + get_input: vnf_name + network_role_tag: int_ha + network: + get_input: int_ha_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_rtp_msc_a_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_rtp_msc_a_untrusted_parent_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: + - rtp_msc_a_untrusted_parent_ips + - get_input: perimeta_instance_index + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: + - rtp_msc_untrusted_parent_vips + - get_input: perimeta_instance_index + name: + str_replace: + template: $VNF_NAME_$VM_untrusted_parent_port + params: + $VM: + get_input: + - rtp_msc_a_names + - get_input: perimeta_instance_index + $VNF_NAME: + get_input: vnf_name + network_role_tag: int_untrusted_parent + network: + get_input: int_untrusted_parent_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_rtp_msc_a_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_rtp_msc_a_server_0: + type: org.openecomp.resource.vfc.nodes.heat.rtp_msc_a + properties: + flavor: + get_input: perimeta_flavor_name + key_name: + get_input: perimeta_keypair + availability_zone: + get_input: availability_zone_0 + image: + get_input: perimeta_image_name + metadata: + vf_module_id: + get_input: vf_module_id + vm_role: + str_replace: + template: $ROLE_a + params: + $ROLE: + get_input: vm_role + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + msw_template_version: 17.07.04 - 2017-09-01 + config_drive: true + personality: + /opt/MetaSwitch/init/custom.ini: + get_artifact: + - SELF + - custom + user_data_format: RAW + name: + get_input: + - rtp_msc_a_names + - get_input: perimeta_instance_index + scheduler_hints: + group: + get_input: + - perimeta_server_groups + - get_input: perimeta_instance_index + artifacts: + custom: + type: tosca.artifacts.Deployment + file: ../Artifacts/custom.ini + perimeta_rtp_msc_a_mgmt_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: + - rtp_msc_a_mgmt_ips + - get_input: perimeta_instance_index + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: + - rtp_msc_mgmt_vips + - get_input: perimeta_instance_index + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_0_port + params: + $VM: + get_input: + - rtp_msc_a_names + - get_input: perimeta_instance_index + $VNF_NAME: + get_input: vnf_name + network_role_tag: mgmt + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_rtp_msc_a_server_0 + relationship: tosca.relationships.network.BindsTo + groups: + module_2_perimeta_sw_a_child_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/module_2_perimeta_sw_a_child.yaml + description: | + HOT template to instantiate an A side Perimeta RTP MSC instance with 4 vNICs as part of a nested template + members: + - perimeta_rtp_msc_a_trusted_0_port + - perimeta_rtp_msc_a_ha_0_port + - perimeta_rtp_msc_a_untrusted_parent_0_port + - perimeta_rtp_msc_a_server_0 + - perimeta_rtp_msc_a_mgmt_0_port + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.module_2_perimeta_sw_a_child + capabilities: + attachment_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - attachment + disk.device.read.requests_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.read.requests + attachment_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - attachment + feature_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - feature + disk.device.latency_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.latency + vcpus_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - vcpus + memory.resident_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - memory.resident + binding_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - binding + network.outgoing.packets.rate_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - network.outgoing.packets.rate + network.incoming.bytes_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - network.incoming.bytes + attachment_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - attachment + cpu_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - cpu + disk.capacity_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.capacity + network.outgoing.bytes_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - network.outgoing.bytes + network.outgoing.bytes.rate_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - network.outgoing.bytes.rate + disk.read.bytes_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.read.bytes + network.outgoing.bytes.rate_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - network.outgoing.bytes.rate + network.outpoing.packets_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - network.outpoing.packets + os_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - os + feature_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - feature + network.incoming.packets_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - network.incoming.packets + disk.device.allocation_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.allocation + disk.write.requests.rate_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.write.requests.rate + network.incoming.bytes.rate_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - network.incoming.bytes.rate + network.incoming.bytes_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - network.incoming.bytes + disk.device.iops_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.iops + feature_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - feature + network.incoming.bytes_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - network.incoming.bytes + network.incoming.bytes.rate_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - network.incoming.bytes.rate + network.incoming.bytes.rate_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - network.incoming.bytes.rate + disk.device.usage_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.usage + disk.write.bytes_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.write.bytes + attachment_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - attachment + network.outgoing.bytes_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - network.outgoing.bytes + feature_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - feature + disk.usage_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.usage + binding_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - binding + disk.iops_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.iops + disk.allocation_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.allocation + disk.device.write.bytes.rate_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.write.bytes.rate + disk.device.capacity_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.capacity + network.outpoing.packets_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - network.outpoing.packets + disk.ephemeral.size_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.ephemeral.size + network.incoming.packets_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - network.incoming.packets + cpu_util_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - cpu_util + network.outgoing.bytes.rate_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - network.outgoing.bytes.rate + network.outgoing.bytes.rate_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - network.outgoing.bytes.rate + network.incoming.packets_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - network.incoming.packets + scalable_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - scalable + host_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - host + disk.device.read.requests.rate_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.read.requests.rate + network.incoming.packets.rate_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - network.incoming.packets.rate + network.incoming.packets.rate_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - network.incoming.packets.rate + network.outgoing.bytes_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - network.outgoing.bytes + network.outpoing.packets_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - network.outpoing.packets + network.outpoing.packets_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - network.outpoing.packets + network.incoming.bytes_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - network.incoming.bytes + disk.root.size_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.root.size + network.incoming.packets.rate_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - network.incoming.packets.rate + network.outgoing.packets.rate_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - network.outgoing.packets.rate + disk.write.bytes.rate_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.write.bytes.rate + network.outgoing.packets.rate_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - network.outgoing.packets.rate + endpoint_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - endpoint + feature_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - feature + network.incoming.packets_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - network.incoming.packets + binding_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - binding + disk.device.write.requests.rate_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.write.requests.rate + binding_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - binding + instance_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - instance + disk.read.bytes.rate_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.read.bytes.rate + binding_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - binding + disk.latency_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.latency + network.incoming.packets.rate_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - network.incoming.packets.rate + disk.device.read.bytes_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.read.bytes + network.outgoing.packets.rate_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - network.outgoing.packets.rate + disk.read.requests_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.read.requests + disk.device.read.bytes.rate_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.read.bytes.rate + disk.device.write.bytes_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.write.bytes + network.incoming.bytes.rate_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - network.incoming.bytes.rate + memory_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - memory + network.outgoing.bytes_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - network.outgoing.bytes + disk.device.write.requests_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.device.write.requests + disk.write.requests_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - disk.write.requests + cpu.delta_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - cpu.delta + memory.usage_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - memory.usage + requirements: + link_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - link + local_storage_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - local_storage + dependency_perimeta_rtp_msc_a_server_0: + - perimeta_rtp_msc_a_server_0 + - dependency + dependency_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - dependency + dependency_perimeta_rtp_msc_a_trusted_0_port: + - perimeta_rtp_msc_a_trusted_0_port + - dependency + dependency_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - dependency + link_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - link + link_perimeta_rtp_msc_a_ha_0_port: + - perimeta_rtp_msc_a_ha_0_port + - link + link_perimeta_rtp_msc_a_untrusted_parent_0_port: + - perimeta_rtp_msc_a_untrusted_parent_0_port + - link + dependency_perimeta_rtp_msc_a_mgmt_0_port: + - perimeta_rtp_msc_a_mgmt_0_port + - dependency
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_2_perimeta_sw_b_childServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_2_perimeta_sw_b_childServiceTemplate.yaml new file mode 100644 index 0000000000..ce9748e1f7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/expectedoutputfiles/module_2_perimeta_sw_b_childServiceTemplate.yaml @@ -0,0 +1,721 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +metadata: + template_name: module_2_perimeta_sw_b_child +imports: +- openecomp_heat_index: + file: openecomp-heat/_index.yml +- GlobalSubstitutionTypes: + file: GlobalSubstitutionTypesServiceTemplate.yaml +node_types: + org.openecomp.resource.vfc.nodes.heat.rtp_msc_b: + derived_from: org.openecomp.resource.vfc.nodes.heat.nova.Server +topology_template: + inputs: + vf_module_id: + hidden: false + immutable: false + type: string + description: Unique ID for this VF Module instance + int_ha_network_plen: + hidden: false + immutable: false + type: float + description: Prefix length of subnet associated with internal HA network + constraints: + - in_range: + - 0 + - 31 + rtp_msc_b_untrusted_v6_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as Untrusted/access alternate fixed IPs of B instances. + entry_schema: + type: string + rtp_msc_b_mgmt_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as management IPs of B instances. + entry_schema: + type: string + vnf_name: + hidden: false + immutable: false + type: string + description: Unique name for this VNF instance + perimeta_untrusted_vlan_ids: + hidden: false + immutable: false + type: list + description: List of VLAN IDs to use on the untrusted/access network + entry_schema: + type: string + rtp_msc_b_names: + hidden: false + immutable: false + type: list + description: List of names of Perimeta VM B instances, indexed by perimeta_instance_index + entry_schema: + type: string + rtp_msc_b_untrusted_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as Untrusted/access fixed IPs of B instances. + entry_schema: + type: string + int_ha_net_id: + hidden: false + immutable: false + type: string + description: HA network id + perimeta_instance_index: + hidden: false + immutable: false + type: float + description: Index of instance among multiple instances. Use to retrieve correct parameter for this instance when passed all parameters for all instances. + constraints: + - in_range: + - 0 + - 19 + perimeta_keypair: + hidden: false + immutable: false + type: string + description: Keypair to use for accessing this Perimeta instance + perimeta_server_groups: + hidden: false + immutable: false + type: list + description: Server groups to use for these VMs + entry_schema: + type: string + vnf_id: + hidden: false + immutable: false + type: string + description: VNF ID of this deployment + availability_zone_1: + hidden: false + immutable: false + type: string + description: Availability zone for B instances. May be the same as A instance. + rtp_msc_mgmt_vips: + hidden: false + immutable: false + type: list + description: List of management virtual IP addresses for all instances. + entry_schema: + type: string + perimeta_sec_groups: + hidden: false + immutable: false + type: list + description: List of security groups to add on trusted interfaces. + entry_schema: + type: string + rtp_msc_untrusted_parent_vips: + hidden: false + immutable: false + type: list + description: List of Untrusted/access parent virtual IP addresses for all instances. + entry_schema: + type: string + perimeta_untrusted_num_vlans: + hidden: false + immutable: false + type: float + description: number of VLANs to connect to the untrusted/access interface + constraints: + - in_range: + - 1 + - 1001 + rtp_msc_a_int_ha_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as HA IPs of A instances. + entry_schema: + type: string + rtp_msc_b_trusted_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as Trusted/core fixed IPs of B instances. + entry_schema: + type: string + rtp_msc_untrusted_vips: + hidden: false + immutable: false + type: list + description: List of Untrusted/access virtual IP addresses for all instances. + entry_schema: + type: string + trusted_net_id: + hidden: false + immutable: false + type: string + description: Trusted/core network UUID + rtp_msc_b_int_ha_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as HA IPs of B instances. + entry_schema: + type: string + vm_role: + hidden: false + immutable: false + type: string + description: Role of these VMs + rtp_msc_untrusted_v6_vips: + hidden: false + immutable: false + type: list + description: List of Untrusted/access alternate virtual IP addresses for all instances. + entry_schema: + type: string + perimeta_untrusted_vlan_networks: + hidden: false + immutable: false + type: list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + entry_schema: + type: string + perimeta_image_name: + hidden: false + immutable: false + type: string + description: Glance image for Perimeta instance + rtp_msc_b_untrusted_parent_ips: + hidden: false + immutable: false + type: list + description: List of fixed IP addresses to use as Untrusted/access parent fixed IPs of B instances. + entry_schema: + type: string + mgmt_net_id: + hidden: false + immutable: false + type: string + description: Management network id + int_untrusted_parent_net_id: + hidden: false + immutable: false + type: string + description: internal Untrusted/access parent network id + perimeta_flavor_name: + hidden: false + immutable: false + type: string + description: Flavor to use for creating VM instances + rtp_msc_trusted_vips: + hidden: false + immutable: false + type: list + description: List of Trusted/core virtual IP addresses for all instances. + entry_schema: + type: string + node_templates: + perimeta_rtp_msc_b_trusted_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: + - rtp_msc_b_trusted_ips + - get_input: perimeta_instance_index + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: + - rtp_msc_trusted_vips + - get_input: perimeta_instance_index + name: + str_replace: + template: $VNF_NAME_$VM_trusted_port + params: + $VM: + get_input: + - rtp_msc_b_names + - get_input: perimeta_instance_index + $VNF_NAME: + get_input: vnf_name + network_role_tag: trusted + network: + get_input: trusted_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_rtp_msc_b_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_rtp_msc_b_mgmt_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: + - rtp_msc_b_mgmt_ips + - get_input: perimeta_instance_index + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: + - rtp_msc_mgmt_vips + - get_input: perimeta_instance_index + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_0_port + params: + $VM: + get_input: + - rtp_msc_b_names + - get_input: perimeta_instance_index + $VNF_NAME: + get_input: vnf_name + network_role_tag: mgmt + network: + get_input: mgmt_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_rtp_msc_b_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_rtp_msc_b_server_0: + type: org.openecomp.resource.vfc.nodes.heat.rtp_msc_b + properties: + flavor: + get_input: perimeta_flavor_name + key_name: + get_input: perimeta_keypair + availability_zone: + get_input: availability_zone_1 + image: + get_input: perimeta_image_name + metadata: + vf_module_id: + get_input: vf_module_id + vm_role: + str_replace: + template: $ROLE_b + params: + $ROLE: + get_input: vm_role + vnf_id: + get_input: vnf_id + vnf_name: + get_input: vnf_name + msw_template_version: 17.07.04 - 2017-09-01 + config_drive: true + user_data_format: RAW + name: + get_input: + - rtp_msc_b_names + - get_input: perimeta_instance_index + scheduler_hints: + group: + get_input: + - perimeta_server_groups + - get_input: perimeta_instance_index + perimeta_rtp_msc_b_ha_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: + - rtp_msc_b_int_ha_ips + - get_input: perimeta_instance_index + mac_requirements: + mac_count_required: + is_required: false + name: + str_replace: + template: $VNF_NAME_$VM_ha_port + params: + $VM: + get_input: + - rtp_msc_b_names + - get_input: perimeta_instance_index + $VNF_NAME: + get_input: vnf_name + network_role_tag: int_ha + network: + get_input: int_ha_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_rtp_msc_b_server_0 + relationship: tosca.relationships.network.BindsTo + perimeta_rtp_msc_b_untrusted_parent_0_port: + type: org.openecomp.resource.cp.nodes.heat.network.neutron.Port + properties: + ip_requirements: + - ip_version: 4 + ip_count_required: + is_required: true + floating_ip_count_required: + is_required: false + security_groups: + get_input: perimeta_sec_groups + fixed_ips: + - ip_address: + get_input: + - rtp_msc_b_untrusted_parent_ips + - get_input: perimeta_instance_index + mac_requirements: + mac_count_required: + is_required: false + allowed_address_pairs: + - ip_address: + get_input: + - rtp_msc_untrusted_parent_vips + - get_input: perimeta_instance_index + name: + str_replace: + template: $VNF_NAME_$VM_untrusted_parent_port + params: + $VM: + get_input: + - rtp_msc_b_names + - get_input: perimeta_instance_index + $VNF_NAME: + get_input: vnf_name + network_role_tag: int_untrusted_parent + network: + get_input: int_untrusted_parent_net_id + requirements: + - binding: + capability: tosca.capabilities.network.Bindable + node: perimeta_rtp_msc_b_server_0 + relationship: tosca.relationships.network.BindsTo + groups: + module_2_perimeta_sw_b_child_group: + type: org.openecomp.groups.heat.HeatStack + properties: + heat_file: ../Artifacts/module_2_perimeta_sw_b_child.yaml + description: | + HOT template to instantiate an B side Perimeta RTP MSC instance with 4 vNICs as part of a nested template + members: + - perimeta_rtp_msc_b_trusted_0_port + - perimeta_rtp_msc_b_mgmt_0_port + - perimeta_rtp_msc_b_server_0 + - perimeta_rtp_msc_b_ha_0_port + - perimeta_rtp_msc_b_untrusted_parent_0_port + substitution_mappings: + node_type: org.openecomp.resource.abstract.nodes.heat.module_2_perimeta_sw_b_child + capabilities: + attachment_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - attachment + disk.read.requests_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.read.requests + network.incoming.bytes.rate_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - network.incoming.bytes.rate + network.incoming.packets_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - network.incoming.packets + attachment_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - attachment + disk.device.read.requests.rate_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.read.requests.rate + network.outgoing.packets.rate_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - network.outgoing.packets.rate + network.incoming.bytes_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - network.incoming.bytes + network.incoming.bytes.rate_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - network.incoming.bytes.rate + disk.latency_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.latency + network.incoming.packets.rate_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - network.incoming.packets.rate + disk.device.write.requests_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.write.requests + disk.device.read.bytes.rate_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.read.bytes.rate + memory_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - memory + network.outgoing.bytes.rate_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - network.outgoing.bytes.rate + feature_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - feature + network.incoming.packets_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - network.incoming.packets + disk.ephemeral.size_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.ephemeral.size + network.outgoing.bytes.rate_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - network.outgoing.bytes.rate + attachment_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - attachment + disk.capacity_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.capacity + network.incoming.bytes_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - network.incoming.bytes + cpu_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - cpu + disk.device.capacity_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.capacity + binding_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - binding + disk.device.usage_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.usage + disk.device.allocation_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.allocation + disk.write.requests.rate_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.write.requests.rate + network.outpoing.packets_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - network.outpoing.packets + disk.root.size_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.root.size + cpu_util_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - cpu_util + disk.device.latency_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.latency + attachment_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - attachment + os_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - os + disk.device.write.bytes.rate_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.write.bytes.rate + network.outgoing.bytes_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - network.outgoing.bytes + disk.device.read.bytes_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.read.bytes + network.outgoing.packets.rate_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - network.outgoing.packets.rate + network.incoming.packets_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - network.incoming.packets + disk.device.iops_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.iops + network.incoming.packets.rate_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - network.incoming.packets.rate + network.incoming.packets_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - network.incoming.packets + disk.write.bytes_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.write.bytes + network.incoming.bytes_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - network.incoming.bytes + network.outgoing.bytes.rate_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - network.outgoing.bytes.rate + network.outgoing.bytes_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - network.outgoing.bytes + instance_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - instance + disk.device.write.requests.rate_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.write.requests.rate + network.outgoing.packets.rate_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - network.outgoing.packets.rate + network.incoming.bytes_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - network.incoming.bytes + network.outgoing.bytes_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - network.outgoing.bytes + vcpus_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - vcpus + memory.resident_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - memory.resident + network.outgoing.bytes_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - network.outgoing.bytes + feature_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - feature + endpoint_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - endpoint + network.outpoing.packets_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - network.outpoing.packets + disk.write.requests_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.write.requests + network.incoming.packets.rate_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - network.incoming.packets.rate + disk.read.bytes_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.read.bytes + disk.write.bytes.rate_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.write.bytes.rate + network.incoming.packets.rate_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - network.incoming.packets.rate + memory.usage_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - memory.usage + binding_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - binding + scalable_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - scalable + cpu.delta_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - cpu.delta + disk.device.write.bytes_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.write.bytes + network.outpoing.packets_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - network.outpoing.packets + disk.allocation_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.allocation + feature_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - feature + disk.usage_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.usage + binding_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - binding + host_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - host + network.outpoing.packets_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - network.outpoing.packets + feature_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - feature + binding_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - binding + network.incoming.bytes.rate_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - network.incoming.bytes.rate + network.outgoing.bytes.rate_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - network.outgoing.bytes.rate + disk.iops_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.iops + disk.device.read.requests_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.device.read.requests + network.incoming.bytes.rate_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - network.incoming.bytes.rate + feature_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - feature + binding_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - binding + network.outgoing.packets.rate_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - network.outgoing.packets.rate + disk.read.bytes.rate_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - disk.read.bytes.rate + requirements: + link_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - link + dependency_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - dependency + link_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - link + dependency_perimeta_rtp_msc_b_trusted_0_port: + - perimeta_rtp_msc_b_trusted_0_port + - dependency + dependency_perimeta_rtp_msc_b_ha_0_port: + - perimeta_rtp_msc_b_ha_0_port + - dependency + dependency_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - dependency + dependency_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - dependency + local_storage_perimeta_rtp_msc_b_server_0: + - perimeta_rtp_msc_b_server_0 + - local_storage + link_perimeta_rtp_msc_b_mgmt_0_port: + - perimeta_rtp_msc_b_mgmt_0_port + - link + link_perimeta_rtp_msc_b_untrusted_parent_0_port: + - perimeta_rtp_msc_b_untrusted_parent_0_port + - link
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/MANIFEST.json b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/MANIFEST.json new file mode 100644 index 0000000000..95370a29a8 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/MANIFEST.json @@ -0,0 +1,86 @@ +{ + "name": "xbi test TSBC 0905", + "description": "test", + "version": "0.1", + "data": [ + { + "isBase": false, + "file": "module_2_perimeta_rtp_msc_b.yaml", + "type": "HEAT", + "data": [ + { + "file": "module_2_perimeta_rtp_msc_b.env", + "type": "HEAT_ENV" + } + ] + }, + { + "isBase": false, + "file": "module_2_perimeta_rtp_msc_a.yaml", + "type": "HEAT", + "data": [ + { + "file": "module_2_perimeta_rtp_msc_a.env", + "type": "HEAT_ENV" + } + ] + }, + { + "isBase": false, + "file": "module_1_perimeta_ssc_b.yaml", + "type": "HEAT", + "data": [ + { + "file": "module_1_perimeta_ssc_b.env", + "type": "HEAT_ENV" + } + ] + }, + { + "isBase": false, + "file": "module_1_perimeta_ssc_a.yaml", + "type": "HEAT", + "data": [ + { + "file": "module_1_perimeta_ssc_a.env", + "type": "HEAT_ENV" + } + ] + }, + { + "isBase": true, + "file": "base_perimeta_deployment_create.yaml", + "type": "HEAT", + "data": [ + { + "file": "base_perimeta_deployment_create.env", + "type": "HEAT_ENV" + } + ] + }, + { + "file": "module_2_perimeta_sw_b_child.yaml", + "type": "HEAT" + }, + { + "file": "vlan_subinterface_dual.yaml", + "type": "HEAT" + }, + { + "file": "module_2_perimeta_sw_a_child.yaml", + "type": "HEAT" + }, + { + "file": "module_1_perimeta_swmu_b_child.yaml", + "type": "HEAT" + }, + { + "file": "module_1_perimeta_swmu_a_child.yaml", + "type": "HEAT" + }, + { + "file": "custom.ini", + "type": "OTHER" + } + ] +}
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/base_perimeta_deployment_create.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/base_perimeta_deployment_create.env new file mode 100644 index 0000000000..03aa1aed5e --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/base_perimeta_deployment_create.env @@ -0,0 +1,34 @@ +# Environment file for heat template which instantiates base resources for a +# Perimeta deployment +# +parameters: + # + # General ECOMP VNF parameters + # + + # Unique VNF name + #vnf_name: tsbc0002 + + # + # General deployment parameters. + # + + # SSH public key to upload to Perimeta instances for ssh access. + perimeta_ssh_key: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDXvSadEWp+nsz3gEAAAAAAAAAAbggQ3t06mqFIauHfUYMiKZ3EUX3jDFf/uGQoNsIZU6SNE/gl3tY4fFvO8Yzj8OY/vstHHvEadbY5aXNE6kd39ik20uRNbeZLT+pRllBwVKBSVnFqG3kBDvNWmBIenlPZzu3Ay0LYT/aDq6fZaz8Mqy8hzhpAAAAAAAAAAEmS/ESYY4UMs/aF2fVGmCLqudSjLpSsyD8lXag2dmeiT7cTdwRkgtDNTULXCPVucolVZwZF9BxXPNK++B+fL/ZY4MrXHXgZYGEElrMCFYkQFb3jQv3XQtxZ6gVByrzgGc9eiU7tkCgY2cVfb22iIs9n Generated-by-Nova" + + + # Max number of RTP MSC pair in the site. This is used to create the correct + # number of MSRP specific server groups. These are used by the appropriate + # module_2 yaml files to associate the server group with the particular + # perimeta RTP VF pair + perimeta_max_rtp_msc_count: 8 + + # + # Shared internal HA network related parameters + # + + # IPv4 network prefix for internal HA network + perimeta_int_ha_net_prefix_v4: 172.26.1.4 + + # IPv4 network prefix length for internal HA network + perimeta_int_ha_net_prefix_len_v4: 26 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/base_perimeta_deployment_create.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/base_perimeta_deployment_create.yaml new file mode 100644 index 0000000000..4b97d04fd7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/base_perimeta_deployment_create.yaml @@ -0,0 +1,222 @@ +# Heat template which instantiates base resources for a Perimeta deployment, +# namely. +# - keypair +# - security group +# - SSC server group +# - RTP MSC server group +# - Internal HA network +# - Internal unused network +# - Internal parent network for the untrusted VLANs +# +# Template version 17.07.04 - 2017-09-01 +# +# +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate base shared resources for a Perimeta deployment + +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + perimeta_ssh_key: + type: string + description: SSH public key + # Deployment scaling parameters + perimeta_max_rtp_msc_count: + type: number + description: Max number of RTP MSCs in a site. + constraints: + - range: { min: 0, max: 20 } + description: perimeta_max_rtp_msc_count must be between 0 and 20 + # Internal high availability network parameters + perimeta_int_ha_net_prefix_v4: + type: string + description: IPv4 subnet prefix for internal HA network + perimeta_int_ha_net_prefix_len_v4: + type: number + description: Prefix length of subnet associated with internal HA network + constraints: + - range: { min: 0, max: 31 } + description: int_ha_net_plen must be between 0 and 31 + +resources: + # Resource Security Group + shared_perimeta_rsg: + type: OS::Neutron::SecurityGroup + properties: + description: Security Group for Perimeta networks + name: + str_replace: + template: $VNF_NAME_shared_perimeta_RSG + params: + $VNF_NAME: { get_param: vnf_name } + rules: + - {"direction": "egress", "remote_ip_prefix": "0.0.0.0/0", "protocol": "tcp", "ethertype": "IPv4", "port_range_max": 65535, "port_range_min": 1} + - {"direction": "egress", "remote_ip_prefix": "0.0.0.0/0", "protocol": "udp", "ethertype": "IPv4", "port_range_max": 65535, "port_range_min": 1} + - {"direction": "egress", "remote_ip_prefix": "0.0.0.0/0", "protocol": "icmp", "ethertype": "IPv4"} + - {"direction": "egress", "remote_ip_prefix": "::/0", "protocol": "icmp", "ethertype": "IPv6"} + - {"direction": "egress", "remote_ip_prefix": "::/0", "protocol": "tcp", "ethertype": "IPv6", "port_range_max": 65535, "port_range_min": 1} + - {"direction": "egress", "remote_ip_prefix": "::/0", "protocol": "udp", "ethertype": "IPv6", "port_range_max": 65535, "port_range_min": 1} + - {"direction": "ingress", "remote_ip_prefix": "0.0.0.0/0", "protocol": "tcp", "ethertype": "IPv4", "port_range_max": 65535, "port_range_min": 1} + - {"direction": "ingress", "remote_ip_prefix": "0.0.0.0/0", "protocol": "udp", "ethertype": "IPv4", "port_range_max": 65535, "port_range_min": 1} + - {"direction": "ingress", "remote_ip_prefix": "0.0.0.0/0", "protocol": "icmp", "ethertype": "IPv4"} + - {"direction": "ingress", "remote_ip_prefix": "::/0", "protocol": "icmp", "ethertype": "IPv6"} + - {"direction": "ingress", "remote_ip_prefix": "::/0", "protocol": "tcp", "ethertype": "IPv6", "port_range_max": 65535, "port_range_min": 1} + - {"direction": "ingress", "remote_ip_prefix": "::/0", "protocol": "udp", "ethertype": "IPv6", "port_range_max": 65535, "port_range_min": 1} + + # Keypair for use by Perimeta instances. + shared_perimeta_keypair: + type: OS::Nova::KeyPair + properties: + name: + str_replace: + template: $VNF_NAME_key_pair + params: + $VNF_NAME: { get_param: vnf_name } + public_key: {get_param: perimeta_ssh_key} + save_private_key: false + + # Create the server groups. We need one per pair of perimeta VFs in the site + # We only have one SSC + # We can have multiple RTP MSCs + + shared_perimeta_ssc_server_gp: + type: OS::Nova::ServerGroup + properties: + name: + str_replace: + template: $VNF_NAME_shared_ssc_RSG_name_0 + params: + $VNF_NAME: { get_param: vnf_name } + policies: ['anti-affinity'] + + + shared_perimeta_rtp_msc_server_gps: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: perimeta_max_rtp_msc_count } + resource_def: + type: OS::Nova::ServerGroup + properties: + name: + str_replace: + template: $VNF_NAME_shared_rtp_msc_RSG_name_"%index%" + params: + $VNF_NAME: { get_param: vnf_name } + policies: ['anti-affinity'] + + # Internal HA network for deployment. + # This is a private network with all instances on the same isolated L2 + # L2 subnet. There is no requirement for routing in an IP sense which + # means that there is no need for a default gateway + perimeta_internal_ha_ipam_net_0: + type: OS::ContrailV2::NetworkIpam + properties: + name: + str_replace: + template: $VF_NAME_int_ha_ipam_net_0 + params: + $VF_NAME: { get_param: vnf_name } + + shared_perimeta_internal_ha_net_0: + type: OS::ContrailV2::VirtualNetwork + depends_on: [ perimeta_internal_ha_ipam_net_0 ] + properties: + name: + str_replace: + template: $VF_NAME_int_ha_net_0 + params: + $VF_NAME: { get_param: vnf_name } + virtual_network_properties: + virtual_network_properties_rpf: enable + is_shared: false + flood_unknown_unicast: true + network_ipam_refs: + - get_resource: perimeta_internal_ha_ipam_net_0 + network_ipam_refs_data: + - network_ipam_refs_data_ipam_subnets: + - network_ipam_refs_data_ipam_subnets_subnet: + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix: { get_param: perimeta_int_ha_net_prefix_v4 } + network_ipam_refs_data_ipam_subnets_subnet_ip_prefix_len: { get_param: perimeta_int_ha_net_prefix_len_v4 } + network_ipam_refs_data_ipam_subnets_enable_dhcp: false + + # Internal unused network - required for unused ports on SSC. + shared_perimeta_unused_net_0: + type: OS::Neutron::Net + properties: + name: + str_replace: + template: $VF_NAME_int_unused_net + params: + $VF_NAME: { get_param: vnf_name } + + # A subnet is required for unused network but we just use arbitrary IP addresses + # as these will never be used. + shared_perimeta_unused_net_0_subnet: + type: OS::Neutron::Subnet + depends_on: [ shared_perimeta_unused_net_0 ] + properties: + network: { get_resource: shared_perimeta_unused_net_0 } + cidr: "10.0.0.0/29" + ip_version: 4 + enable_dhcp: false + gateway_ip: "" + + # Internal parent network - required for untrusted network to anchor the VLANs + shared_perimeta_int_untrusted_parent_net_0: + type: OS::Neutron::Net + properties: + name: + str_replace: + template: $VF_NAME_int_untrusted_parent_net + params: + $VF_NAME: { get_param: vnf_name } + + # A subnet is required for untrusted parent network but we just use arbitrary IP addresses + # as these will never be used to route traffic. + shared_perimeta_int_untrusted_parent_net_0_subnet: + type: OS::Neutron::Subnet + depends_on: [ shared_perimeta_int_untrusted_parent_net_0 ] + properties: + network: { get_resource: shared_perimeta_int_untrusted_parent_net_0 } + cidr: "11.0.0.0/24" + ip_version: 4 + enable_dhcp: false + gateway_ip: "" + +outputs: + + shared_perimeta_ssc_server_group: + description: Perimeta SSC Server group + value: { get_resource: shared_perimeta_ssc_server_gp} + + + shared_perimeta_rtp_msc_server_groups: + description: Perimeta RTP MSC Server groups + value: { list_join: [ ',' , { get_attr: [shared_perimeta_rtp_msc_server_gps, refs ] } ] } + + shared_perimeta_keypair: + description: SSH keypair for deployment + value: { get_resource: shared_perimeta_keypair } + + shared_perimeta_sec_groups: + description: List of security groups to use for all network interfaces + value: { get_resource: shared_perimeta_rsg } + + shared_int_ha_net_id: + description: HA internal network for deployment + value: { get_resource: shared_perimeta_internal_ha_net_0 } + + shared_int_ha_net_prefix_len_v4: + description: HA internal network IPv4 prefix length + value: { get_param: perimeta_int_ha_net_prefix_len_v4 } + + shared_ssc_unused_net_id: + description: Unused internal network for deployment + value: { get_resource: shared_perimeta_unused_net_0 } + + shared_int_untrusted_parent_net_id: + description: Internal untrusted parent network for deployment + value: { get_resource: shared_perimeta_int_untrusted_parent_net_0 } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/custom.ini b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/custom.ini new file mode 100644 index 0000000000..1d18c706f9 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/custom.ini @@ -0,0 +1,21 @@ +;****************************************************************************** +;* Perimeta Custom Initialization File. * +;* * +;* ***** IMPORTANT ***** * +;* * +;* Background: * +;* - This file is maintained across Software Upgrade. * +;* - The format is similar to nbase.ini but it is only for parameters that * +;* are read by NBB_GET_CUSTOM_INT_INT/STRING(). * +;* - Comments begin with the character ';' * +;* * +;* To make a change to this file: * +;* - Edit only the copy in /opt/MetaSwitch/init. * +;* - After editing, run mslu_config_change to backup this file. * +;* - Repeat the above two bullets on the other controller. * +;* * +;****************************************************************************** +; Set max_dlow_pairs to limit the number of flowpairs supported by an MSC or +; ISC. This actually counts in unidirectional flows, so to limit to say +; 100 flowpairs, then you would set the limit to 200 +mpf_max_flow_pairs=10000 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_a.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_a.env new file mode 100644 index 0000000000..9c0153efaa --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_a.env @@ -0,0 +1,208 @@ +# Environment file for instantiating +# - 1 x HA SSC pair - A instance +# +# During initial instantiation, the Perimeta A instance is configured with +# minimal configuration, commissioned as an SSC and started. In addition, it +# will attempt partnering with the B instance when it becomes availble. +# +# During healing, the Perimeta A instance is only configured with sufficient +# configuration to allow partnering from the B instance (which will complete +# the configuration). +# +# This template assumes that a base template stack has previously been +# created so that deployment wide resources such as server-groups have been +# defined. +# + +parameters: + # + # General VNF parameters + # + # Unique VNF name + #vnf_name: tsbc0002 + # ID of VNF + #vnf_id: ibcx0002 + # Unique ID for this VF Module instance + #vf_module_id: ibcx + # Availability zone for A instances. + #availability_zone_0: DPA3_D2_AZ1 + # + # Shared parameters from base template + # + # Internal HA network UUID + #shared_int_ha_net_id: "c8994bb0-9dbd-43e7-a8f9-658c54e35d23" + # Internal HA network IPv4 prefix length + #shared_int_ha_net_prefix_len_v4: 26 + # Keypair UUID + #shared_perimeta_keypair: "atttest_key_pair" + # List of security groups to use for all interfaces + #shared_perimeta_sec_groups: [ "2412dd6a-d784-40a5-a195-7a7da2349178" ] + # Anti-affinity server groups to use for SSCs + #shared_perimeta_ssc_server_group: "308e8e5b-fac5-4964-b86c-47d8b439fe44" + # Unused network parameters + #shared_ssc_unused_net_id: "dd410626-5658-445c-8f97-1142e2d521ab" + + # + # SSC parameters + # + # Flavor to use for creating SSC VM instance + ssc_flavor_name: gv.c8r16d160 + # Glance image to use for launching SSC Perimeta instances. + ssc_image_name: ISBC_SBC_v4.0.40_SU12.qcow2 + + + # VNFC of the SSC VIP + #ssc_vnfcname_0: ibcx0002vm001ssc001pair + # VNFCs of the servers + #ssc_a_vnfcname_0: ibcx0002vm001ssc001 + #ssc_b_vnfcname_0: ibcx0002vm002ssc001 + + # Name of VM A of SSC + #ssc_a_name_0: ibcx0002vm001 + + # + # HA network parameters + # + # HA fixed IPv4 address to use for SSC A. + #ssc_a_int_ha_ip_0: 172.26.1.4 + # HA fixed IPv4 address to use for SSC B. + #ssc_b_int_ha_ip_0: 172.26.1.5 + + # + # Management network parameters + # + # Management network ID + #mgmt_net_id: 4b5621b0-4ca4-4ea0-8511-860318c4fc3b + # Management network prefix length + #mgmt_net_plen: 26 + # Default gateway for management network + #mgmt_net_default_gateway: 135.144.188.131 + # Management virtual IPv4 address to use for SSC. + #ssc_mgmt_vip_0: 135.144.188.133 + # Management fixed IPv4 address to use for SSC A. + #ssc_a_mgmt_ip_0: 135.144.188.132 + # Management fixed IPv4 address to use for SSC B. + #ssc_b_mgmt_ip_0: 135.144.188.136 + + # + # Trusted/core network parameters + # + # Network ID of Trusted/core network. + #trusted_net_id: 3d584971-4ec6-408c-92fe-3073666fbcb9 + # Virtual IPv4 address on Trusted/core network for SSC. + #ssc_trusted_vip_0: 10.1.1.5 + # Fixed IPv4 address on Trusted/core network for SSC A. + #ssc_a_trusted_ip_0: 10.1.1.4 + + # + # Untrusted/access network parameters + # + # Using VLANs on Untrusted/access + #shared_int_untrusted_parent_net_id: a0ddd409-f6a7-465a-a091-827a12402252 + # Virtual IPv4 address on Untrusted/access parent network for SSC. + #ssc_untrusted_parent_vip_0: 11.0.0.6 + # Fixed IPv4 address on Untrusted/access parent network for SSC A. + #ssc_a_untrusted_parent_ip_0: 11.0.0.4 + + #perimeta_untrusted_num_vlans: 5 + #perimeta_untrusted_vlan_ids: ["81", "1001", "1002", "1003", "1004"] + #perimeta_untrusted_vlan_networks: [95c74fbb-0650-4ac2-bd4f-7b4fb50b4b5d,aa1a5096-61fd-421b-a74b-0b4a72c47856,ced72584-9c09-4d67-9b9f-8faf4c081c45,6311c9db-c4ba-41f5-85e5-4a3cc85d7f55,79391429-9c52-44f5-b9a9-4547fec0e9d4] + + + + # Virtual IPv4 address on Untrusted/access network for SSC. + #ssc_untrusted_vip_0: 12.121.106.133 + # Virtual IPv6 address on Untrusted/access network for SSC. + #ssc_untrusted_v6_vip_0: 2001:1890:1001:2B38::2D:2 + # Fixed IPv4 address on Untrusted/access network for SSC A. + #ssc_a_untrusted_ip_0: 12.121.106.132 + # Fixed IPv6 address on Untrusted/access network for SSC A. + #ssc_a_untrusted_v6_ip_0: 2001:1890:1001:2B38::2D:1 + + # + # management/Rf network parameters + # + # Virtual IPv4 address on management/Rf network for SSC. + #ssc_rf_vip_0: 135.144.188.135 + # Fixed IPv4 address on management/Rf network for SSC A. + #ssc_a_rf_ip_0: 135.144.188.134 + + # + # A side healing / instantiation parameters + # + # + # Healing or instantiation? This is used to ensure that the json file passed + # to the VF is correct for the operation being carried out. + # This parameter must be set to one of the following values + # - single whitespace character + # - the string // not required for healing + # Simply uncomment the required value from the pair below + # + # Note that we need to do this because we cannot parmeterize the file name + # passed to get_file (which would be the more obvious way to do this) + # + # Uncomment for instantiation, comment for healing + ssc_a_json_prefix: " " + # Uncomment for healing, comment for instantiation + # ssc_a_json_prefix: "// healing, not required " + + # Orchestrating a perimeta version 41 or above. Used to ensure that the + # tags in the json file are supported by the version of perimeta that is + # being instantiated. + # This parameter must be set to one of the following values + # - single whitespace character + # - the string // older perimeta, parameter not required + # Simply uncomment the required value from the pair below + # + # Note that we need to do this because we cannot parmeterize the file name + # passed to get_file (which would be the more obvious way to do this) + # + # + # Uncomment for V4.1.00 or above, comment for V4.0.40 + ssc_json_v41: " " + # Uncomment for V4.0.40, comment for V4.1.00 or above + # ssc_json_v41: "// older perimeta, parameter not required " + + # Using Radius for user account authentication? Used to ensure that the json + # file is configured correctly depending on whether we are using Radius or + # local authentication + # + # This parameter must be set to one of the following values + # - single whitespace character + # - the string // older perimeta, parameter not required + # Simply uncomment the required value from the pair below + # + # Note that we need to do this because we cannot parmeterize the file name + # passed to get_file (which would be the more obvious way to do this) + # + # Uncomment for Local authentication + #ssc_json_use_radius_authentication: "// not using Radius " + # Uncomment for Radius authentication + ## ssc_json_use_radius_authentication: " " + + # + # Radius server parameters + # + # + # IP Address or hostname of RADIUS Server. + # Value is ignored if RADIUS is not being used but it still must be set + #ssc_json_radius_servername: "192.0.0.1" + # Radius Server port configuration - value between 0 and 65535 + # Normal Radius Server port is 1812 + # Value is ignored if RADIUS is not being used but it still must be set + #ssc_json_radius_port: 1812 + # Radius Server shared secret + # Value is ignored if RADIUS is not being used but it still must be set + #ssc_json_radius_secret: "TopSecret" + # Radius Server connection timeout - value between 1 and 60 + # Value is ignored if RADIUS is not being used but it still must be set + #ssc_json_radius_timeout: 3 + # Radius Server default user authentication level. + # must be set to one of 'no-access', 'read-only', 'support', 'restricted-admin' or 'admin' + # Value is ignored if RADIUS is not being used but it still must be set + #ssc_json_radius_default: "no-access" + + # + # NTP server IPv4 addresses, separated by commas. These must be accessible from the management network + # + #ntp_server_ip_addrs: 132.201.84.13,155.179.58.11,155.179.59.249,155.179.82.25 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_a.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_a.yaml new file mode 100644 index 0000000000..ace080e7e7 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_a.yaml @@ -0,0 +1,322 @@ +# Template for instantiating +# - 1 x HA SSC pair - A instance +# +# During initial instantiation, the Perimeta A instance is configured with +# minimal configuration, commissioned as an SSC and started. In addition, it +# will attempt partnering with the B instance when it becomes availble. +# +# During healing, the Perimeta A instance is only configured with sufficient +# configuration to allow partnering from the B instance (which will complete +# the configuration). +# +# This template assumes that a base template stack has previously been +# created so that deployment wide resources such as server-groups have been +# defined. +# +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate an A side Perimeta SSC and optionally partner it with the corresponding B side + +parameters: + # General VNF parameters + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: ID of VNF + vf_module_id: + type: string + description: Unique ID for this VF Module instance + # Availability zones + availability_zone_0: + type: string + description: Availability zone for A instances. + shared_perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + shared_perimeta_sec_groups: + type: comma_delimited_list + description: List of security groups to add on all interfaces. + shared_perimeta_ssc_server_group: + type: string + description: Server group to use for these VMs + # Internal network parameters + shared_int_ha_net_id: + type: string + description: HA network id + constraints: + - custom_constraint: neutron.network + + # Constraint below is copied from base module + shared_int_ha_net_prefix_len_v4: + type: number + description: Prefix length of subnet associated with internal HA network + constraints: + - range: { min: 0, max: 31 } + description: shared_int_ha_net_prefix_len_v4 must be between 0 and 31 + # Unused network parameters + # + # This is used for connecting the unused 4th SSC service interface. + shared_ssc_unused_net_id: + type: string + description: Unused network ID + # Management network parameters + mgmt_net_id: + type: string + description: Management network ID + constraints: + - custom_constraint: neutron.network + mgmt_net_plen: + type: number + description: Management network prefix length + constraints: + - range: { min: 0, max: 32 } + description: mgmt_net_plen must be between 0 and 32 + mgmt_net_default_gateway: + type: string + description: Default gateway for management network + # Trusted/core network parameters + trusted_net_id: + type: string + description: Network ID of Trusted/core network. + constraints: + - custom_constraint: neutron.network + # untrusted parent network parameters + shared_int_untrusted_parent_net_id: + type: string + description: untrusted parent network id + # SSC IP addresses on Untrusted/access parent network + ssc_untrusted_parent_vip_0: + type: string + description: Virtual IPv4 address on Untrusted/access parent network for SSC. + ssc_a_untrusted_parent_ip_0: + type: string + description: Fixed IPv4 address on Untrusted/access parent network for SSC A. + perimeta_untrusted_num_vlans: + type: number + description: number of VLANs to connect to the untrusted/access interface + constraints: + - range: { min: 1, max: 1001 } + description: perimeta_untrusted_num_vlans (number of VLANs to connect to the untrusted/access interface) must be between 1 and 1001 + perimeta_untrusted_vlan_ids: + type: comma_delimited_list + description: List of VLAN IDs to use on the untrusted/access network + perimeta_untrusted_vlan_networks: + type: comma_delimited_list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + # SSC parameters + ssc_flavor_name: + type: string + description: Flavor to use for creating SSC VM instance + constraints: + - custom_constraint: nova.flavor + ssc_image_name: + type: string + description: Glance image to use for launching SSC Perimeta instances. + constraints: + - custom_constraint: glance.image + # Hostames of the VIP and servers + ssc_vnfcname_0: + type: string + description: Name of vnfc of SSC. This is the name associated with the perimeta pair and corresponds to the VIP + constraints: + - allowed_pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,31}$' + description: vnfc name must be 32 characters or less and a valid hostname. Only alphanumeric characters plus hyphen are allowed. + ssc_a_vnfcname_0: + type: string + description: vnfc name of VM A of SSC + constraints: + - allowed_pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,31}$' + description: vnfc name must be 32 characters or less and a valid hostname. Only alphanumeric characters plus hyphen are allowed. + ssc_b_vnfcname_0: + type: string + description: vnfc name of VM B of SSC + constraints: + - allowed_pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,31}$' + description: vnfc name must be 32 characters or less and a valid hostname. Only alphanumeric characters plus hyphen are allowed. + # SSC names of the physical A instance + ssc_a_name_0: + type: string + description: Name of VM A of SSC + constraints: + - allowed_pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,29}$' + description: VM name must be 30 characters or less. Only alphanumeric characters plus hyphen are allowed. + # SSC IP addresses on management network + ssc_mgmt_vip_0: + type: string + description: Management virtual IP address to use for SSC. + ssc_a_mgmt_ip_0: + type: string + description: Management fixed IP address to use for SSC A. + ssc_b_mgmt_ip_0: + type: string + description: Management fixed IP address to use for SSC B. + # SSC IP addresses on internal HA network + ssc_a_int_ha_ip_0: + type: string + description: HA fixed IP address to use for SSC A. + ssc_b_int_ha_ip_0: + type: string + description: HA fixed IP address to use for SSC B. + # SSC IP addresses on Trusted/core network + ssc_trusted_vip_0: + type: string + description: Virtual IPv4 address on Trusted/core network for SSC. + ssc_a_trusted_ip_0: + type: string + description: Fixed IPv4 address on Trusted/core network for SSC A. + # SSC IP addresses on Untrusted/access network + ssc_untrusted_vip_0: + type: string + description: Virtual IPv4 address on Untrusted/access network for SSC. + ssc_untrusted_v6_vip_0: + type: string + description: Virtual IPv6 address on Untrusted/access network for SSC. + ssc_a_untrusted_ip_0: + type: string + description: Fixed IPv4 address on Untrusted/access network for SSC A. + ssc_a_untrusted_v6_ip_0: + type: string + description: Fixed IPv6 address on Untrusted/access network for SSC A. + # + # RF virtual IPv4 address on management/Rf network for SSC. + # + ssc_rf_vip_0: + type: string + description: RF virtual IP address to use for SSC. + + ssc_a_rf_ip_0: + type: string + description: RF fixed IP address to use for SSC A. + ntp_server_ip_addrs: + type: string + description: NTP server IPv4 addresses, separated by commas. These must be accessible from the management network + constraints: + - allowed_pattern: "((?:\\d{1,3}\\.){3}\\d{1,3},)*((?:\\d{1,3}\\.){3}\\d{1,3})" + description: ntp_server_ip_addrs must be a comma separated list of IPv4 addresses (with no spaces) + # Healing or instantiating? Used to build the correct json file + ssc_a_json_prefix: + type: string + description: Json prefix, used to create the correct json file depending on the operation being performed + constraints: + - allowed_values: + - " " + - "// healing, not required " + description: ssc_a_json_prefix must be set to ' ' or '// healing, not required ' + # Running V4.1 perimeta or greater. Used to ensure that newer json tags are + # not included if the server will not recognize them + ssc_json_v41: + type: string + description: Json prefix, used to ensure that the json tags will be recognised by the server loading them + constraints: + - allowed_values: + - " " + - "// older perimeta, parameter not required " + description: ssc_json_v41 must be set to ' ' or '// older perimeta, parameter not required ' + # Use Radius for user account authentication. + ssc_json_use_radius_authentication: + type: string + description: Json prefix, used to indicate if user account authentication is done externally through Radius + constraints: + - allowed_values: + - " " + - "// not using Radius " + description: ssc_json_use_radius_authentication must be set to ' ' or '// not using Radius ' + # Radius Server address configuration + ssc_json_radius_servername: + type: string + description: IP Address or hostname of RADIUS server + # Radius Server port configuration + ssc_json_radius_port: + type: number + description: Port to use to connect to RADIUS server + constraints: + - range: { min: 0, max: 65535 } + description: ssc_json_radius_port must be between 0 and 65535 + # Radius Server shared secret + ssc_json_radius_secret: + type: string + description: Shared secret to use for the RADIUS Server + # Radius Server connection timeout + ssc_json_radius_timeout: + type: number + description: Timeout for connect requests to RADIUS server + constraints: + - range: { min: 1, max: 60 } + description: ssc_json_timeout must be between 1 and 60 + # Radius Server default user authentication level + ssc_json_radius_default: + type: string + description: Default authentication level for RADIUS users + constraints: + - allowed_values: + - "no-access" + - "read-only" + - "support" + - "restricted-admin" + - "admin" + description: ssc_json_radius_default must be set to one of 'no-access', 'read-only', 'support', 'restricted-admin' or 'admin' + +resources: + # Perimeta SSC + perimeta_ssc_a: + type: module_1_perimeta_swmu_a_child.yaml + properties: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vm_role: 'ssc' + vf_module_id: { get_param: vf_module_id } + ssc_a_name_0: { get_param: ssc_a_name_0 } + perimeta_image_name: { get_param: ssc_image_name } + perimeta_flavor_name: { get_param: ssc_flavor_name } + perimeta_keypair: { get_param: shared_perimeta_keypair } + availability_zone_0: { get_param: availability_zone_0 } + mgmt_net_id: { get_param: mgmt_net_id } + ssc_mgmt_vip_0: { get_param: ssc_mgmt_vip_0 } + ssc_a_mgmt_ip_0: { get_param: ssc_a_mgmt_ip_0 } + perimeta_sec_groups: { get_param: shared_perimeta_sec_groups } + int_ha_net_id: { get_param: shared_int_ha_net_id } + int_ha_network_plen: { get_param: shared_int_ha_net_prefix_len_v4 } + ssc_a_int_ha_ip_0: { get_param: ssc_a_int_ha_ip_0 } + ssc_b_int_ha_ip_0: { get_param: ssc_b_int_ha_ip_0 } + trusted_net_id: { get_param: trusted_net_id } + ssc_trusted_vip_0: { get_param: ssc_trusted_vip_0 } + ssc_a_trusted_ip_0: { get_param: ssc_a_trusted_ip_0 } + ssc_untrusted_vip_0: { get_param: ssc_untrusted_vip_0 } + ssc_untrusted_v6_vip_0: { get_param: ssc_untrusted_v6_vip_0 } + ssc_a_untrusted_ip_0: { get_param: ssc_a_untrusted_ip_0 } + ssc_a_untrusted_v6_ip_0: { get_param: ssc_a_untrusted_v6_ip_0 } + int_untrusted_parent_net_id: { get_param: shared_int_untrusted_parent_net_id } + ssc_untrusted_parent_vip_0: { get_param: ssc_untrusted_parent_vip_0 } + ssc_a_untrusted_parent_ip_0: { get_param: ssc_a_untrusted_parent_ip_0 } + perimeta_untrusted_num_vlans: { get_param: perimeta_untrusted_num_vlans } + perimeta_untrusted_vlan_ids: { get_param: perimeta_untrusted_vlan_ids } + perimeta_untrusted_vlan_networks: { get_param: perimeta_untrusted_vlan_networks } + perimeta_server_group: { get_param: shared_perimeta_ssc_server_group } + ssc_rf_vip_0: { get_param: ssc_rf_vip_0 } + ssc_a_rf_ip_0: { get_param: ssc_a_rf_ip_0 } + unused_port_net_id: { get_param: shared_ssc_unused_net_id } + perimeta_config: + str_replace: + template: {get_file: ssc_a_template.json} + params: + $HEALING_OR_INSTANTIATION: { get_param: ssc_a_json_prefix } + $NTP_SERVER_IP_ADDRS: { get_param: ntp_server_ip_addrs } + $41ORABOVE: { get_param: ssc_json_v41 } + $USERADIUSAUTH: { get_param: ssc_json_use_radius_authentication } + $RADIUS_SERVERNAME: { get_param: ssc_json_radius_servername } + $RADIUS_PORT: { get_param: ssc_json_radius_port } + $RADIUS_SECRET: { get_param: ssc_json_radius_secret } + $RADIUS_TIMEOUT: { get_param: ssc_json_radius_timeout } + $RADIUS_DEFAULT: { get_param: ssc_json_radius_default } + $LOCAL_MGMT_IP_ADDR: { get_param: ssc_a_mgmt_ip_0 } + $REMOTE_MGMT_IP_ADDR: { get_param: ssc_b_mgmt_ip_0 } + $MGMT_NETWORK_PLEN: { get_param: mgmt_net_plen } + $MGMT_NETWORK_DEFAULT_GATEWAY: { get_param: mgmt_net_default_gateway } + $VIRT_MGMT_IP_ADDR: { get_param: ssc_mgmt_vip_0 } + $VM_NAME_A: { get_param: ssc_a_vnfcname_0 } + $VM_NAME_B: { get_param: ssc_b_vnfcname_0 } + $SYSTEM_NAME: { get_param: ssc_vnfcname_0 } + $COMPLETION_PARAMS: '' diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_b.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_b.env new file mode 100644 index 0000000000..7806bd1692 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_b.env @@ -0,0 +1,115 @@ +# Environment file for instantiating +# - 1 x HA SSC pair - B instance +# +# The Perimeta B instance is only configured with sufficient +# configuration to allow partnering from the A instance (which will complete +# the configuration). +# +# This template assumes that a base template stack has previously been +# created so that deployment wide resources such as server-groups have been +# defined. +# + +parameters: + # + # General VNF parameters + # + # Unique VNF name + #vnf_name: tsbc0002 + # ID of VNF + #vnf_id: ibcx0002 + # Unique ID for this VF Module instance + #vf_module_id: ibcx + # Availability zone for B instances. + #availability_zone_1: DPA3_D2_AZ2 + + # + # Shared parameters from base template + # + # Internal HA network UUID + #shared_int_ha_net_id: "c8994bb0-9dbd-43e7-a8f9-658c54e35d23" + # Internal HA network IPv4 prefix length + #shared_int_ha_net_prefix_len_v4: 26 + # Keypair UUID + #shared_perimeta_keypair: "atttest_key_pair" + # List of security groups to use for all interfaces + #shared_perimeta_sec_groups: [ "2412dd6a-d784-40a5-a195-7a7da2349178" ] + # Anti-affinity server groups to use for SSCs + #shared_perimeta_ssc_server_group: "308e8e5b-fac5-4964-b86c-47d8b439fe44" + # Unused network parameters + #shared_ssc_unused_net_id: "dd410626-5658-445c-8f97-1142e2d521ab" + + # + # SSC parameters + # + # Flavor to use for creating SSC VM instance + ssc_flavor_name: gv.c8r16d160 + # Glance image to use for launching SSC Perimeta instances. + ssc_image_name: ISBC_SBC_v4.0.40_SU12.qcow2 + + + + # Name of VM B of SSC + #ssc_b_name_0: ibcx0002vm002 + + # + # HA network parameters + # + # HA fixed IPv4 address to use for SSC B. + #ssc_b_int_ha_ip_0: 172.26.1.5 + # HA fixed IPv4 address to use for SSC A. + #ssc_a_int_ha_ip_0: 172.26.1.4 + + # + # Management network parameters + # + # Management network ID + #mgmt_net_id: 4b5621b0-4ca4-4ea0-8511-860318c4fc3b + # Management virtual IPv4 address to use for SSC. + #ssc_mgmt_vip_0: 135.144.188.133 + # Management fixed IPv4 address to use for SSC B. + #ssc_b_mgmt_ip_0: 135.144.188.136 + + # + # Trusted/core network parameters + # + # Network ID of Trusted/core network. + #trusted_net_id: 3d584971-4ec6-408c-92fe-3073666fbcb9 + # Virtual IPv4 address on Trusted/core network for SSC. + #ssc_trusted_vip_0: 10.1.1.5 + # Fixed IPv4 address on Trusted/core network for SSC B. + #ssc_b_trusted_ip_0: 10.1.1.6 + + # + # Untrusted/access network parameters + # + # Using VLANs on Untrusted/access + #shared_int_untrusted_parent_net_id: a0ddd409-f6a7-465a-a091-827a12402252 + # Virtual IPv4 address on Untrusted/access parent network for SSC. + #ssc_untrusted_parent_vip_0: 11.0.0.6 + # Fixed IPv4 address on Untrusted/access parent network for SSC B. + #ssc_b_untrusted_parent_ip_0: 11.0.0.5 + + #perimeta_untrusted_num_vlans: 5 + #perimeta_untrusted_vlan_ids: ["81", "1001", "1002", "1003", "1004"] + #perimeta_untrusted_vlan_networks: [95c74fbb-0650-4ac2-bd4f-7b4fb50b4b5d,aa1a5096-61fd-421b-a74b-0b4a72c47856,ced72584-9c09-4d67-9b9f-8faf4c081c45,6311c9db-c4ba-41f5-85e5-4a3cc85d7f55,79391429-9c52-44f5-b9a9-4547fec0e9d4] + + + + # Virtual IPv4 address on Untrusted/access network for SSC. + #ssc_untrusted_vip_0: 12.121.106.133 + # Virtual IPv6 address on Untrusted/access network for SSC. + #ssc_untrusted_v6_vip_0: 2001:1890:1001:2B38::2D:2 + # Fixed IPv4 address on Untrusted/access network for SSC B. + #ssc_b_untrusted_ip_0: 12.121.106.134 + # Fixed IPv6 address on Untrusted/access network for SSC B. + #ssc_b_untrusted_v6_ip_0: 2001:1890:1001:2B38::2D:3 + + # + # management/Rf network parameters + # + # Virtual IPv4 address on management/Rf network for SSC. + #ssc_rf_vip_0: 135.144.188.135 + # Fixed IPv4 address on management/Rf network for SSC B. + #ssc_b_rf_ip_0: 135.144.188.136 + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_b.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_b.yaml new file mode 100644 index 0000000000..ba2407e533 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_ssc_b.yaml @@ -0,0 +1,197 @@ +# Template for instantiating +# - 1 x HA SSC pair - B instance +# +# The Perimeta B instance is only configured with sufficient +# configuration to allow partnering from the A instance (which will complete +# the configuration). +# +# This template assumes that a base template stack has previously been +# created so that deployment wide resources such as server-groups have been +# defined. +# +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate an B side Perimeta SSC + +parameters: + # General VNF parameters + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: ID of VNF + vf_module_id: + type: string + description: Unique ID for this VF Module instance + # Availability zones + availability_zone_1: + type: string + description: Availability zone for B instances. + shared_perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + shared_perimeta_sec_groups: + type: comma_delimited_list + description: List of security groups to add on all interfaces. + shared_perimeta_ssc_server_group: + type: string + description: Server group to use for these VMs + # Internal network parameters + shared_int_ha_net_id: + type: string + description: HA network id + constraints: + - custom_constraint: neutron.network + + # Constraint below is copied from base module + shared_int_ha_net_prefix_len_v4: + type: number + description: Prefix length of subnet associated with internal HA network + constraints: + - range: { min: 0, max: 31 } + description: shared_int_ha_net_prefix_len_v4 must be between 0 and 31 + # Unused network parameters + # + # This is used for connecting the unused 4th SSC service interface. + shared_ssc_unused_net_id: + type: string + description: Unused network ID + # Management network parameters + mgmt_net_id: + type: string + description: Management network ID + constraints: + - custom_constraint: neutron.network + # Trusted/core network parameters + trusted_net_id: + type: string + description: Network ID of Trusted/core network. + constraints: + - custom_constraint: neutron.network + # untrusted parent network parameters + shared_int_untrusted_parent_net_id: + type: string + description: untrusted parent network id + # SSC IP addresses on Untrusted/access parent network + ssc_untrusted_parent_vip_0: + type: string + description: Virtual IPv4 address on Untrusted/access parent network for SSC. + ssc_b_untrusted_parent_ip_0: + type: string + description: Fixed IPv4 address on Untrusted/access parent network for SSC B. + perimeta_untrusted_num_vlans: + type: number + description: number of VLANs to connect to the untrusted/access interface + constraints: + - range: { min: 1, max: 1001 } + description: perimeta_untrusted_num_vlans (number of VLANs to connect to the untrusted/access interface) must be between 1 and 1001 + perimeta_untrusted_vlan_ids: + type: comma_delimited_list + description: List of VLAN IDs to use on the untrusted/access network + perimeta_untrusted_vlan_networks: + type: comma_delimited_list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + # SSC parameters + ssc_flavor_name: + type: string + description: Flavor to use for creating SSC VM instance + constraints: + - custom_constraint: nova.flavor + ssc_image_name: + type: string + description: Glance image to use for launching SSC Perimeta instances. + constraints: + - custom_constraint: glance.image + # SSC names of the physical B instance + ssc_b_name_0: + type: string + description: Name of VM B of SSC + constraints: + - allowed_pattern: '[a-zA-Z0-9][a-zA-Z0-9-]{0,29}$' + description: VM name must be 30 characters or less. Only alphanumeric characters plus hyphen are allowed. + # SSC IP addresses on management network + ssc_mgmt_vip_0: + type: string + description: Management virtual IP address to use for SSC. + ssc_b_mgmt_ip_0: + type: string + description: Management fixed IP address to use for SSC B. + # SSC IP addresses on internal HA network + ssc_b_int_ha_ip_0: + type: string + description: HA fixed IP address to use for SSC B. + ssc_a_int_ha_ip_0: + type: string + description: HA fixed IP address to use for SSC A. + # SSC IP addresses on Trusted/core network + ssc_trusted_vip_0: + type: string + description: Virtual IPv4 address on Trusted/core network for SSC. + ssc_b_trusted_ip_0: + type: string + description: Fixed IPv4 address on Trusted/core network for SSC B. + # SSC IP addresses on Untrusted/access network + ssc_untrusted_vip_0: + type: string + description: Virtual IPv4 address on Untrusted/access network for SSC. + ssc_untrusted_v6_vip_0: + type: string + description: Virtual IPv6 address on Untrusted/access network for SSC. + ssc_b_untrusted_ip_0: + type: string + description: Fixed IPv4 address on Untrusted/access network for SSC B. + ssc_b_untrusted_v6_ip_0: + type: string + description: Fixed IPv6 address on Untrusted/access network for SSC B. + # + # RF virtual IPv4 address on management/Rf network for SSC. + # + ssc_rf_vip_0: + type: string + description: RF virtual IP address to use for SSC. + + ssc_b_rf_ip_0: + type: string + description: RF fixed IP address to use for SSC B. + +resources: + # Perimeta SSC + perimeta_ssc_b: + type: module_1_perimeta_swmu_b_child.yaml + properties: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vm_role: 'ssc' + vf_module_id: { get_param: vf_module_id } + ssc_b_name_0: { get_param: ssc_b_name_0 } + perimeta_image_name: { get_param: ssc_image_name } + perimeta_flavor_name: { get_param: ssc_flavor_name } + perimeta_keypair: { get_param: shared_perimeta_keypair } + availability_zone_1: { get_param: availability_zone_1 } + mgmt_net_id: { get_param: mgmt_net_id } + ssc_mgmt_vip_0: { get_param: ssc_mgmt_vip_0 } + ssc_b_mgmt_ip_0: { get_param: ssc_b_mgmt_ip_0 } + perimeta_sec_groups: { get_param: shared_perimeta_sec_groups } + int_ha_net_id: { get_param: shared_int_ha_net_id } + int_ha_network_plen: { get_param: shared_int_ha_net_prefix_len_v4 } + ssc_b_int_ha_ip_0: { get_param: ssc_b_int_ha_ip_0 } + ssc_a_int_ha_ip_0: { get_param: ssc_a_int_ha_ip_0 } + trusted_net_id: { get_param: trusted_net_id } + ssc_trusted_vip_0: { get_param: ssc_trusted_vip_0 } + ssc_b_trusted_ip_0: { get_param: ssc_b_trusted_ip_0 } + ssc_untrusted_vip_0: { get_param: ssc_untrusted_vip_0 } + ssc_untrusted_v6_vip_0: { get_param: ssc_untrusted_v6_vip_0 } + ssc_b_untrusted_ip_0: { get_param: ssc_b_untrusted_ip_0 } + ssc_b_untrusted_v6_ip_0: { get_param: ssc_b_untrusted_v6_ip_0 } + int_untrusted_parent_net_id: { get_param: shared_int_untrusted_parent_net_id } + ssc_untrusted_parent_vip_0: { get_param: ssc_untrusted_parent_vip_0 } + ssc_b_untrusted_parent_ip_0: { get_param: ssc_b_untrusted_parent_ip_0 } + perimeta_untrusted_num_vlans: { get_param: perimeta_untrusted_num_vlans } + perimeta_untrusted_vlan_ids: { get_param: perimeta_untrusted_vlan_ids } + perimeta_untrusted_vlan_networks: { get_param: perimeta_untrusted_vlan_networks } + perimeta_server_group: { get_param: shared_perimeta_ssc_server_group } + ssc_rf_vip_0: { get_param: ssc_rf_vip_0 } + ssc_b_rf_ip_0: { get_param: ssc_b_rf_ip_0 } + unused_port_net_id: { get_param: shared_ssc_unused_net_id } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_swmu_a_child.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_swmu_a_child.yaml new file mode 100644 index 0000000000..8be774c1d3 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_swmu_a_child.yaml @@ -0,0 +1,313 @@ +# Heat template which intstantiates an A side Perimeta SSC instance with +# 6 vNICs. +# +# This is designed to be included in a higher level template. +# +# This template puts the Perimeta configuration in place using userdata +# injected via OpenStack's ConfigDrive mechanism. +# +# Host anti-affinity is achieved using different availability zones for +# the Perimeta instance or server group anti-affinity if they are in the +# same availability zone. +# +# Template requires Juno or above and has been tested on Kilo. +# +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate an A side Perimeta SSC instance with 6 vNICs as part of a nested template + +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: VNF ID of this deployment + vm_role: + type: string + description: Role of these VMs + vf_module_id: + type: string + description: Unique ID for this VF Module instance + ssc_a_name_0: + type: string + description: Name of Perimeta VM A instance + perimeta_image_name: + type: string + description: Glance image for Perimeta instance + perimeta_flavor_name: + type: string + description: Flavor to use for creating VM instances + perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + availability_zone_0: + # Can be commented out along with references if always using a single availability zone + type: string + description: Availability zone for A instances. + mgmt_net_id: + type: string + description: Management network id + ssc_mgmt_vip_0: + type: string + description: Management virtual IP address. + ssc_a_mgmt_ip_0: + type: string + description: Fixed IP address to use as management IP of A instance. + int_ha_net_id: + type: string + description: HA network id + int_ha_network_plen: + # Constraint copied from base module + type: number + description: Prefix length of subnet associated with internal HA network + constraints: + - range: { min: 0, max: 31 } + description: int_ha_network_plen must be between 0 and 31 + ssc_a_int_ha_ip_0: + type: string + description: Fixed IP address to use as HA IP of A instance. + ssc_b_int_ha_ip_0: + type: string + description: Fixed IP address to use as HA IPs of B instance. + trusted_net_id: + type: string + description: Trusted/core network UUID + ssc_trusted_vip_0: + type: string + description: Trusted/core virtual IP address. + ssc_a_trusted_ip_0: + type: string + description: Fixed IP address to use as Trusted/core fixed IPs of A instance. + perimeta_sec_groups: + type: comma_delimited_list + description: List of security groups to add on trusted interfaces. + ssc_untrusted_vip_0: + type: string + description: Untrusted/access virtual IP address + ssc_untrusted_v6_vip_0: + type: string + description: Untrusted/access alternate virtual IP address + ssc_a_untrusted_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of A instance. + ssc_a_untrusted_v6_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access alternate fixed IP of A instance. + int_untrusted_parent_net_id: + type: string + description: internal Untrusted/access parent network id + ssc_untrusted_parent_vip_0: + type: string + description: Untrusted/access parent virtual IP address + ssc_a_untrusted_parent_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of A parent instance. + perimeta_untrusted_num_vlans: + # constraint copied from parent module + type: number + description: number of VLANs to connect to the untrusted/access interface + constraints: + - range: { min: 1, max: 1001 } + description: perimeta_untrusted_num_vlans (number of VLANs to connect to the untrusted/access interface) must be between 1 and 1001 + perimeta_untrusted_vlan_ids: + type: comma_delimited_list + description: List of VLAN IDs to use on the untrusted/access network + perimeta_untrusted_vlan_networks: + type: comma_delimited_list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + unused_port_net_id: + type: string + description: Service network unused port network UUID + ssc_rf_vip_0: + type: string + description: RF virtual IP address to use for SSC. + ssc_a_rf_ip_0: + type: string + description: RF fixed IP address to use for SSC A. + perimeta_server_group: + type: string + description: Server group to use for these VMs + perimeta_config: + type: string + description: JSON orchestration template configuration for instance. + +resources: + # Perimeta management ports + perimeta_ssc_a_mgmt_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_0_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_a_name_0 } + network: { get_param: mgmt_net_id } + fixed_ips: + - ip_address: { get_param: ssc_a_mgmt_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: ssc_mgmt_vip_0 } + + # Perimeta HA ports + perimeta_ssc_a_ha_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_ha_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_a_name_0 } + network: { get_param: int_ha_net_id } + fixed_ips: + - ip_address: { get_param: ssc_a_int_ha_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + + # Perimeta Trusted/core service network ports + # + # Dual stack core network + # - if only IPv4 required comment out second entry in fixed_ips and allowed_addess_pairs parameters. + # - if only IPv6 required comment out first entry in fixed_ips and allowed_addess_pairs parameters. + perimeta_ssc_a_trusted_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_trusted_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_a_name_0 } + network: { get_param: trusted_net_id } + fixed_ips: + - ip_address: { get_param: ssc_a_trusted_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: ssc_trusted_vip_0 } + + # Perimeta Untrusted/access service network ports + # VLAN being used on this service interface. + # The parent network port is used to anchor the VLANs and is not used to + # route actual traffic for the service interface. This means that we can + # create a dummy network in the base module and use that instead of the + # real untrusted network + + perimeta_ssc_a_untrusted_parent_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_untrusted_parent_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_a_name_0 } + network: { get_param: int_untrusted_parent_net_id } + fixed_ips: + - ip_address: { get_param: ssc_a_untrusted_parent_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: ssc_untrusted_parent_vip_0 } + + + # Contrail VLAN subinterfaces + perimeta_ssc_a_untrusted_0_vlan_ports: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: perimeta_untrusted_num_vlans } + resource_def: + type: vlan_subinterface_dual.yaml + properties: + perimeta_subinterface_instance_index: "%index%" + perimeta_subinterface_name_prefix: + str_replace: + template: $VNF_NAME_$VM_untrusted_port_vlan + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_a_name_0 } + perimeta_parent_interface: { get_resource: perimeta_ssc_a_untrusted_parent_0_port } + perimeta_mac_address: { get_attr: [ perimeta_ssc_a_untrusted_parent_0_port, mac_address ] } + perimeta_ip_0: { get_param: ssc_a_untrusted_ip_0 } + perimeta_v6_ip_0: { get_param: ssc_a_untrusted_v6_ip_0 } + perimeta_vip_0: { get_param: ssc_untrusted_vip_0 } + perimeta_v6_vip_0: { get_param: ssc_untrusted_v6_vip_0 } + perimeta_vlan_ids: { get_param: perimeta_untrusted_vlan_ids } + perimeta_vlan_networks: { get_param: perimeta_untrusted_vlan_networks } + + # Perimeta Rf service network ports + # + # This uses the management network and is IPv4 only + perimeta_ssc_a_mgmt_1_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_1_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_a_name_0 } + network: { get_param: mgmt_net_id } + fixed_ips: + - ip_address: { get_param: ssc_a_rf_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: ssc_rf_vip_0 } + + # need the unused port to balance out the NICs + perimeta_ssc_a_unused_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_unused_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_a_name_0 } + network: { get_param: unused_port_net_id } + + # Add any additional service ports here. + + perimeta_ssc_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: ssc_a_name_0 } + image: { get_param: perimeta_image_name } + flavor: { get_param: perimeta_flavor_name } + key_name: { get_param: perimeta_keypair } + scheduler_hints: { group: { get_param: perimeta_server_group } } + metadata: + 'vnf_name': { get_param: vnf_name } + 'vnf_id': { get_param: vnf_id } + 'vm_role': + str_replace: + template: $ROLE_a + params: + $ROLE: { get_param: vm_role } + 'vf_module_id': { get_param: vf_module_id } + 'msw_template_version': '17.07.04 - 2017-09-01' + personality: + '/opt/MetaSwitch/init/custom.ini': { get_file: custom.ini } + networks: + - port: { get_resource: perimeta_ssc_a_mgmt_0_port } + - port: { get_resource: perimeta_ssc_a_ha_0_port } + - port: { get_resource: perimeta_ssc_a_trusted_0_port } + - port: { get_resource: perimeta_ssc_a_untrusted_parent_0_port } + - port: { get_resource: perimeta_ssc_a_mgmt_1_port } + - port: { get_resource: perimeta_ssc_a_unused_0_port } + availability_zone: { get_param: availability_zone_0 } + config_drive: True + user_data_format: RAW + user_data: + str_replace: + template: { get_param: perimeta_config } + params: + $MGMT_MACADDR: { get_attr: [perimeta_ssc_a_mgmt_0_port, mac_address] } + $HA_MACADDR: { get_attr: [perimeta_ssc_a_ha_0_port, mac_address] } + $TRUSTED_MACADDR: { get_attr: [perimeta_ssc_a_trusted_0_port, mac_address] } + $UNTRUSTED_MACADDR: { get_attr: [perimeta_ssc_a_untrusted_parent_0_port, mac_address] } + $SERV3_MACADDR: { get_attr: [perimeta_ssc_a_mgmt_1_port, mac_address] } + $SERV4_MACADDR: { get_attr: [perimeta_ssc_a_unused_0_port, mac_address] } + $LOCAL_HA_IP_ADDR: { get_param: ssc_a_int_ha_ip_0 } + $REMOTE_HA_IP_ADDR: { get_param: ssc_b_int_ha_ip_0 } + $HA_NETWORK_PLEN: { get_param: int_ha_network_plen }
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_swmu_b_child.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_swmu_b_child.yaml new file mode 100644 index 0000000000..a0ac2fe178 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_1_perimeta_swmu_b_child.yaml @@ -0,0 +1,321 @@ +# Heat template which intstantiates an B side Perimeta SSC instance with +# 6 vNICs. +# +# This is designed to be included in a higher level template. +# +# This template puts the Perimeta configuration in place using userdata +# injected via OpenStack's ConfigDrive mechanism. +# +# Host anti-affinity is achieved using different availability zones for +# the Perimeta instance or server group anti-affinity if they are in the +# same availability zone. +# +# Template requires Juno or above and has been tested on Kilo. +# +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate an B side Perimeta SSC instance with 6 vNICs as part of a nested template + +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: VNF ID of this deployment + vm_role: + type: string + description: Role of these VMs + vf_module_id: + type: string + description: Unique ID for this VF Module instance + ssc_b_name_0: + type: string + description: Name of Perimeta VM B instance + perimeta_image_name: + type: string + description: Glance image for Perimeta instance + perimeta_flavor_name: + type: string + description: Flavor to use for creating VM instances + perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + availability_zone_1: + # Can be commented out along with references if always using a single availability zone + type: string + description: Availability zone for B instances. May be the same as A instance. + mgmt_net_id: + type: string + description: Management network id + ssc_mgmt_vip_0: + type: string + description: Management virtual IP address. + ssc_b_mgmt_ip_0: + type: string + description: Fixed IP address to use as management IP of B instance. + int_ha_net_id: + type: string + description: HA network id + int_ha_network_plen: + # Constraint copied from base module + type: number + description: Prefix length of subnet associated with internal HA network + constraints: + - range: { min: 0, max: 31 } + description: int_ha_network_plen must be between 0 and 31 + ssc_b_int_ha_ip_0: + type: string + description: Fixed IP address to use as HA IP of B instance. + ssc_a_int_ha_ip_0: + type: string + description: Fixed IP address to use as HA IPs of A instance. + trusted_net_id: + type: string + description: Trusted/core network UUID + ssc_trusted_vip_0: + type: string + description: Trusted/core virtual IP address. + ssc_b_trusted_ip_0: + type: string + description: Fixed IP address to use as Trusted/core fixed IPs of B instance. + perimeta_sec_groups: + type: comma_delimited_list + description: List of security groups to add on trusted interfaces. + ssc_untrusted_vip_0: + type: string + description: Untrusted/access virtual IP address + ssc_untrusted_v6_vip_0: + type: string + description: Untrusted/access alternate virtual IP address + ssc_b_untrusted_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of B instance. + ssc_b_untrusted_v6_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access alternate fixed IP of B instance. + int_untrusted_parent_net_id: + type: string + description: internal Untrusted/access parent network id + ssc_untrusted_parent_vip_0: + type: string + description: Untrusted/access parent virtual IP address + ssc_b_untrusted_parent_ip_0: + type: string + description: Fixed IP address to use as Untrusted/access fixed IP of B parent instance. + perimeta_untrusted_num_vlans: + # constraint copied from parent module + type: number + description: number of VLANs to connect to the untrusted/access interface + constraints: + - range: { min: 1, max: 1001 } + description: perimeta_untrusted_num_vlans (number of VLANs to connect to the untrusted/access interface) must be between 1 and 1001 + perimeta_untrusted_vlan_ids: + type: comma_delimited_list + description: List of VLAN IDs to use on the untrusted/access network + perimeta_untrusted_vlan_networks: + type: comma_delimited_list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + unused_port_net_id: + type: string + description: Service network unused port network UUID + ssc_rf_vip_0: + type: string + description: RF virtual IP address to use for SSC. + ssc_b_rf_ip_0: + type: string + description: RF fixed IP address to use for SSC B. + perimeta_server_group: + type: string + description: Server group to use for these VMs + +resources: + # Perimeta management ports + perimeta_ssc_b_mgmt_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_0_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_b_name_0 } + network: { get_param: mgmt_net_id } + fixed_ips: + - ip_address: { get_param: ssc_b_mgmt_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: ssc_mgmt_vip_0 } + + # Perimeta HA ports + perimeta_ssc_b_ha_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_ha_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_b_name_0 } + network: { get_param: int_ha_net_id } + fixed_ips: + - ip_address: { get_param: ssc_b_int_ha_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + + # Perimeta Trusted/core service network ports + # + # Dual stack core network + # - if only IPv4 required comment out second entry in fixed_ips and allowed_addess_pairs parameters. + # - if only IPv6 required comment out first entry in fixed_ips and allowed_addess_pairs parameters. + perimeta_ssc_b_trusted_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_trusted_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_b_name_0 } + network: { get_param: trusted_net_id } + fixed_ips: + - ip_address: { get_param: ssc_b_trusted_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: ssc_trusted_vip_0 } + + # Perimeta Untrusted/access service network ports + # VLAN being used on this service interface. + # The parent network port is used to anchor the VLANs and is not used to + # route actual traffic for the service interface. This means that we can + # create a dummy network in the base module and use that instead of the + # real untrusted network + + perimeta_ssc_b_untrusted_parent_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_untrusted_parent_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_b_name_0 } + network: { get_param: int_untrusted_parent_net_id } + fixed_ips: + - ip_address: { get_param: ssc_b_untrusted_parent_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: ssc_untrusted_parent_vip_0 } + + + # Contrail VLAN subinterfaces + perimeta_ssc_b_untrusted_0_vlan_ports: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: perimeta_untrusted_num_vlans } + resource_def: + type: vlan_subinterface_dual.yaml + properties: + perimeta_subinterface_instance_index: "%index%" + perimeta_subinterface_name_prefix: + str_replace: + template: $VNF_NAME_$VM_untrusted_port_vlan + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_b_name_0 } + perimeta_parent_interface: { get_resource: perimeta_ssc_b_untrusted_parent_0_port } + perimeta_mac_address: { get_attr: [ perimeta_ssc_b_untrusted_parent_0_port, mac_address ] } + perimeta_ip_0: { get_param: ssc_b_untrusted_ip_0 } + perimeta_v6_ip_0: { get_param: ssc_b_untrusted_v6_ip_0 } + perimeta_vip_0: { get_param: ssc_untrusted_vip_0 } + perimeta_v6_vip_0: { get_param: ssc_untrusted_v6_vip_0 } + perimeta_vlan_ids: { get_param: perimeta_untrusted_vlan_ids } + perimeta_vlan_networks: { get_param: perimeta_untrusted_vlan_networks } + + # Perimeta Rf service network ports + # + # This uses the management network and is IPv4 only + perimeta_ssc_b_mgmt_1_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_1_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_b_name_0 } + network: { get_param: mgmt_net_id } + fixed_ips: + - ip_address: { get_param: ssc_b_rf_ip_0 } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: ssc_rf_vip_0 } + + # need the unused port to balance out the NICs + perimeta_ssc_b_unused_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_unused_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: ssc_b_name_0 } + network: { get_param: unused_port_net_id } + + # Add any additional service ports here. + + perimeta_ssc_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: ssc_b_name_0 } + image: { get_param: perimeta_image_name } + flavor: { get_param: perimeta_flavor_name } + key_name: { get_param: perimeta_keypair } + scheduler_hints: { group: { get_param: perimeta_server_group } } + metadata: + 'vnf_name': { get_param: vnf_name } + 'vnf_id': { get_param: vnf_id } + 'vm_role': + str_replace: + template: $ROLE_b + params: + $ROLE: { get_param: vm_role } + 'vf_module_id': { get_param: vf_module_id } + 'msw_template_version': '17.07.04 - 2017-09-01' + networks: + - port: { get_resource: perimeta_ssc_b_mgmt_0_port } + - port: { get_resource: perimeta_ssc_b_ha_0_port } + - port: { get_resource: perimeta_ssc_b_trusted_0_port } + - port: { get_resource: perimeta_ssc_b_untrusted_parent_0_port } + - port: { get_resource: perimeta_ssc_b_mgmt_1_port } + - port: { get_resource: perimeta_ssc_b_unused_0_port } + availability_zone: { get_param: availability_zone_1 } + config_drive: True + user_data_format: RAW + user_data: + str_replace: + template: | + { + "vnic_assignment": { + "IBG1mgmt": {"mac": "$MGMT_MACADDR"}, + "IPG1": {"mac": "$HA_MACADDR"}, + "RPG1": {"mac": "$TRUSTED_MACADDR"}, + "RPG2": {"mac": "$UNTRUSTED_MACADDR"}, + "RPG3": {"mac": "$SERV3_MACADDR"}, + "RPG4": {"mac": "$SERV4_MACADDR"} + }, + "ip_ha_local": "$LOCAL_HA_IP_ADDR", + "ip_ha_remote": "$REMOTE_HA_IP_ADDR", + "ip_ha_plen": "$HA_NETWORK_PLEN" + } + params: + $MGMT_MACADDR: { get_attr: [perimeta_ssc_b_mgmt_0_port, mac_address] } + $HA_MACADDR: { get_attr: [perimeta_ssc_b_ha_0_port, mac_address] } + $TRUSTED_MACADDR: { get_attr: [perimeta_ssc_b_trusted_0_port, mac_address] } + $UNTRUSTED_MACADDR: { get_attr: [perimeta_ssc_b_untrusted_parent_0_port, mac_address] } + $SERV3_MACADDR: { get_attr: [perimeta_ssc_b_mgmt_1_port, mac_address] } + $SERV4_MACADDR: { get_attr: [perimeta_ssc_b_unused_0_port, mac_address] } + $LOCAL_HA_IP_ADDR: { get_param: ssc_b_int_ha_ip_0 } + $REMOTE_HA_IP_ADDR: { get_param: ssc_a_int_ha_ip_0 } + $HA_NETWORK_PLEN: { get_param: int_ha_network_plen }
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_a.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_a.env new file mode 100644 index 0000000000..015a95f262 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_a.env @@ -0,0 +1,206 @@ +# Environment file for instantiating +# - 1 x HA RTP MSC pair - A instance +# +# During initial instantiation, the Perimeta A instance is configured with +# minimal configuration, commissioned as an RTP MSC and started. In addition, it +# will attempt partnering with the B instance when it becomes availble. +# +# During healing, the Perimeta A instance is only configured with sufficient +# configuration to allow partnering from the B instance (which will complete +# the configuration). +# +# This template assumes that a base template stack has previously been +# created so that deployment wide resources such as server-groups have been +# defined. +# +# A perimeta deployment can support one or more RTP MSCs. The parameter +# rtp_msc_a_index is used to make sure that the appropriate settings for this +# RTP MSC are extracted from the various address and server group arrays. +# + +parameters: + # + # General VNF parameters + # + # Unique VNF name + #vnf_name: tsbc0002 + # ID of VNF + #vnf_id: ibcx0002 + # Unique ID for this VF Module instance + #vf_module_id: ibcx + # Availability zone for A instances. + #availability_zone_0: DPA3_D2_AZ1 + # + # Shared parameters from base template + # + # Internal HA network UUID + #shared_int_ha_net_id: "c8994bb0-9dbd-43e7-a8f9-658c54e35d23" + # Internal HA network IPv4 prefix length + #shared_int_ha_net_prefix_len_v4: 26 + # Keypair UUID + #shared_perimeta_keypair: "atttest_key_pair" + # List of security groups to use for all interfaces + #shared_perimeta_sec_groups: [ "2412dd6a-d784-40a5-a195-7a7da2349178" ] + # Anti-affinity server groups to use for RTP MSCs + #shared_perimeta_rtp_msc_server_groups: ["be4b3fa9-112d-454e-952f-146e45202130","bcdd96eb-b3fc-42ee-9ae8-e13ad0a4f0b8","b293e29f-c101-4b4e-80d6-7a1b4173e4e2","fd791679-6b71-4c3a-b8b7-1d586559976e","98171a69-8956-4ce6-b303-1a15444ee47b","a35ba80b-c0c2-4c29-a9ae-4df26d33323f","2192327a-6a31-43b6-84c4-49abc597b4e6","b2843fa5-9f25-49b0-9dc6-5c1c0472e8d4"] + + # + # RTP MSC parameters + # + # Index of RTP MSC to instantiate / heal. This is used as the index into the + # various address and service group arrays to get the information associated + # with that specific instance + #rtp_msc_a_index: 0 + # Flavor to use for creating RTP MSC VM instance + rtp_msc_flavor_name: gv.c8r16d160 + # Glance image to use for launching RTP MSC Perimeta instances. + rtp_msc_image_name: ISBC_SBC_v4.0.40_SU12.qcow2 + + + # VNFC of the RTP MSC VIP + #rtp_msc_vnfcnames: ["ibcx0002vm003msc001pair","ibcx0002vm005msc001pair","ibcx0002vm007msc001pair","ibcx0002vm009msc001pair","ibcx0002vm011msc001pair","ibcx0002vm013msc001pair","ibcx0002vm015msc001pair","ibcx0002vm017msc001pair"] + # VNFCs of the servers + #rtp_msc_a_vnfcnames: ["ibcx0002vm003msc001","ibcx0002vm005msc001","ibcx0002vm007msc001","ibcx0002vm009msc001","ibcx0002vm011msc001","ibcx0002vm013msc001","ibcx0002vm015msc001","ibcx0002vm017msc001"] + #rtp_msc_b_vnfcnames: ["ibcx0002vm004msc001","ibcx0002vm006msc001","ibcx0002vm008msc001","ibcx0002vm010msc001","ibcx0002vm012msc001","ibcx0002vm014msc001","ibcx0002vm016msc001","ibcx0002vm018msc001"] + + # Name of VM A of RTP MSC + #rtp_msc_a_names: ["ibcx0002vm003","ibcx0002vm005","ibcx0002vm007","ibcx0002vm009","ibcx0002vm011","ibcx0002vm013","ibcx0002vm015","ibcx0002vm017"] + + # + # HA network parameters + # + # HA fixed IPv4 address to use for RTP MSC A. + #rtp_msc_a_int_ha_ips: ["172.26.1.6","172.26.1.8","172.26.1.10","172.26.1.12","172.26.1.14","172.26.1.16","172.26.1.18","172.26.1.20"] + # HA fixed IPv4 address to use for RTP MSC B. + #rtp_msc_b_int_ha_ips: ["172.26.1.7","172.26.1.9","172.26.1.11","172.26.1.13","172.26.1.15","172.26.1.17","172.26.1.19","172.26.1.21"] + + # + # Management network parameters + # + # Management network ID + #mgmt_net_id: 4b5621b0-4ca4-4ea0-8511-860318c4fc3b + # Management network prefix length + #mgmt_net_plen: 26 + # Default gateway for management network + #mgmt_net_default_gateway: 135.144.188.131 + # Management virtual IPv4 address to use for RTP MSC. + #rtp_msc_mgmt_vips: ["135.144.188.139","135.144.188.142","135.144.188.145","135.144.188.148","135.144.188.151","135.144.188.154","135.144.188.157","135.144.188.160"] + # Management fixed IPv4 address to use for RTP MSC A. + #rtp_msc_a_mgmt_ips: ["135.144.188.138","135.144.188.141","135.144.188.144","135.144.188.147","135.144.188.150","135.144.188.153","135.144.188.156","135.144.188.159"] + # Management fixed IPv4 address to use for RTP MSC B. + #rtp_msc_b_mgmt_ips: ["135.144.188.140","135.144.188.143","135.144.188.146","135.144.188.149","135.144.188.152","135.144.188.155","135.144.188.158","135.144.188.161"] + + # + # Trusted/core network parameters + # + # Network ID of Trusted/core network. + #trusted_net_id: 3d584971-4ec6-408c-92fe-3073666fbcb9 + # Virtual IPv4 address on Trusted/core network for RTP MSC. + #rtp_msc_trusted_vips: ["10.1.1.8","10.1.1.11","10.1.1.14","10.1.1.17","10.1.1.20","10.1.1.23","10.1.1.26","10.1.1.29"] + # Fixed IPv4 address on Trusted/core network for RTP MSC A. + #rtp_msc_a_trusted_ips: ["10.1.1.7","10.1.1.10","10.1.1.13","10.1.1.16","10.1.1.19","10.1.1.22","10.1.1.25","10.1.1.28"] + + # + # Untrusted/access network parameters + # + # Using VLANs on Untrusted/access + #shared_int_untrusted_parent_net_id: a0ddd409-f6a7-465a-a091-827a12402252 + # Virtual IPv4 address on Untrusted/access parent network for RTP MSC. + #rtp_msc_untrusted_parent_vips: ["11.0.0.9","11.0.0.12","11.0.0.15","11.0.0.18","11.0.0.21","11.0.0.24","11.0.0.27","11.0.0.30"] + # Fixed IPv4 address on Untrusted/access parent network for RTP MSC A. + #rtp_msc_a_untrusted_parent_ips: ["11.0.0.7","11.0.0.10","11.0.0.13","11.0.0.16","11.0.0.19","11.0.0.22","11.0.0.25","11.0.0.28"] + + #perimeta_untrusted_num_vlans: 5 + #perimeta_untrusted_vlan_ids: ["81", "1001", "1002", "1003", "1004"] + #perimeta_untrusted_vlan_networks: [95c74fbb-0650-4ac2-bd4f-7b4fb50b4b5d,aa1a5096-61fd-421b-a74b-0b4a72c47856,ced72584-9c09-4d67-9b9f-8faf4c081c45,6311c9db-c4ba-41f5-85e5-4a3cc85d7f55,79391429-9c52-44f5-b9a9-4547fec0e9d4] + + + + # Virtual IPv4 address on Untrusted/access network for RTP MSC. + #rtp_msc_untrusted_vips: ["12.121.106.136","12.121.106.139","12.121.106.142","12.121.106.145","12.121.106.148","12.121.106.151","12.121.106.154","12.121.106.157"] + # Virtual IPv6 address on Untrusted/access network for RTP MSC. + #rtp_msc_untrusted_v6_vips: ["2001:1890:1001:2B38::2D:5","2001:1890:1001:2B38::2D:8","2001:1890:1001:2B38::2D:B","2001:1890:1001:2B38::2D:E","2001:1890:1001:2B38::2D:11","2001:1890:1001:2B38::2D:14","2001:1890:1001:2B38::2D:17","2001:1890:1001:2B38::2D:1A"] + # Fixed IPv4 address on Untrusted/access network for RTP MSC A. + #rtp_msc_a_untrusted_ips: ["12.121.106.135","12.121.106.138","12.121.106.141","12.121.106.144","12.121.106.147","12.121.106.150","12.121.106.153","12.121.106.156"] + # Fixed IPv6 address on Untrusted/access network for RTP MSC A. + #rtp_msc_a_untrusted_v6_ips: ["2001:1890:1001:2B38::2D:4","2001:1890:1001:2B38::2D:7","2001:1890:1001:2B38::2D:A","2001:1890:1001:2B38::2D:D","2001:1890:1001:2B38::2D:10","2001:1890:1001:2B38::2D:13","2001:1890:1001:2B38::2D:16","2001:1890:1001:2B38::2D:19"] + + # + # A side healing / instantiation parameters + # + # + # Healing or instantiation? This is used to ensure that the json file passed + # to the VF is correct for the operation being carried out. + # This parameter must be set to one of the following values + # - single whitespace character + # - the string // not required for healing + # Simply uncomment the required value from the pair below + # + # Note that we need to do this because we cannot parmeterize the file name + # passed to get_file (which would be the more obvious way to do this) + # + # Uncomment for instantiation, comment for healing + rtp_msc_a_json_prefix: " " + # Uncomment for healing, comment for instantiation + # rtp_msc_a_json_prefix: "// healing, not required " + + # Orchestrating a perimeta version 41 or above. Used to ensure that the + # tags in the json file are supported by the version of perimeta that is + # being instantiated. + # This parameter must be set to one of the following values + # - single whitespace character + # - the string // older perimeta, parameter not required + # Simply uncomment the required value from the pair below + # + # Note that we need to do this because we cannot parmeterize the file name + # passed to get_file (which would be the more obvious way to do this) + # + # + # Uncomment for V4.1.00 or above, comment for V4.0.40 + rtp_msc_json_v41: " " + # Uncomment for V4.0.40, comment for V4.1.00 or above + # rtp_msc_json_v41: "// older perimeta, parameter not required " + + # Using Radius for user account authentication? Used to ensure that the json + # file is configured correctly depending on whether we are using Radius or + # local authentication + # + # This parameter must be set to one of the following values + # - single whitespace character + # - the string // older perimeta, parameter not required + # Simply uncomment the required value from the pair below + # + # Note that we need to do this because we cannot parmeterize the file name + # passed to get_file (which would be the more obvious way to do this) + # + # Uncomment for Local authentication + #rtp_msc_json_use_radius_authentication: "// not using Radius " + # Uncomment for Radius authentication + ## rtp_msc_json_use_radius_authentication: " " + + # + # Radius server parameters + # + # + # IP Address or hostname of RADIUS Server. + # Value is ignored if RADIUS is not being used but it still must be set + #rtp_msc_json_radius_servername: "192.0.0.1" + # Radius Server port configuration - value between 0 and 65535 + # Normal Radius Server port is 1812 + # Value is ignored if RADIUS is not being used but it still must be set + #rtp_msc_json_radius_port: 1812 + # Radius Server shared secret + # Value is ignored if RADIUS is not being used but it still must be set + #rtp_msc_json_radius_secret: "TopSecret" + # Radius Server connection timeout - value between 1 and 60 + # Value is ignored if RADIUS is not being used but it still must be set + #rtp_msc_json_radius_timeout: 3 + # Radius Server default user authentication level. + # must be set to one of 'no-access', 'read-only', 'support', 'restricted-admin' or 'admin' + # Value is ignored if RADIUS is not being used but it still must be set + #rtp_msc_json_radius_default: "no-access" + + # + # NTP server IPv4 addresses, separated by commas. These must be accessible from the management network + # + #ntp_server_ip_addrs: 132.201.84.13,155.179.58.11,155.179.59.249,155.179.82.25 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_a.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_a.yaml new file mode 100644 index 0000000000..fbadb47a9d --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_a.yaml @@ -0,0 +1,313 @@ +# Template for instantiating +# - 1 x HA RTP MSC pair - A instance +# +# During initial instantiation, the Perimeta A instance is configured with +# minimal configuration, commissioned as an RTP MSC and started. In addition, it +# will attempt partnering with the B instance when it becomes availble. +# +# During healing, the Perimeta A instance is only configured with sufficient +# configuration to allow partnering from the B instance (which will complete +# the configuration). +# +# This template assumes that a base template stack has previously been +# created so that deployment wide resources such as server-groups have been +# defined. +# +# A perimeta deployment can support one or more RTP MSCs. The parameter +# rtp_msc_a_index is used to make sure that the appropriate settings for this +# RTP MSC are extracted from the various address and server group arrays. +# +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate an A side Perimeta RTP MSC and optionally partner it with the corresponding B side + +parameters: + # General VNF parameters + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: ID of VNF + vf_module_id: + type: string + description: Unique ID for this VF Module instance + # Availability zones + availability_zone_0: + type: string + description: Availability zone for A instances. + shared_perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + shared_perimeta_sec_groups: + type: comma_delimited_list + description: List of security groups to add on all interfaces. + shared_perimeta_rtp_msc_server_groups: + type: comma_delimited_list + description: Server group to use for these VMs + # Internal network parameters + shared_int_ha_net_id: + type: string + description: HA network id + constraints: + - custom_constraint: neutron.network + + # Constraint below is copied from base module + shared_int_ha_net_prefix_len_v4: + type: number + description: Prefix length of subnet associated with internal HA network + constraints: + - range: { min: 0, max: 31 } + description: shared_int_ha_net_prefix_len_v4 must be between 0 and 31 + # Management network parameters + mgmt_net_id: + type: string + description: Management network ID + constraints: + - custom_constraint: neutron.network + mgmt_net_plen: + type: number + description: Management network prefix length + constraints: + - range: { min: 0, max: 32 } + description: mgmt_net_plen must be between 0 and 32 + mgmt_net_default_gateway: + type: string + description: Default gateway for management network + # Trusted/core network parameters + trusted_net_id: + type: string + description: Network ID of Trusted/core network. + constraints: + - custom_constraint: neutron.network + # untrusted parent network parameters + shared_int_untrusted_parent_net_id: + type: string + description: untrusted parent network id + # RTP MSC IP addresses on Untrusted/access parent network + rtp_msc_untrusted_parent_vips: + type: comma_delimited_list + description: List of virtual IPv4 addresses on Untrusted/access parent network for RTP MSC. + rtp_msc_a_untrusted_parent_ips: + type: comma_delimited_list + description: List of fixed IPv4 addresses on Untrusted/access parent network for RTP MSC A. + perimeta_untrusted_num_vlans: + type: number + description: number of VLANs to connect to the untrusted/access interface + constraints: + - range: { min: 1, max: 1001 } + description: perimeta_untrusted_num_vlans (number of VLANs to connect to the untrusted/access interface) must be between 1 and 1001 + perimeta_untrusted_vlan_ids: + type: comma_delimited_list + description: List of VLAN IDs to use on the untrusted/access network + perimeta_untrusted_vlan_networks: + type: comma_delimited_list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + # RTP MSC parameters + rtp_msc_flavor_name: + type: string + description: Flavor to use for creating RTP MSC VM instance + constraints: + - custom_constraint: nova.flavor + rtp_msc_image_name: + type: string + description: Glance image to use for launching RTP MSC Perimeta instances. + constraints: + - custom_constraint: glance.image + # Index of the instance to instantiate / heal. This is used to access the + # various address / name / server group arrays to extract the information + # specific to this server. + # + # The constraints need to be co-ordinated with the parameter + # perimeta_max_rtp_msc_count in the base template. Unfortunately we cannot + # use a get_param call to get a constraint so it has to be a number. + # + # We also need to account for the fact that arrays start at zero and we are + # specifying the index in this parameter so the maximum constraint is 1 less + # than the maximum in the base template + rtp_msc_a_index: + type: number + description: Index of RTP MSC to instantiate / heal. + constraints: + - range: { min: 0, max: 19 } + description: rtp_msc_a_index must be between 0 and 19 + # Hostames of the VIP and servers + rtp_msc_vnfcnames: + type: comma_delimited_list + description: List of vnfc names of the RTP MSC. This is the name associated with the perimeta pair and corresponds to the VIP + rtp_msc_a_vnfcnames: + type: comma_delimited_list + description: List of vnfc names of the A of RTP MSC + rtp_msc_b_vnfcnames: + type: comma_delimited_list + description: List of vnfc names of VM B of RTP MSC + # RTP MSC names of the physical A instance + rtp_msc_a_names: + type: comma_delimited_list + description: List of names of VM A of RTP MSC + # RTP MSC IP addresses on management network + rtp_msc_mgmt_vips: + type: comma_delimited_list + description: List of management virtual IP addresses to use for RTP MSC. + rtp_msc_a_mgmt_ips: + type: comma_delimited_list + description: List of management fixed IP addresses to use for RTP MSC A. + rtp_msc_b_mgmt_ips: + type: comma_delimited_list + description: List of management fixed IP addresses to use for RTP MSC B. + # RTP MSC IP addresses on internal HA network + rtp_msc_a_int_ha_ips: + type: comma_delimited_list + description: List of HA fixed IP addresses to use for RTP MSC A. + rtp_msc_b_int_ha_ips: + type: comma_delimited_list + description: List of HA fixed IP addresses to use for RTP MSC B. + # RTP MSC IP addresses on Trusted/core network + rtp_msc_trusted_vips: + type: comma_delimited_list + description: List of virtual IPv4 addresses on Trusted/core network for RTP MSC. + rtp_msc_a_trusted_ips: + type: comma_delimited_list + description: List of fixed IPv4 addresses on Trusted/core network for RTP MSC A. + # RTP MSC IP addresses on Untrusted/access network + rtp_msc_untrusted_vips: + type: comma_delimited_list + description: List of virtual IPv4 addresses on Untrusted/access network for RTP MSC. + rtp_msc_untrusted_v6_vips: + type: comma_delimited_list + description: List of virtual IPv6 addresses on Untrusted/access network for RTP MSC. + rtp_msc_a_untrusted_ips: + type: comma_delimited_list + description: List of fixed IPv4 addresses on Untrusted/access network for RTP MSC A. + rtp_msc_a_untrusted_v6_ips: + type: comma_delimited_list + description: List of fixed IPv6 addresses on Untrusted/access network for RTP MSC A. + ntp_server_ip_addrs: + type: string + description: NTP server IPv4 addresses, separated by commas. These must be accessible from the management network + constraints: + - allowed_pattern: "((?:\\d{1,3}\\.){3}\\d{1,3},)*((?:\\d{1,3}\\.){3}\\d{1,3})" + description: ntp_server_ip_addrs must be a comma separated list of IPv4 addresses (with no spaces) + # Healing or instantiating? Used to build the correct json file + rtp_msc_a_json_prefix: + type: string + description: Json prefix, used to create the correct json file depending on the operation being performed + constraints: + - allowed_values: + - " " + - "// healing, not required " + description: rtp_msc_a_json_prefix must be set to ' ' or '// healing, not required ' + # Running V4.1 perimeta or greater. Used to ensure that newer json tags are + # not included if the server will not recognize them + rtp_msc_json_v41: + type: string + description: Json prefix, used to ensure that the json tags will be recognised by the server loading them + constraints: + - allowed_values: + - " " + - "// older perimeta, parameter not required " + description: rtp_msc_json_v41 must be set to ' ' or '// older perimeta, parameter not required ' + # Use Radius for user account authentication. + rtp_msc_json_use_radius_authentication: + type: string + description: Json prefix, used to indicate if user account authentication is done externally through Radius + constraints: + - allowed_values: + - " " + - "// not using Radius " + description: rtp_msc_json_use_radius_authentication must be set to ' ' or '// not using Radius ' + # Radius Server address configuration + rtp_msc_json_radius_servername: + type: string + description: IP Address or hostname of RADIUS server + # Radius Server port configuration + rtp_msc_json_radius_port: + type: number + description: Port to use to connect to RADIUS server + constraints: + - range: { min: 0, max: 65535 } + description: rtp_msc_json_radius_port must be between 0 and 65535 + # Radius Server shared secret + rtp_msc_json_radius_secret: + type: string + description: Shared secret to use for the RADIUS Server + # Radius Server connection timeout + rtp_msc_json_radius_timeout: + type: number + description: Timeout for connect requests to RADIUS server + constraints: + - range: { min: 1, max: 60 } + description: rtp_msc_json_timeout must be between 1 and 60 + # Radius Server default user authentication level + rtp_msc_json_radius_default: + type: string + description: Default authentication level for RADIUS users + constraints: + - allowed_values: + - "no-access" + - "read-only" + - "support" + - "restricted-admin" + - "admin" + description: rtp_msc_json_radius_default must be set to one of 'no-access', 'read-only', 'support', 'restricted-admin' or 'admin' + +resources: + # Perimeta RTP MSC + perimeta_rtp_msc_a: + type: module_2_perimeta_sw_a_child.yaml + properties: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vm_role: 'msc' + vf_module_id: { get_param: vf_module_id } + rtp_msc_a_names: { get_param: rtp_msc_a_names } + perimeta_instance_index: { get_param: rtp_msc_a_index } + perimeta_image_name: { get_param: rtp_msc_image_name } + perimeta_flavor_name: { get_param: rtp_msc_flavor_name } + perimeta_keypair: { get_param: shared_perimeta_keypair } + availability_zone_0: { get_param: availability_zone_0 } + mgmt_net_id: { get_param: mgmt_net_id } + rtp_msc_mgmt_vips: { get_param: rtp_msc_mgmt_vips } + rtp_msc_a_mgmt_ips: { get_param: rtp_msc_a_mgmt_ips } + perimeta_sec_groups: { get_param: shared_perimeta_sec_groups } + int_ha_net_id: { get_param: shared_int_ha_net_id } + int_ha_network_plen: { get_param: shared_int_ha_net_prefix_len_v4 } + rtp_msc_a_int_ha_ips: { get_param: rtp_msc_a_int_ha_ips } + rtp_msc_b_int_ha_ips: { get_param: rtp_msc_b_int_ha_ips } + trusted_net_id: { get_param: trusted_net_id } + rtp_msc_trusted_vips: { get_param: rtp_msc_trusted_vips } + rtp_msc_a_trusted_ips: { get_param: rtp_msc_a_trusted_ips } + rtp_msc_untrusted_vips: { get_param: rtp_msc_untrusted_vips } + rtp_msc_untrusted_v6_vips: { get_param: rtp_msc_untrusted_v6_vips } + rtp_msc_a_untrusted_ips: { get_param: rtp_msc_a_untrusted_ips } + rtp_msc_a_untrusted_v6_ips: { get_param: rtp_msc_a_untrusted_v6_ips } + int_untrusted_parent_net_id: { get_param: shared_int_untrusted_parent_net_id } + rtp_msc_untrusted_parent_vips: { get_param: rtp_msc_untrusted_parent_vips } + rtp_msc_a_untrusted_parent_ips: { get_param: rtp_msc_a_untrusted_parent_ips } + perimeta_untrusted_num_vlans: { get_param: perimeta_untrusted_num_vlans } + perimeta_untrusted_vlan_ids: { get_param: perimeta_untrusted_vlan_ids } + perimeta_untrusted_vlan_networks: { get_param: perimeta_untrusted_vlan_networks } + perimeta_server_groups: { get_param: shared_perimeta_rtp_msc_server_groups } + perimeta_config: + str_replace: + template: {get_file: rtp_msc_a_template.json} + params: + $HEALING_OR_INSTANTIATION: { get_param: rtp_msc_a_json_prefix } + $NTP_SERVER_IP_ADDRS: { get_param: ntp_server_ip_addrs } + $41ORABOVE: { get_param: rtp_msc_json_v41 } + $USERADIUSAUTH: { get_param: rtp_msc_json_use_radius_authentication } + $RADIUS_SERVERNAME: { get_param: rtp_msc_json_radius_servername } + $RADIUS_PORT: { get_param: rtp_msc_json_radius_port } + $RADIUS_SECRET: { get_param: rtp_msc_json_radius_secret } + $RADIUS_TIMEOUT: { get_param: rtp_msc_json_radius_timeout } + $RADIUS_DEFAULT: { get_param: rtp_msc_json_radius_default } + $LOCAL_MGMT_IP_ADDR: { get_param: [ rtp_msc_a_mgmt_ips, { get_param: rtp_msc_a_index } ] } + $REMOTE_MGMT_IP_ADDR: { get_param: [ rtp_msc_b_mgmt_ips, { get_param: rtp_msc_a_index } ] } + $MGMT_NETWORK_PLEN: { get_param: mgmt_net_plen } + $MGMT_NETWORK_DEFAULT_GATEWAY: { get_param: mgmt_net_default_gateway } + $VIRT_MGMT_IP_ADDR: { get_param: [ rtp_msc_mgmt_vips, { get_param: rtp_msc_a_index } ] } + $VM_NAME_A: { get_param: [ rtp_msc_a_vnfcnames, { get_param: rtp_msc_a_index } ] } + $VM_NAME_B: { get_param: [ rtp_msc_b_vnfcnames, { get_param: rtp_msc_a_index } ] } + $SYSTEM_NAME: { get_param: [ rtp_msc_vnfcnames, { get_param: rtp_msc_a_index } ] } + $COMPLETION_PARAMS: '' diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_b.env b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_b.env new file mode 100644 index 0000000000..0a98f80305 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_b.env @@ -0,0 +1,113 @@ +# Environment file for instantiating +# - 1 x HA RTP MSC pair - B instance +# +# The Perimeta B instance is only configured with sufficient +# configuration to allow partnering from the A instance (which will complete +# the configuration). +# +# This template assumes that a base template stack has previously been +# created so that deployment wide resources such as server-groups have been +# defined. +# +# A perimeta deployment can support one or more RTP MSCs. The parameter +# rtp_msc_b_index is used to make sure that the appropriate settings for this +# RTP MSC are extracted from the various address and server group arrays. +# + +parameters: + # + # General VNF parameters + # + # Unique VNF name + #vnf_name: tsbc0002 + # ID of VNF + #vnf_id: ibcx0002 + # Unique ID for this VF Module instance + #vf_module_id: ibcx + # Availability zone for B instances. + #availability_zone_1: DPA3_D2_AZ2 + + # + # Shared parameters from base template + # + # Internal HA network UUID + #shared_int_ha_net_id: "c8994bb0-9dbd-43e7-a8f9-658c54e35d23" + # Internal HA network IPv4 prefix length + #shared_int_ha_net_prefix_len_v4: 26 + # Keypair UUID + #shared_perimeta_keypair: "atttest_key_pair" + # List of security groups to use for all interfaces + #shared_perimeta_sec_groups: [ "2412dd6a-d784-40a5-a195-7a7da2349178" ] + # Anti-affinity server groups to use for RTP MSCs + #shared_perimeta_rtp_msc_server_groups: ["be4b3fa9-112d-454e-952f-146e45202130","bcdd96eb-b3fc-42ee-9ae8-e13ad0a4f0b8","b293e29f-c101-4b4e-80d6-7a1b4173e4e2","fd791679-6b71-4c3a-b8b7-1d586559976e","98171a69-8956-4ce6-b303-1a15444ee47b","a35ba80b-c0c2-4c29-a9ae-4df26d33323f","2192327a-6a31-43b6-84c4-49abc597b4e6","b2843fa5-9f25-49b0-9dc6-5c1c0472e8d4"] + + # + # RTP MSC parameters + # + # Index of RTP MSC to instantiate / heal. This is used as the index into the + # various address and service group arrays to get the information associated + # with that specific instance + #rtp_msc_b_index: 0 + # Flavor to use for creating RTP MSC VM instance + rtp_msc_flavor_name: gv.c8r16d160 + # Glance image to use for launching RTP MSC Perimeta instances. + rtp_msc_image_name: ISBC_SBC_v4.0.40_SU12.qcow2 + + + + # Name of VM B of RTP MSC + #rtp_msc_b_names: ["ibcx0002vm004","ibcx0002vm006","ibcx0002vm008","ibcx0002vm010","ibcx0002vm012","ibcx0002vm014","ibcx0002vm016","ibcx0002vm018"] + + # + # HA network parameters + # + # HA fixed IPv4 address to use for RTP MSC B. + #rtp_msc_b_int_ha_ips: ["172.26.1.7","172.26.1.9","172.26.1.11","172.26.1.13","172.26.1.15","172.26.1.17","172.26.1.19","172.26.1.21"] + # HA fixed IPv4 address to use for RTP MSC A. + #rtp_msc_a_int_ha_ips: ["172.26.1.6","172.26.1.8","172.26.1.10","172.26.1.12","172.26.1.14","172.26.1.16","172.26.1.18","172.26.1.20"] + + # + # Management network parameters + # + # Management network ID + #mgmt_net_id: 4b5621b0-4ca4-4ea0-8511-860318c4fc3b + # Management virtual IPv4 address to use for RTP MSC. + #rtp_msc_mgmt_vips: ["135.144.188.139","135.144.188.142","135.144.188.145","135.144.188.148","135.144.188.151","135.144.188.154","135.144.188.157","135.144.188.160"] + # Management fixed IPv4 address to use for RTP MSC B. + #rtp_msc_b_mgmt_ips: ["135.144.188.140","135.144.188.143","135.144.188.146","135.144.188.149","135.144.188.152","135.144.188.155","135.144.188.158","135.144.188.161"] + + # + # Trusted/core network parameters + # + # Network ID of Trusted/core network. + #trusted_net_id: 3d584971-4ec6-408c-92fe-3073666fbcb9 + # Virtual IPv4 address on Trusted/core network for RTP MSC. + #rtp_msc_trusted_vips: ["10.1.1.8","10.1.1.11","10.1.1.14","10.1.1.17","10.1.1.20","10.1.1.23","10.1.1.26","10.1.1.29"] + # Fixed IPv4 address on Trusted/core network for RTP MSC B. + #rtp_msc_b_trusted_ips: ["10.1.1.9","10.1.1.12","10.1.1.15","10.1.1.18","10.1.1.21","10.1.1.24","10.1.1.27","10.1.1.30"] + + # + # Untrusted/access network parameters + # + # Using VLANs on Untrusted/access + #shared_int_untrusted_parent_net_id: a0ddd409-f6a7-465a-a091-827a12402252 + # Virtual IPv4 address on Untrusted/access parent network for RTP MSC. + #rtp_msc_untrusted_parent_vips: ["11.0.0.9","11.0.0.12","11.0.0.15","11.0.0.18","11.0.0.21","11.0.0.24","11.0.0.27","11.0.0.30"] + # Fixed IPv4 address on Untrusted/access parent network for RTP MSC B. + #rtp_msc_b_untrusted_parent_ips: ["11.0.0.8","11.0.0.11","11.0.0.14","11.0.0.17","11.0.0.20","11.0.0.23","11.0.0.26","11.0.0.29"] + + #perimeta_untrusted_num_vlans: 5 + #perimeta_untrusted_vlan_ids: ["81", "1001", "1002", "1003", "1004"] + #perimeta_untrusted_vlan_networks: [95c74fbb-0650-4ac2-bd4f-7b4fb50b4b5d,aa1a5096-61fd-421b-a74b-0b4a72c47856,ced72584-9c09-4d67-9b9f-8faf4c081c45,6311c9db-c4ba-41f5-85e5-4a3cc85d7f55,79391429-9c52-44f5-b9a9-4547fec0e9d4] + + + + # Virtual IPv4 address on Untrusted/access network for RTP MSC. + #rtp_msc_untrusted_vips: ["12.121.106.136","12.121.106.139","12.121.106.142","12.121.106.145","12.121.106.148","12.121.106.151","12.121.106.154","12.121.106.157"] + # Virtual IPv6 address on Untrusted/access network for RTP MSC. + #rtp_msc_untrusted_v6_vips: ["2001:1890:1001:2B38::2D:5","2001:1890:1001:2B38::2D:8","2001:1890:1001:2B38::2D:B","2001:1890:1001:2B38::2D:E","2001:1890:1001:2B38::2D:11","2001:1890:1001:2B38::2D:14","2001:1890:1001:2B38::2D:17","2001:1890:1001:2B38::2D:1A"] + # Fixed IPv4 address on Untrusted/access network for RTP MSC B. + #rtp_msc_b_untrusted_ips: ["12.121.106.137","12.121.106.140","12.121.106.143","12.121.106.146","12.121.106.149","12.121.106.152","12.121.106.155","12.121.106.158"] + # Fixed IPv6 address on Untrusted/access network for RTP MSC B. + #rtp_msc_b_untrusted_v6_ips: ["2001:1890:1001:2B38::2D:6","2001:1890:1001:2B38::2D:9","2001:1890:1001:2B38::2D:C","2001:1890:1001:2B38::2D:F","2001:1890:1001:2B38::2D:12","2001:1890:1001:2B38::2D:15","2001:1890:1001:2B38::2D:18","2001:1890:1001:2B38::2D:1B"] + diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_b.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_b.yaml new file mode 100644 index 0000000000..d3866bff77 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_rtp_msc_b.yaml @@ -0,0 +1,197 @@ +# Template for instantiating +# - 1 x HA RTP MSC pair - B instance +# +# The Perimeta B instance is only configured with sufficient +# configuration to allow partnering from the A instance (which will complete +# the configuration). +# +# This template assumes that a base template stack has previously been +# created so that deployment wide resources such as server-groups have been +# defined. +# +# A perimeta deployment can support one or more RTP MSCs. The parameter +# rtp_msc_b_index is used to make sure that the appropriate settings for this +# RTP MSC are extracted from the various address and server group arrays. +# +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate an B side Perimeta RTP MSC + +parameters: + # General VNF parameters + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: ID of VNF + vf_module_id: + type: string + description: Unique ID for this VF Module instance + # Availability zones + availability_zone_1: + type: string + description: Availability zone for B instances. + shared_perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + shared_perimeta_sec_groups: + type: comma_delimited_list + description: List of security groups to add on all interfaces. + shared_perimeta_rtp_msc_server_groups: + type: comma_delimited_list + description: Server group to use for these VMs + # Internal network parameters + shared_int_ha_net_id: + type: string + description: HA network id + constraints: + - custom_constraint: neutron.network + + # Constraint below is copied from base module + shared_int_ha_net_prefix_len_v4: + type: number + description: Prefix length of subnet associated with internal HA network + constraints: + - range: { min: 0, max: 31 } + description: shared_int_ha_net_prefix_len_v4 must be between 0 and 31 + # Management network parameters + mgmt_net_id: + type: string + description: Management network ID + constraints: + - custom_constraint: neutron.network + # Trusted/core network parameters + trusted_net_id: + type: string + description: Network ID of Trusted/core network. + constraints: + - custom_constraint: neutron.network + # untrusted parent network parameters + shared_int_untrusted_parent_net_id: + type: string + description: untrusted parent network id + # RTP MSC IP addresses on Untrusted/access parent network + rtp_msc_untrusted_parent_vips: + type: comma_delimited_list + description: List of virtual IPv4 addresses on Untrusted/access parent network for RTP MSC. + rtp_msc_b_untrusted_parent_ips: + type: comma_delimited_list + description: List of fixed IPv4 addresses on Untrusted/access parent network for RTP MSC B. + perimeta_untrusted_num_vlans: + type: number + description: number of VLANs to connect to the untrusted/access interface + constraints: + - range: { min: 1, max: 1001 } + description: perimeta_untrusted_num_vlans (number of VLANs to connect to the untrusted/access interface) must be between 1 and 1001 + perimeta_untrusted_vlan_ids: + type: comma_delimited_list + description: List of VLAN IDs to use on the untrusted/access network + perimeta_untrusted_vlan_networks: + type: comma_delimited_list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + # RTP MSC parameters + rtp_msc_flavor_name: + type: string + description: Flavor to use for creating RTP MSC VM instance + constraints: + - custom_constraint: nova.flavor + rtp_msc_image_name: + type: string + description: Glance image to use for launching RTP MSC Perimeta instances. + constraints: + - custom_constraint: glance.image + # Index of the instance to instantiate / heal. This is used to access the + # various address / name / server group arrays to extract the information + # specific to this server. + # + # The constraints need to be co-ordinated with the parameter + # perimeta_max_rtp_msc_count in the base template. Unfortunately we cannot + # use a get_param call to get a constraint so it has to be a number. + # + # We also need to account for the fact that arrays start at zero and we are + # specifying the index in this parameter so the maximum constraint is 1 less + # than the maximum in the base template + rtp_msc_b_index: + type: number + description: Index of RTP MSC to instantiate / heal. + constraints: + - range: { min: 0, max: 19 } + description: rtp_msc_b_index must be between 0 and 19 + # RTP MSC names of the physical B instance + rtp_msc_b_names: + type: comma_delimited_list + description: List of names of VM B of RTP MSC + # RTP MSC IP addresses on management network + rtp_msc_mgmt_vips: + type: comma_delimited_list + description: List of management virtual IP addresses to use for RTP MSC. + rtp_msc_b_mgmt_ips: + type: comma_delimited_list + description: List of management fixed IP addresses to use for RTP MSC B. + # RTP MSC IP addresses on internal HA network + rtp_msc_b_int_ha_ips: + type: comma_delimited_list + description: List of HA fixed IP addresses to use for RTP MSC B. + rtp_msc_a_int_ha_ips: + type: comma_delimited_list + description: List of HA fixed IP addresses to use for RTP MSC A. + # RTP MSC IP addresses on Trusted/core network + rtp_msc_trusted_vips: + type: comma_delimited_list + description: List of virtual IPv4 addresses on Trusted/core network for RTP MSC. + rtp_msc_b_trusted_ips: + type: comma_delimited_list + description: List of fixed IPv4 addresses on Trusted/core network for RTP MSC B. + # RTP MSC IP addresses on Untrusted/access network + rtp_msc_untrusted_vips: + type: comma_delimited_list + description: List of virtual IPv4 addresses on Untrusted/access network for RTP MSC. + rtp_msc_untrusted_v6_vips: + type: comma_delimited_list + description: List of virtual IPv6 addresses on Untrusted/access network for RTP MSC. + rtp_msc_b_untrusted_ips: + type: comma_delimited_list + description: List of fixed IPv4 addresses on Untrusted/access network for RTP MSC B. + rtp_msc_b_untrusted_v6_ips: + type: comma_delimited_list + description: List of fixed IPv6 addresses on Untrusted/access network for RTP MSC B. + +resources: + # Perimeta RTP MSC + perimeta_rtp_msc_b: + type: module_2_perimeta_sw_b_child.yaml + properties: + vnf_name: { get_param: vnf_name } + vnf_id: { get_param: vnf_id } + vm_role: 'msc' + vf_module_id: { get_param: vf_module_id } + rtp_msc_b_names: { get_param: rtp_msc_b_names } + perimeta_instance_index: { get_param: rtp_msc_b_index } + perimeta_image_name: { get_param: rtp_msc_image_name } + perimeta_flavor_name: { get_param: rtp_msc_flavor_name } + perimeta_keypair: { get_param: shared_perimeta_keypair } + availability_zone_1: { get_param: availability_zone_1 } + mgmt_net_id: { get_param: mgmt_net_id } + rtp_msc_mgmt_vips: { get_param: rtp_msc_mgmt_vips } + rtp_msc_b_mgmt_ips: { get_param: rtp_msc_b_mgmt_ips } + perimeta_sec_groups: { get_param: shared_perimeta_sec_groups } + int_ha_net_id: { get_param: shared_int_ha_net_id } + int_ha_network_plen: { get_param: shared_int_ha_net_prefix_len_v4 } + rtp_msc_b_int_ha_ips: { get_param: rtp_msc_b_int_ha_ips } + rtp_msc_a_int_ha_ips: { get_param: rtp_msc_a_int_ha_ips } + trusted_net_id: { get_param: trusted_net_id } + rtp_msc_trusted_vips: { get_param: rtp_msc_trusted_vips } + rtp_msc_b_trusted_ips: { get_param: rtp_msc_b_trusted_ips } + rtp_msc_untrusted_vips: { get_param: rtp_msc_untrusted_vips } + rtp_msc_untrusted_v6_vips: { get_param: rtp_msc_untrusted_v6_vips } + rtp_msc_b_untrusted_ips: { get_param: rtp_msc_b_untrusted_ips } + rtp_msc_b_untrusted_v6_ips: { get_param: rtp_msc_b_untrusted_v6_ips } + int_untrusted_parent_net_id: { get_param: shared_int_untrusted_parent_net_id } + rtp_msc_untrusted_parent_vips: { get_param: rtp_msc_untrusted_parent_vips } + rtp_msc_b_untrusted_parent_ips: { get_param: rtp_msc_b_untrusted_parent_ips } + perimeta_untrusted_num_vlans: { get_param: perimeta_untrusted_num_vlans } + perimeta_untrusted_vlan_ids: { get_param: perimeta_untrusted_vlan_ids } + perimeta_untrusted_vlan_networks: { get_param: perimeta_untrusted_vlan_networks } + perimeta_server_groups: { get_param: shared_perimeta_rtp_msc_server_groups } diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_sw_a_child.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_sw_a_child.yaml new file mode 100644 index 0000000000..fdf5b2a662 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_sw_a_child.yaml @@ -0,0 +1,286 @@ +# Heat template which intstantiates an A side Perimeta RTP MSC instance with +# 4 vNICs. +# +# This is designed to be included in a higher level template. +# +# This template puts the Perimeta configuration in place using userdata +# injected via OpenStack's ConfigDrive mechanism. +# +# Host anti-affinity is achieved using different availability zones for +# the Perimeta instance or server group anti-affinity if they are in the +# same availability zone. +# +# Template requires Juno or above and has been tested on Kilo. +# +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate an A side Perimeta RTP MSC instance with 4 vNICs as part of a nested template + +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: VNF ID of this deployment + vm_role: + type: string + description: Role of these VMs + vf_module_id: + type: string + description: Unique ID for this VF Module instance + # Index of the instance to instantiate / heal. This is used to access the + # various address / name / server group arrays to extract the information + # specific to this server. + # + # The constraints need to be co-ordinated with the parameter + # perimeta_max_rtp_msc_count in the base template. Unfortunately we cannot + # use a get_param call to get a constraint so it has to be a number. + # + # We also need to account for the fact that arrays start at zero and we are + # specifying the index in this parameter so the maximum constraint is 1 less + # than the maximum in the base template + perimeta_instance_index: + type: number + description: Index of instance among multiple instances. Use to retrieve correct parameter for this instance when passed all parameters for all instances. + constraints: + - range: { min: 0, max: 19 } + description: perimeta_instance_index must be between 0 and 19 + rtp_msc_a_names: + type: comma_delimited_list + description: List of names of Perimeta VM A instances, indexed by perimeta_instance_index + perimeta_image_name: + type: string + description: Glance image for Perimeta instance + perimeta_flavor_name: + type: string + description: Flavor to use for creating VM instances + perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + availability_zone_0: + # Can be commented out along with references if always using a single availability zone + type: string + description: Availability zone for A instances. + mgmt_net_id: + type: string + description: Management network id + rtp_msc_mgmt_vips: + type: comma_delimited_list + description: List of management virtual IP addresses for all instances. + rtp_msc_a_mgmt_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as management IPs of A instances. + int_ha_net_id: + type: string + description: HA network id + int_ha_network_plen: + # Constraint copied from base module + type: number + description: Prefix length of subnet associated with internal HA network + constraints: + - range: { min: 0, max: 31 } + description: int_ha_network_plen must be between 0 and 31 + rtp_msc_a_int_ha_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as HA IPs of A instances. + rtp_msc_b_int_ha_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as HA IPs of B instances. + trusted_net_id: + type: string + description: Trusted/core network UUID + rtp_msc_trusted_vips: + type: comma_delimited_list + description: List of Trusted/core virtual IP addresses for all instances. + rtp_msc_a_trusted_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as Trusted/core fixed IPs of A instances. + perimeta_sec_groups: + type: comma_delimited_list + description: List of security groups to add on trusted interfaces. + rtp_msc_untrusted_vips: + type: comma_delimited_list + description: List of Untrusted/access virtual IP addresses for all instances. + rtp_msc_untrusted_v6_vips: + type: comma_delimited_list + description: List of Untrusted/access alternate virtual IP addresses for all instances. + rtp_msc_a_untrusted_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as Untrusted/access fixed IPs of A instances. + rtp_msc_a_untrusted_v6_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as Untrusted/access alternate fixed IPs of A instances. + int_untrusted_parent_net_id: + type: string + description: internal Untrusted/access parent network id + rtp_msc_untrusted_parent_vips: + type: comma_delimited_list + description: List of Untrusted/access parent virtual IP addresses for all instances. + rtp_msc_a_untrusted_parent_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as Untrusted/access parent fixed IPs of A instances. + perimeta_untrusted_num_vlans: + # constraint copied from parent module + type: number + description: number of VLANs to connect to the untrusted/access interface + constraints: + - range: { min: 1, max: 1001 } + description: perimeta_untrusted_num_vlans (number of VLANs to connect to the untrusted/access interface) must be between 1 and 1001 + perimeta_untrusted_vlan_ids: + type: comma_delimited_list + description: List of VLAN IDs to use on the untrusted/access network + perimeta_untrusted_vlan_networks: + type: comma_delimited_list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + perimeta_server_groups: + type: comma_delimited_list + description: Server groups to use for these VMs + perimeta_config: + type: string + description: JSON orchestration template configuration for instance. + +resources: + # Perimeta management ports + perimeta_rtp_msc_a_mgmt_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_0_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_a_names, { get_param: perimeta_instance_index } ] } + network: { get_param: mgmt_net_id } + fixed_ips: + - ip_address: { get_param: [ rtp_msc_a_mgmt_ips, { get_param: perimeta_instance_index } ] } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: [ rtp_msc_mgmt_vips, { get_param: perimeta_instance_index } ] } + + # Perimeta HA ports + perimeta_rtp_msc_a_ha_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_ha_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_a_names, { get_param: perimeta_instance_index } ] } + network: { get_param: int_ha_net_id } + fixed_ips: + - ip_address: { get_param: [ rtp_msc_a_int_ha_ips, { get_param: perimeta_instance_index } ] } + security_groups: { get_param: perimeta_sec_groups } + + # Perimeta Trusted/core service network ports + # + # Dual stack core network + # - if only IPv4 required comment out second entry in fixed_ips and allowed_addess_pairs parameters. + # - if only IPv6 required comment out first entry in fixed_ips and allowed_addess_pairs parameters. + perimeta_rtp_msc_a_trusted_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_trusted_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_a_names, { get_param: perimeta_instance_index } ] } + network: { get_param: trusted_net_id } + fixed_ips: + - ip_address: { get_param: [ rtp_msc_a_trusted_ips, { get_param: perimeta_instance_index } ] } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: [ rtp_msc_trusted_vips, { get_param: perimeta_instance_index } ] } + + # Perimeta Untrusted/access service network ports + # VLAN being used on this service interface. + # The parent network port is used to anchor the VLANs and is not used to + # route actual traffic for the service interface. This means that we can + # create a dummy network in the base module and use that instead of the + # real untrusted network + + perimeta_rtp_msc_a_untrusted_parent_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_untrusted_parent_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_a_names, { get_param: perimeta_instance_index } ] } + network: { get_param: int_untrusted_parent_net_id } + fixed_ips: + - ip_address: { get_param: [ rtp_msc_a_untrusted_parent_ips, { get_param: perimeta_instance_index } ] } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: [ rtp_msc_untrusted_parent_vips, { get_param: perimeta_instance_index } ] } + + + # Contrail VLAN subinterfaces + perimeta_rtp_msc_a_untrusted_0_vlan_ports: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: perimeta_untrusted_num_vlans } + resource_def: + type: vlan_subinterface_dual.yaml + properties: + perimeta_subinterface_instance_index: "%index%" + perimeta_subinterface_name_prefix: + str_replace: + template: $VNF_NAME_$VM_untrusted_port_vlan + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_a_names, { get_param: perimeta_instance_index } ] } + perimeta_parent_interface: { get_resource: perimeta_rtp_msc_a_untrusted_parent_0_port } + perimeta_mac_address: { get_attr: [ perimeta_rtp_msc_a_untrusted_parent_0_port, mac_address ] } + perimeta_ip_0: { get_param: [ rtp_msc_a_untrusted_ips, { get_param: perimeta_instance_index } ] } + perimeta_v6_ip_0: { get_param: [ rtp_msc_a_untrusted_v6_ips, { get_param: perimeta_instance_index } ] } + perimeta_vip_0: { get_param: [ rtp_msc_untrusted_vips, { get_param: perimeta_instance_index } ] } + perimeta_v6_vip_0: { get_param: [ rtp_msc_untrusted_v6_vips, { get_param: perimeta_instance_index } ] } + perimeta_vlan_ids: { get_param: perimeta_untrusted_vlan_ids } + perimeta_vlan_networks: { get_param: perimeta_untrusted_vlan_networks } + + # Add any additional service ports here. + + perimeta_rtp_msc_a_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [ rtp_msc_a_names, { get_param: perimeta_instance_index } ] } + image: { get_param: perimeta_image_name } + flavor: { get_param: perimeta_flavor_name } + key_name: { get_param: perimeta_keypair } + scheduler_hints: { group: { get_param: [ perimeta_server_groups, { get_param: perimeta_instance_index } ] } } + metadata: + 'vnf_name': { get_param: vnf_name } + 'vnf_id': { get_param: vnf_id } + 'vm_role': + str_replace: + template: $ROLE_a + params: + $ROLE: { get_param: vm_role } + 'vf_module_id': { get_param: vf_module_id } + 'msw_template_version': '17.07.04 - 2017-09-01' + personality: + '/opt/MetaSwitch/init/custom.ini': { get_file: custom.ini } + networks: + - port: { get_resource: perimeta_rtp_msc_a_mgmt_0_port } + - port: { get_resource: perimeta_rtp_msc_a_ha_0_port } + - port: { get_resource: perimeta_rtp_msc_a_trusted_0_port } + - port: { get_resource: perimeta_rtp_msc_a_untrusted_parent_0_port } + availability_zone: { get_param: availability_zone_0 } + config_drive: True + user_data_format: RAW + user_data: + str_replace: + template: { get_param: perimeta_config } + params: + $MGMT_MACADDR: { get_attr: [perimeta_rtp_msc_a_mgmt_0_port, mac_address] } + $HA_MACADDR: { get_attr: [perimeta_rtp_msc_a_ha_0_port, mac_address] } + $TRUSTED_MACADDR: { get_attr: [perimeta_rtp_msc_a_trusted_0_port, mac_address] } + $UNTRUSTED_MACADDR: { get_attr: [perimeta_rtp_msc_a_untrusted_parent_0_port, mac_address] } + $LOCAL_HA_IP_ADDR: { get_param: [ rtp_msc_a_int_ha_ips, { get_param: perimeta_instance_index } ] } + $REMOTE_HA_IP_ADDR: { get_param: [ rtp_msc_b_int_ha_ips, { get_param: perimeta_instance_index } ] } + $HA_NETWORK_PLEN: { get_param: int_ha_network_plen }
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_sw_b_child.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_sw_b_child.yaml new file mode 100644 index 0000000000..3aa1a66ba1 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/module_2_perimeta_sw_b_child.yaml @@ -0,0 +1,292 @@ +# Heat template which intstantiates an B side Perimeta RTP MSC instance with +# 4 vNICs. +# +# This is designed to be included in a higher level template. +# +# This template puts the Perimeta configuration in place using userdata +# injected via OpenStack's ConfigDrive mechanism. +# +# Host anti-affinity is achieved using different availability zones for +# the Perimeta instance or server group anti-affinity if they are in the +# same availability zone. +# +# Template requires Juno or above and has been tested on Kilo. +# +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate an B side Perimeta RTP MSC instance with 4 vNICs as part of a nested template + +parameters: + vnf_name: + type: string + description: Unique name for this VNF instance + vnf_id: + type: string + description: VNF ID of this deployment + vm_role: + type: string + description: Role of these VMs + vf_module_id: + type: string + description: Unique ID for this VF Module instance + # Index of the instance to instantiate / heal. This is used to access the + # various address / name / server group arrays to extract the information + # specific to this server. + # + # The constraints need to be co-ordinated with the parameter + # perimeta_max_rtp_msc_count in the base template. Unfortunately we cannot + # use a get_param call to get a constraint so it has to be a number. + # + # We also need to account for the fact that arrays start at zero and we are + # specifying the index in this parameter so the maximum constraint is 1 less + # than the maximum in the base template + perimeta_instance_index: + type: number + description: Index of instance among multiple instances. Use to retrieve correct parameter for this instance when passed all parameters for all instances. + constraints: + - range: { min: 0, max: 19 } + description: perimeta_instance_index must be between 0 and 19 + rtp_msc_b_names: + type: comma_delimited_list + description: List of names of Perimeta VM B instances, indexed by perimeta_instance_index + perimeta_image_name: + type: string + description: Glance image for Perimeta instance + perimeta_flavor_name: + type: string + description: Flavor to use for creating VM instances + perimeta_keypair: + type: string + description: Keypair to use for accessing this Perimeta instance + availability_zone_1: + # Can be commented out along with references if always using a single availability zone + type: string + description: Availability zone for B instances. May be the same as A instance. + mgmt_net_id: + type: string + description: Management network id + rtp_msc_mgmt_vips: + type: comma_delimited_list + description: List of management virtual IP addresses for all instances. + rtp_msc_b_mgmt_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as management IPs of B instances. + int_ha_net_id: + type: string + description: HA network id + int_ha_network_plen: + # Constraint copied from base module + type: number + description: Prefix length of subnet associated with internal HA network + constraints: + - range: { min: 0, max: 31 } + description: int_ha_network_plen must be between 0 and 31 + rtp_msc_b_int_ha_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as HA IPs of B instances. + rtp_msc_a_int_ha_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as HA IPs of A instances. + trusted_net_id: + type: string + description: Trusted/core network UUID + rtp_msc_trusted_vips: + type: comma_delimited_list + description: List of Trusted/core virtual IP addresses for all instances. + rtp_msc_b_trusted_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as Trusted/core fixed IPs of B instances. + perimeta_sec_groups: + type: comma_delimited_list + description: List of security groups to add on trusted interfaces. + rtp_msc_untrusted_vips: + type: comma_delimited_list + description: List of Untrusted/access virtual IP addresses for all instances. + rtp_msc_untrusted_v6_vips: + type: comma_delimited_list + description: List of Untrusted/access alternate virtual IP addresses for all instances. + rtp_msc_b_untrusted_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as Untrusted/access fixed IPs of B instances. + rtp_msc_b_untrusted_v6_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as Untrusted/access alternate fixed IPs of B instances. + int_untrusted_parent_net_id: + type: string + description: internal Untrusted/access parent network id + rtp_msc_untrusted_parent_vips: + type: comma_delimited_list + description: List of Untrusted/access parent virtual IP addresses for all instances. + rtp_msc_b_untrusted_parent_ips: + type: comma_delimited_list + description: List of fixed IP addresses to use as Untrusted/access parent fixed IPs of B instances. + perimeta_untrusted_num_vlans: + # constraint copied from parent module + type: number + description: number of VLANs to connect to the untrusted/access interface + constraints: + - range: { min: 1, max: 1001 } + description: perimeta_untrusted_num_vlans (number of VLANs to connect to the untrusted/access interface) must be between 1 and 1001 + perimeta_untrusted_vlan_ids: + type: comma_delimited_list + description: List of VLAN IDs to use on the untrusted/access network + perimeta_untrusted_vlan_networks: + type: comma_delimited_list + description: List of Contrail VLAN networks to use on the untrusted/access network. The order and number of these must match the VLAN ID list. + perimeta_server_groups: + type: comma_delimited_list + description: Server groups to use for these VMs + +resources: + # Perimeta management ports + perimeta_rtp_msc_b_mgmt_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_mgmt_0_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_b_names, { get_param: perimeta_instance_index } ] } + network: { get_param: mgmt_net_id } + fixed_ips: + - ip_address: { get_param: [ rtp_msc_b_mgmt_ips, { get_param: perimeta_instance_index } ] } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: [ rtp_msc_mgmt_vips, { get_param: perimeta_instance_index } ] } + + # Perimeta HA ports + perimeta_rtp_msc_b_ha_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_ha_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_b_names, { get_param: perimeta_instance_index } ] } + network: { get_param: int_ha_net_id } + fixed_ips: + - ip_address: { get_param: [ rtp_msc_b_int_ha_ips, { get_param: perimeta_instance_index } ] } + security_groups: { get_param: perimeta_sec_groups } + + # Perimeta Trusted/core service network ports + # + # Dual stack core network + # - if only IPv4 required comment out second entry in fixed_ips and allowed_addess_pairs parameters. + # - if only IPv6 required comment out first entry in fixed_ips and allowed_addess_pairs parameters. + perimeta_rtp_msc_b_trusted_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_trusted_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_b_names, { get_param: perimeta_instance_index } ] } + network: { get_param: trusted_net_id } + fixed_ips: + - ip_address: { get_param: [ rtp_msc_b_trusted_ips, { get_param: perimeta_instance_index } ] } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: [ rtp_msc_trusted_vips, { get_param: perimeta_instance_index } ] } + + # Perimeta Untrusted/access service network ports + # VLAN being used on this service interface. + # The parent network port is used to anchor the VLANs and is not used to + # route actual traffic for the service interface. This means that we can + # create a dummy network in the base module and use that instead of the + # real untrusted network + + perimeta_rtp_msc_b_untrusted_parent_0_port: + type: OS::Neutron::Port + properties: + name: + str_replace: + template: $VNF_NAME_$VM_untrusted_parent_port + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_b_names, { get_param: perimeta_instance_index } ] } + network: { get_param: int_untrusted_parent_net_id } + fixed_ips: + - ip_address: { get_param: [ rtp_msc_b_untrusted_parent_ips, { get_param: perimeta_instance_index } ] } + security_groups: { get_param: perimeta_sec_groups } + allowed_address_pairs: + - ip_address: { get_param: [ rtp_msc_untrusted_parent_vips, { get_param: perimeta_instance_index } ] } + + + # Contrail VLAN subinterfaces + perimeta_rtp_msc_b_untrusted_0_vlan_ports: + type: OS::Heat::ResourceGroup + properties: + count: { get_param: perimeta_untrusted_num_vlans } + resource_def: + type: vlan_subinterface_dual.yaml + properties: + perimeta_subinterface_instance_index: "%index%" + perimeta_subinterface_name_prefix: + str_replace: + template: $VNF_NAME_$VM_untrusted_port_vlan + params: + $VNF_NAME : { get_param: vnf_name } + $VM: { get_param: [ rtp_msc_b_names, { get_param: perimeta_instance_index } ] } + perimeta_parent_interface: { get_resource: perimeta_rtp_msc_b_untrusted_parent_0_port } + perimeta_mac_address: { get_attr: [ perimeta_rtp_msc_b_untrusted_parent_0_port, mac_address ] } + perimeta_ip_0: { get_param: [ rtp_msc_b_untrusted_ips, { get_param: perimeta_instance_index } ] } + perimeta_v6_ip_0: { get_param: [ rtp_msc_b_untrusted_v6_ips, { get_param: perimeta_instance_index } ] } + perimeta_vip_0: { get_param: [ rtp_msc_untrusted_vips, { get_param: perimeta_instance_index } ] } + perimeta_v6_vip_0: { get_param: [ rtp_msc_untrusted_v6_vips, { get_param: perimeta_instance_index } ] } + perimeta_vlan_ids: { get_param: perimeta_untrusted_vlan_ids } + perimeta_vlan_networks: { get_param: perimeta_untrusted_vlan_networks } + + # Add any additional service ports here. + + perimeta_rtp_msc_b_server_0: + type: OS::Nova::Server + properties: + name: { get_param: [ rtp_msc_b_names, { get_param: perimeta_instance_index } ] } + image: { get_param: perimeta_image_name } + flavor: { get_param: perimeta_flavor_name } + key_name: { get_param: perimeta_keypair } + scheduler_hints: { group: { get_param: [ perimeta_server_groups, { get_param: perimeta_instance_index } ] } } + metadata: + 'vnf_name': { get_param: vnf_name } + 'vnf_id': { get_param: vnf_id } + 'vm_role': + str_replace: + template: $ROLE_b + params: + $ROLE: { get_param: vm_role } + 'vf_module_id': { get_param: vf_module_id } + 'msw_template_version': '17.07.04 - 2017-09-01' + networks: + - port: { get_resource: perimeta_rtp_msc_b_mgmt_0_port } + - port: { get_resource: perimeta_rtp_msc_b_ha_0_port } + - port: { get_resource: perimeta_rtp_msc_b_trusted_0_port } + - port: { get_resource: perimeta_rtp_msc_b_untrusted_parent_0_port } + availability_zone: { get_param: availability_zone_1 } + config_drive: True + user_data_format: RAW + user_data: + str_replace: + template: | + { + "vnic_assignment": { + "IBG1mgmt": {"mac": "$MGMT_MACADDR"}, + "IPG1": {"mac": "$HA_MACADDR"}, + "RPG1": {"mac": "$TRUSTED_MACADDR"}, + "RPG2": {"mac": "$UNTRUSTED_MACADDR"} + }, + "ip_ha_local": "$LOCAL_HA_IP_ADDR", + "ip_ha_remote": "$REMOTE_HA_IP_ADDR", + "ip_ha_plen": "$HA_NETWORK_PLEN" + } + params: + $MGMT_MACADDR: { get_attr: [perimeta_rtp_msc_b_mgmt_0_port, mac_address] } + $HA_MACADDR: { get_attr: [perimeta_rtp_msc_b_ha_0_port, mac_address] } + $TRUSTED_MACADDR: { get_attr: [perimeta_rtp_msc_b_trusted_0_port, mac_address] } + $UNTRUSTED_MACADDR: { get_attr: [perimeta_rtp_msc_b_untrusted_parent_0_port, mac_address] } + $LOCAL_HA_IP_ADDR: { get_param: [ rtp_msc_b_int_ha_ips, { get_param: perimeta_instance_index } ] } + $REMOTE_HA_IP_ADDR: { get_param: [ rtp_msc_a_int_ha_ips, { get_param: perimeta_instance_index } ] } + $HA_NETWORK_PLEN: { get_param: int_ha_network_plen }
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/vlan_subinterface_dual.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/vlan_subinterface_dual.yaml new file mode 100644 index 0000000000..8ee34a1265 --- /dev/null +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/heat/nested/nestedwithoutNodeTemplates/inputs/vlan_subinterface_dual.yaml @@ -0,0 +1,102 @@ +heat_template_version: 2014-10-16 + +description: > + HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs + +parameters: + perimeta_subinterface_instance_index: + # constraint copied from parent module + type: number + description: Index of instance among multiple instances. Use to retrieve correct parameter for this instance when passed all parameters for all instances. + constraints: + - range: { min: 1, max: 1001 } + description: perimeta_subinterface_instance_index must be between 1 and 1001 + perimeta_subinterface_name_prefix: + type: string + description: Combined with subinterface_instance_index, this is used as the name of the subinterface resource + perimeta_parent_interface: + type: string + description: Parent Contrail interface + perimeta_mac_address: + type: string + description: MAC address to use for subinterface + perimeta_ip_0: + type: string + description: IPv4 address associated with subinterfaces + perimeta_v6_ip_0: + type: string + description: IPv6 address associated with subinterfaces + perimeta_vip_0: + type: string + description: virtual IPv4 address associated with subinterfaces + perimeta_v6_vip_0: + type: string + description: virtual IPv6 address associated with subinterfaces + perimeta_vlan_ids: + type: comma_delimited_list + description: List of VLAN IDs to use for subinterfaces + perimeta_vlan_networks: + type: comma_delimited_list + description: List of Contrail VLAN networks to use for the subinterfaces. The order and number of these must match the VLAN ID list + +resources: + contrail_vmi_subinterface: + type: OS::ContrailV2::VirtualMachineInterface + properties: + name: + str_replace: + template: $NAME_$VLAN + params: + $NAME: { get_param: perimeta_subinterface_name_prefix } + $VLAN: { get_param: [ perimeta_vlan_ids, { get_param: perimeta_subinterface_instance_index } ] } + virtual_machine_interface_properties: + { + virtual_machine_interface_properties_sub_interface_vlan_tag: { get_param: [ perimeta_vlan_ids, { get_param: perimeta_subinterface_instance_index } ] } + } + virtual_machine_interface_mac_addresses: + { + virtual_machine_interface_mac_addresses_mac_address: [{ get_param: perimeta_mac_address }], + } + virtual_machine_interface_allowed_address_pairs: + { + virtual_machine_interface_allowed_address_pairs_allowed_address_pair: [ + { + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_address_mode: active-standby, + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_mac: { get_param: perimeta_mac_address }, + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip: + { + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip_ip_prefix: { get_param: perimeta_vip_0 }, + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip_ip_prefix_len: 32 + } + }, + { + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_address_mode: active-standby, + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_mac: { get_param: perimeta_mac_address }, + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip: + { + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip_ip_prefix: { get_param: perimeta_v6_vip_0 }, + virtual_machine_interface_allowed_address_pairs_allowed_address_pair_ip_ip_prefix_len: 128 + } + } + ] + } + virtual_network_refs: [{ get_param: [ perimeta_vlan_networks, { get_param: perimeta_subinterface_instance_index } ] }] + virtual_machine_interface_refs: [{ get_param: perimeta_parent_interface }] + + contrail_vmi_ip: + type: OS::ContrailV2::InstanceIp + depends_on: [ contrail_vmi_subinterface ] + properties: + virtual_machine_interface_refs: [{ get_resource: contrail_vmi_subinterface }] + virtual_network_refs: [{ get_param: [ perimeta_vlan_networks, { get_param: perimeta_subinterface_instance_index } ] }] + instance_ip_address: { get_param: perimeta_ip_0 } + instance_ip_family: v4 + + contrail_vmi_ipv6: + type: OS::ContrailV2::InstanceIp + depends_on: [ contrail_vmi_subinterface ] + properties: + virtual_machine_interface_refs: [{ get_resource: contrail_vmi_subinterface }] + virtual_network_refs: [{ get_param: [ perimeta_vlan_networks, { get_param: perimeta_subinterface_instance_index } ] }] + instance_ip_address: { get_param: perimeta_v6_ip_0 } + instance_ip_family: v6 diff --git a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/getAttrDynamicParamEmptyMap/expectedoutputfiles/MainServiceTemplate.yaml b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/getAttrDynamicParamEmptyMap/expectedoutputfiles/MainServiceTemplate.yaml index 6e2aebc9c2..4744837987 100644 --- a/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/getAttrDynamicParamEmptyMap/expectedoutputfiles/MainServiceTemplate.yaml +++ b/openecomp-be/lib/openecomp-sdc-translator-lib/openecomp-sdc-translator-core/src/test/resources/mock/services/heattotosca/getAttrDynamicParamEmptyMap/expectedoutputfiles/MainServiceTemplate.yaml @@ -508,152 +508,6 @@ topology_template: capability: tosca.capabilities.Node node: NOKIA-LCP-Base relationship: tosca.relationships.DependsOn - FORMATXLATE: - type: org.openecomp.resource.abstract.nodes.heat.LCP-OPENECOMP.template - directives: - - substitutable - properties: - net_ids: - ? '' - : null - access: - get_input: access_net_id - oam: - get_input: oam_net_id - flavors: - ? '' - : '' - oam: - get_input: oam_flavor_name - ims: - get_input: ims_flavor_name - v4_ntp_server: - get_input: v4_ntp_server - vnf_name: - get_input: vnf_name - vmtype_list: - - oam - - ims - name_lists: - ? '' - : [ - ] - oam: - get_input: oam_names - ims: - get_input: ims_names - service_template_filter: - substitute_service_template: LCP-OPENECOMP.templateServiceTemplate.yaml - vm_counts: - get_input: vm_counts - v6_dns_server: - get_input: v6_dns_server - v6_ntp_server: - get_input: v6_ntp_server - vnf_id: - get_input: vnf_id - lcm_keypair: - get_input: lcm_keypair - subnet_ids: - ? '' - : null - access: - get_input: access_subnet_id - oam: - get_input: oam_subnet_id - cidrs: - ? '' - : null - access: - get_input: access_cidr - oam: - get_input: oam_cidr - default_gateways: - ? '' - : null - access: - get_input: access_default_gateway - oam: - get_input: oam_default_gateway - net_types: - get_input: net_types - ssh_access_key: - get_input: ssh_access_key - images: - ? '' - : '' - oam: - get_input: oam_image_name - ims: - get_input: ims_image_name - v4_enum_server: - get_input: v4_enum_server - availability_zones: - - get_input: availability_zone_0 - - get_input: availability_zone_1 - ip_lists: - ? '' - : [ - ] - ims_access_ips: - get_input: ims_access_ips - oam_oam_ips: - get_input: oam_oam_ips - vnf_module_id: - get_input: vnf_module_id - backup_file: - get_input: backup_file - v6_enum_server: - get_input: v6_enum_server - default_action: - get_input: default_action - v4_dns_server: - get_input: v4_dns_server - install_config: - get_input: install_config - cloud_name_delimiter: - get_input: cloud_name_delimiter - vnf_module_name: - get_input: vnf_module_name - vm_info: - get_input: vm_info - vmtype_count: 2 - NOKIA-LCP-Base: - type: org.openecomp.resource.abstract.nodes.heat.LCP-Base.template - directives: - - substitutable - properties: - default_prefix: - str_replace: - template: | - {"": "$stk$delimiter"} - params: - $stk: - get_input: OS::stack_name - $delimiter: - get_attribute: - - FORMATXLATE - - usage_info - - cloud_name_delimiter - total_vm_pairs: - get_attribute: - - FORMATXLATE - - total_vm_pairs - service_template_filter: - substitute_service_template: LCP-Base.templateServiceTemplate.yaml - ext_net_list: - - oam - - access - int_net_count: 2 - ext_net_info: - get_attribute: - - FORMATXLATE - - ext_net_info - requirements: - - dependency: - capability: tosca.capabilities.Node - node: FORMATXLATE - relationship: tosca.relationships.DependsOn IMS_RRG: type: org.openecomp.resource.abstract.nodes.heat.LCP-PairGroup.template directives: @@ -828,8 +682,6 @@ topology_template: Example HOT file illustrating elasticity groups. members: - OAM_RRG - - FORMATXLATE - - NOKIA-LCP-Base - IMS_RRG outputs: oam_management_v4_address: diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/src/test/java/com/att/sdc/validation/impl/validators/AttValetGroupAssignmentResourceValidatorTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/src/test/java/com/att/sdc/validation/impl/validators/AttValetGroupAssignmentResourceValidatorTest.java index 76e10215e3..acb54f4140 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/src/test/java/com/att/sdc/validation/impl/validators/AttValetGroupAssignmentResourceValidatorTest.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/att-sdc-validation-impl/src/test/java/com/att/sdc/validation/impl/validators/AttValetGroupAssignmentResourceValidatorTest.java @@ -1,8 +1,6 @@ package com.att.sdc.validation.impl.validators; import com.att.sdc.validation.datatypes.AttHeatResourceTypes; -import com.att.sdc.validation.datatypes.AttValetGroupTypeValues; -import org.openecomp.sdc.validation.Validator; import org.openecomp.core.validation.api.ValidationManager; import org.openecomp.core.validation.factory.ValidationManagerFactory; import org.openecomp.core.validation.types.GlobalValidationContext; diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java index 8bb95afacd..e3464db8d8 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-core/src/test/java/org/openecomp/sdc/heat/services/tree/HeatTreeManagerTest.java @@ -24,6 +24,8 @@ import org.openecomp.config.ConfigurationUtils; import org.openecomp.core.utilities.file.FileContentHandler; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.heat.datatypes.structure.HeatStructureTree; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.testng.Assert; import org.testng.annotations.Test; @@ -38,6 +40,8 @@ import java.util.stream.Collectors; public class HeatTreeManagerTest { + private Logger logger = LoggerFactory.getLogger(HeatTreeManagerTest.class); + @Test public void testHeatTreeCreation() { @@ -66,7 +70,7 @@ public class HeatTreeManagerTest { try { return FileUtils.toByteArray(new FileInputStream(file)); } catch (IOException e) { - e.printStackTrace(); + logger.debug("",e); } return new byte[0]; diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java index 485b4204c7..39362c7e10 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/util/HeatValidationService.java @@ -225,6 +225,7 @@ public class HeatValidationService { throw new Exception("The file '" + nestedFileName + "' has no content"); } } catch (Exception exception) { + logger.debug("",exception); mdcDataDebugMessage.debugExitMessage("file", parentFileName); return; } @@ -242,6 +243,7 @@ public class HeatValidationService { throw new Exception("The file '" + parentFileName + "' has no content"); } } catch (Exception exception) { + logger.debug("",exception); mdcDataDebugMessage.debugExitMessage("file", parentFileName); return; } @@ -374,6 +376,7 @@ public class HeatValidationService { } } catch (Exception exception) { + logger.debug("",exception); logger.warn("HEAT Validator will not be executed on file " + nestedFileName + " due to illegal HEAT format"); @@ -462,6 +465,7 @@ public class HeatValidationService { throw new Exception("The file '" + resourceType + "' has no content"); } } catch (Exception exception) { + logger.debug("",exception); return; } nestedOutputMap = nestedHeatOrchestrationTemplate.getOutputs(); @@ -511,6 +515,7 @@ public class HeatValidationService { throw new Exception("The file '" + envFileName + "' has no content"); } } catch (Exception exception) { + logger.debug("",exception); mdcDataDebugMessage.debugExitMessage("env file", envFileName); return null; } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java index 39556795c7..7d90726dd1 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ContrailValidator.java @@ -48,7 +48,7 @@ import java.util.Optional; public class ContrailValidator implements Validator { - public static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + public static final MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); protected static Logger logger = (Logger) LoggerFactory.getLogger(ContrailValidator.class); @Override @@ -59,6 +59,7 @@ public class ContrailValidator implements Validator { try { manifestContent = ValidationUtil.checkValidationPreCondition(globalContext); } catch (Exception exception) { + logger.debug("",exception); return; } Map<String, FileData.Type> fileTypeMap = ManifestUtil.getFileTypeMap(manifestContent); @@ -148,6 +149,7 @@ public class ContrailValidator implements Validator { heatOrchestrationTemplate = new YamlUtil().yamlToObject(fileContent, HeatOrchestrationTemplate.class); } catch (Exception ignored) { + logger.debug("",ignored); // the HeatValidator should handle file that is failing to parse mdcDataDebugMessage.debugExitMessage("file", fileName); return Optional.empty(); diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java index 2531150eab..569f2bb760 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ForbiddenResourceGuideLineValidator.java @@ -1,7 +1,6 @@ package org.openecomp.sdc.validation.impl.validators; import org.apache.commons.collections4.MapUtils; -import org.openecomp.sdc.validation.Validator; import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; import org.openecomp.core.validation.types.GlobalValidationContext; import org.openecomp.sdc.common.errors.Messages; @@ -11,12 +10,14 @@ import org.openecomp.sdc.heat.datatypes.manifest.ManifestContent; import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.heat.services.manifest.ManifestUtil; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.types.LoggerErrorDescription; import org.openecomp.sdc.logging.types.LoggerTragetServiceName; +import org.openecomp.sdc.validation.Validator; import org.openecomp.sdc.validation.util.ValidationUtil; -import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; @@ -29,6 +30,8 @@ public class ForbiddenResourceGuideLineValidator implements Validator { private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); private static Set<String> forbiddenResources = new HashSet<>(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @Override public void init(Map<String, Object> properties) { Map<String, Map<String, Object>> forbiddenResourcesMap = @@ -62,6 +65,7 @@ public class ForbiddenResourceGuideLineValidator implements Validator { try { manifestContent = ValidationUtil.checkValidationPreCondition(globalContext); } catch (Exception exception) { + log.debug("",exception); return; } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatResourceValidator.java index 2712dab11c..1fda0ed783 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatResourceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatResourceValidator.java @@ -27,7 +27,6 @@ import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.Optional; import java.util.Set; public class HeatResourceValidator extends ResourceBaseValidator { @@ -48,7 +47,7 @@ public class HeatResourceValidator extends ResourceBaseValidator { try { manifestContent = ValidationUtil.checkValidationPreCondition(globalContext); } catch (Exception exception) { - + logger.debug("",exception); } Set<String> baseFiles = ManifestUtil.getBaseFiles(manifestContent); String baseFileName = CollectionUtils.isEmpty(baseFiles) ? null : baseFiles.iterator().next(); diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java index ddc1bb49b9..5297453369 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/HeatValidator.java @@ -55,7 +55,7 @@ import java.util.Objects; import java.util.Set; public class HeatValidator implements Validator { - public static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + public static final MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); protected static Logger logger = (Logger) LoggerFactory.getLogger(HeatValidator.class); private static void validateAllRequiredArtifactsExist(String fileName, @@ -244,7 +244,7 @@ public class HeatValidator implements Validator { if (CollectionUtils.isNotEmpty(parametersNames)) { for (Map.Entry<String, Object> envEntry : envContent.getParameters().entrySet()) { String envParameter = envEntry.getKey(); - if (!parametersNames.contains(envParameter)) { + if (parametersNames != null && !parametersNames.contains(envParameter)) { globalContext.addMessage(envFile, ErrorLevel.ERROR, ErrorMessagesFormatBuilder .getErrorWithParameters( Messages.ENV_INCLUDES_PARAMETER_NOT_IN_HEAT.getErrorMessage(), envFile, @@ -278,7 +278,7 @@ public class HeatValidator implements Validator { Map<String, Parameter> parametersMap = heatOrchestrationTemplate.getParameters() == null ? null : heatOrchestrationTemplate.getParameters(); - if (MapUtils.isNotEmpty(parametersMap)) { + if (parametersMap != null && MapUtils.isNotEmpty(parametersMap)) { for (Map.Entry<String, Parameter> parameterEntry : parametersMap.entrySet()) { Parameter parameter = parameterEntry.getValue(); String parameterType = parameter.getType(); @@ -343,6 +343,7 @@ public class HeatValidator implements Validator { try { manifestContent = ValidationUtil.checkValidationPreCondition(globalContext); } catch (Exception exception) { + logger.debug("",exception); return; } String baseFileName; @@ -370,7 +371,8 @@ public class HeatValidator implements Validator { Set<String> manifestArtifacts = ManifestUtil.getArtifacts(manifestContent); globalContext.getFiles().stream() - .filter(fileName -> manifestArtifacts.contains(fileName) && !artifacts.contains(fileName)) + .filter(fileName -> isManifestArtifact(manifestArtifacts, fileName) && + isNotArtifact(artifacts, fileName)) .forEach(fileName -> globalContext.addMessage(fileName, ErrorLevel.WARNING, Messages.ARTIFACT_FILE_NOT_REFERENCED.getErrorMessage(), LoggerTragetServiceName.CHECK_FOR_ORPHAN_ARTIFACTS, @@ -380,6 +382,14 @@ public class HeatValidator implements Validator { } + private boolean isManifestArtifact(Set<String> manifestArtifacts, String fileName) { + return manifestArtifacts.contains(fileName); + } + + private boolean isNotArtifact(Set<String> artifacts, String fileName) { + return !artifacts.contains(fileName); + } + private void validate(String fileName, String envFileName, String baseFileName, Set<String> artifacts, Set<String> securityGroupsNamesFromBaseFileOutputs, GlobalValidationContext globalContext) { diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java index 43cafb494c..79c4dc2d96 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/ManifestValidator.java @@ -45,7 +45,7 @@ import java.util.Optional; public class ManifestValidator implements Validator { - public static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + public static final MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); private static Logger logger = (Logger) LoggerFactory.getLogger(YamlValidator.class); @Override @@ -65,6 +65,7 @@ public class ManifestValidator implements Validator { throw new Exception("The manifest file '" + SdcCommon.MANIFEST_NAME + "' has no content"); } } catch (Exception re) { + logger.debug("",re); globalContext.addMessage(SdcCommon.MANIFEST_NAME, ErrorLevel.ERROR, Messages.INVALID_MANIFEST_FILE.getErrorMessage(), LoggerTragetServiceName.VALIDATE_MANIFEST_CONTENT, @@ -80,7 +81,7 @@ public class ManifestValidator implements Validator { LoggerTragetServiceName.VALIDATE_FILE_IN_ZIP, LoggerErrorDescription.MISSING_FILE)); globalContext.getFileContextMap().keySet().stream().filter(name -> - !manifestFiles.contains(name) && !SdcCommon.MANIFEST_NAME.equals(name) + isNotManifestFiles(manifestFiles, name) && isNotManifestName(name) ).forEach(name -> globalContext.addMessage(name, ErrorLevel.WARNING, Messages.MISSING_FILE_IN_MANIFEST.getErrorMessage(), @@ -90,6 +91,14 @@ public class ManifestValidator implements Validator { mdcDataDebugMessage.debugExitMessage(null, null); } + private boolean isNotManifestFiles(List<String> manifestFiles, String name) { + return !manifestFiles.contains(name); + } + + private boolean isNotManifestName(String name) { + return !SdcCommon.MANIFEST_NAME.equals(name); + } + private List<String> getManifestFileList(ManifestContent manifestContent, GlobalValidationContext context) { diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidator.java index f3af7d7e48..04771e023e 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/SharedResourceGuideLineValidator.java @@ -1,6 +1,8 @@ package org.openecomp.sdc.validation.impl.validators; import org.apache.commons.collections4.CollectionUtils; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.validation.Validator; import org.openecomp.core.validation.errors.ErrorMessagesFormatBuilder; import org.openecomp.core.validation.types.GlobalValidationContext; @@ -26,7 +28,8 @@ import java.util.Set; * Created by TALIO on 2/15/2017. */ public class SharedResourceGuideLineValidator implements Validator { - public static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + public static final MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); @Override public void validate(GlobalValidationContext globalContext) { @@ -34,6 +37,7 @@ public class SharedResourceGuideLineValidator implements Validator { try { manifestContent = ValidationUtil.checkValidationPreCondition(globalContext); } catch (Exception exception) { + log.debug("",exception); return; } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java index 445e1c2e3d..0fded4f58e 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/YamlValidator.java @@ -39,7 +39,7 @@ import java.util.Map; import java.util.Optional; public class YamlValidator implements Validator { - public static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + public static final MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); private static final Logger logger = (Logger) LoggerFactory.getLogger(YamlValidator.class); @Override diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java index 5dc42c9b9a..d05f2813ff 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/heatresource/NovaServerResourceValidator.java @@ -90,25 +90,26 @@ public class NovaServerResourceValidator implements ResourceValidator { return; } - for (Object serverGroupValue : schedulerHintsMap.values()) { - if(!(serverGroupValue instanceof Map)){ - continue; - } - Map<String, Object> currentServerMap = (Map<String, Object>) serverGroupValue; - String serverResourceName = - currentServerMap == null ? null : (String) currentServerMap - .get(ResourceReferenceFunctions.GET_RESOURCE.getFunction()); - Resource serverResource = - serverResourceName == null || resourcesMap == null ? null - : resourcesMap.get(serverResourceName); - - if (serverResource != null && !serverResource.getType() - .equals(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE.getHeatResource())) { - globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder - .getErrorWithParameters(Messages.SERVER_NOT_DEFINED_FROM_NOVA.getErrorMessage(), - serverResourceName, resourceEntry.getKey()), - LoggerTragetServiceName.VALIDATE_SERVER_GROUP_EXISTENCE, - LoggerErrorDescription.SERVER_NOT_DEFINED_NOVA); + if (schedulerHintsMap != null) { + for (Object serverGroupValue : schedulerHintsMap.values()) { + if (!(serverGroupValue instanceof Map)) { + continue; + } + Map<String, Object> currentServerMap = (Map<String, Object>) serverGroupValue; + String serverResourceName = (String) currentServerMap + .get(ResourceReferenceFunctions.GET_RESOURCE.getFunction()); + Resource serverResource = + serverResourceName == null || resourcesMap == null ? null + : resourcesMap.get(serverResourceName); + + if (serverResource != null && !serverResource.getType() + .equals(HeatResourcesTypes.NOVA_SERVER_GROUP_RESOURCE_TYPE.getHeatResource())) { + globalContext.addMessage(fileName, ErrorLevel.ERROR, ErrorMessagesFormatBuilder + .getErrorWithParameters(Messages.SERVER_NOT_DEFINED_FROM_NOVA.getErrorMessage(), + serverResourceName, resourceEntry.getKey()), + LoggerTragetServiceName.VALIDATE_SERVER_GROUP_EXISTENCE, + LoggerErrorDescription.SERVER_NOT_DEFINED_NOVA); + } } } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java index 6016ba0cb8..299eabf4e5 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-impl/src/main/java/org/openecomp/sdc/validation/impl/validators/namingconvention/NovaServerNamingConventionGuideLineValidator.java @@ -564,11 +564,12 @@ public class NovaServerNamingConventionGuideLineValidator implements ResourceVal private String getVmName(String nameToGetVmNameFrom, String stringToGetIndexOf) { int vmIndex = nameToGetVmNameFrom == null ? -1 : nameToGetVmNameFrom.indexOf(stringToGetIndexOf); - String vmName = vmIndex < 0 ? null - : trimNonAlphaNumericCharactersFromEndOfString(nameToGetVmNameFrom.substring(0, vmIndex)); - + String vmName = null; + if (nameToGetVmNameFrom != null) { + vmName = vmIndex < 0 ? null + : trimNonAlphaNumericCharactersFromEndOfString(nameToGetVmNameFrom.substring(0, vmIndex)); + } return vmName; - } private boolean isVmNameSync(List<String> namesToCompare) { diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/base/ResourceBaseValidator.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/base/ResourceBaseValidator.java index 1a5b373833..f5d01d90e8 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/base/ResourceBaseValidator.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/base/ResourceBaseValidator.java @@ -53,6 +53,7 @@ public class ResourceBaseValidator implements Validator { try { manifestContent = ValidationUtil.checkValidationPreCondition(globalContext); } catch (Exception exception) { + logger.debug("",exception); return; } diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java index 3702e9253f..fa1946f987 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationTestUtil.java @@ -15,6 +15,8 @@ import org.openecomp.sdc.heat.datatypes.model.HeatOrchestrationTemplate; import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.heat.services.HeatStructureUtil; import org.openecomp.sdc.heat.services.manifest.ManifestUtil; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.validation.ResourceValidator; import org.openecomp.sdc.validation.ValidationContext; import org.openecomp.sdc.validation.Validator; @@ -36,6 +38,9 @@ import java.util.Objects; */ public class ValidationTestUtil { + private final static Logger log = (Logger) LoggerFactory.getLogger(ValidationTestUtil.class + .getName()); + public static GlobalValidationContext createGlobalContextFromPath(String path) { GlobalValidationContext globalValidationContext = new GlobalValidationContext(); Map<String, byte[]> contentMap = getContentMapByPath(path); @@ -71,7 +76,7 @@ public class ValidationTestUtil { fileContent = FileUtils.toByteArray(fis); contentMap.put(file.getName(), fileContent); } catch (IOException e) { - e.printStackTrace(); + log.debug("",e); } } return contentMap; @@ -178,6 +183,7 @@ public class ValidationTestUtil { CommonMethods.newInstance(validatorConf.getImplementationClass(), Validator.class); validator.init(validatorConf.getProperties()); } catch (IllegalArgumentException iae) { + log.debug("",iae); return null; } return validator; diff --git a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java index 3dcc7da876..41300f3852 100644 --- a/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java +++ b/openecomp-be/lib/openecomp-sdc-validation-lib/openecomp-sdc-validation-sdk/src/main/java/org/openecomp/sdc/validation/util/ValidationUtil.java @@ -17,6 +17,8 @@ import org.openecomp.sdc.heat.datatypes.model.Resource; import org.openecomp.sdc.heat.datatypes.model.ResourceReferenceFunctions; import org.openecomp.sdc.heat.services.HeatStructureUtil; import org.openecomp.sdc.heat.services.manifest.ManifestUtil; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; @@ -37,6 +39,7 @@ import static java.util.Objects.nonNull; public class ValidationUtil { private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private final static Logger log = (Logger) LoggerFactory.getLogger(ValidationUtil.class.getName()); public static void removeExposedResourcesCalledByGetResource(String fileName, Set<String> actualExposedResources, @@ -138,6 +141,7 @@ public class ValidationUtil { throw new Exception("The file '" + envFileName + "' has no content"); } } catch (Exception exception) { + log.debug("",exception); mdcDataDebugMessage.debugExitMessage("file", envFileName); return null; } @@ -186,6 +190,7 @@ public class ValidationUtil { try { manifestContent = JsonUtil.json2Object(manifest.get(), ManifestContent.class); } catch (Exception exception) { + log.debug("",exception); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API, LoggerTragetServiceName.VALIDATE_MANIFEST_CONTENT, ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_MANIFEST); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java index 8e2e4889ba..25fd68b057 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/LicenseAgreementDao.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.vendorlicense.dao; -import org.openecomp.core.dao.BaseDao; import org.openecomp.sdc.vendorlicense.dao.types.LicenseAgreementEntity; import org.openecomp.sdc.versioning.dao.VersionableDao; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java index 4483c67b65..7f5fc66ef4 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/ChoiceOrOther.java @@ -26,6 +26,8 @@ import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -41,6 +43,8 @@ public class ChoiceOrOther<E extends Enum<E>> { "Enum used as part of ChoiceOrOther type must contain the value 'Other'"; public static final String OTHER_ENUM_VALUE = "Other"; + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @Transient private E choice; @@ -117,9 +121,11 @@ public class ChoiceOrOther<E extends Enum<E>> { try { choice = E.valueOf(enumClass, result); } catch (IllegalArgumentException exception) { + log.debug("",exception); try { choice = E.valueOf(enumClass, OTHER_ENUM_VALUE); } catch (IllegalArgumentException ex) { + log.debug("",ex); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.VALIDATE_CHOICE_VALUE, ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitType.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitType.java index ff0eff8042..399cf28201 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitType.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/LimitType.java @@ -1,8 +1,5 @@ package org.openecomp.sdc.vendorlicense.dao.types; -import java.util.ArrayList; -import java.util.List; - public enum LimitType { ServiceProvider, Vendor; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java index 36f54ac45e..2f28142470 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-api/src/main/java/org/openecomp/sdc/vendorlicense/dao/types/MultiChoiceOrOther.java @@ -26,6 +26,8 @@ import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -43,6 +45,8 @@ public class MultiChoiceOrOther<E extends Enum<E>> { "Enum used as part of MultiChoiceOrOther type must contain the value 'Other'"; public static final String OTHER_ENUM_VALUE = "Other"; + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + @Transient private Set<E> choices; @Transient @@ -136,10 +140,11 @@ public class MultiChoiceOrOther<E extends Enum<E>> { try { choices.add(E.valueOf(enumClass, result)); } catch (IllegalArgumentException exception) { + log.debug("",exception); try { choices.add(E.valueOf(enumClass, OTHER_ENUM_VALUE)); } catch (IllegalArgumentException ex) { - + log.debug("",ex); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.VALIDATE_CHOICE_VALUE, ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_VALUE); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java index c36d255b31..78c26c83d3 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/dao/impl/zusammen/LimitZusammenDaoImpl.java @@ -12,8 +12,6 @@ import org.openecomp.core.zusammen.api.ZusammenAdaptor; import org.openecomp.core.zusammen.api.ZusammenUtil; import org.openecomp.sdc.vendorlicense.dao.LimitDao; import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; -import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; -import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity; import org.openecomp.sdc.vendorlicense.dao.types.LimitType; import org.openecomp.sdc.versioning.dao.types.Version; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java index 2f7e0ea50e..b2f2d488e9 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/facade/impl/VendorLicenseFacadeImpl.java @@ -30,6 +30,8 @@ import org.openecomp.core.utilities.CommonMethods; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; @@ -89,6 +91,7 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade { licenseKeyGroupDao = LicenseKeyGroupDaoFactory.getInstance().createInterface(); private static final LimitDao limitDao = LimitDaoFactory.getInstance().createInterface(); private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); /** * Instantiates a new Vendor license facade. @@ -409,6 +412,7 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade { return Collections.singletonList(new RequestedVersionInvalidErrorBuilder().build()); } } catch (CoreException exception) { + log.debug("",exception); return Collections.singletonList(exception.code()); } @@ -417,6 +421,7 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade { try { getLicenseAgreement(vlmId, licenseAgreementId, version); } catch (CoreException exception) { + log.debug("",exception); errorMessages.add(exception.code()); } @@ -433,6 +438,7 @@ public class VendorLicenseFacadeImpl implements VendorLicenseFacade { version).build()); } } catch (CoreException exception) { + log.debug("",exception); errorMessages.add(exception.code()); } } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java index 282b4e6743..6dbed22db5 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/VendorLicenseArtifactsServiceImpl.java @@ -20,6 +20,9 @@ package org.openecomp.sdc.vendorlicense.licenseartifacts.impl; +import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VENDOR_LICENSE_MODEL_ARTIFACT_NAME_WITH_PATH; +import static org.openecomp.sdc.vendorlicense.VendorLicenseConstants.VNF_ARTIFACT_NAME_WITH_PATH; + import org.apache.commons.collections.CollectionUtils; import org.openecomp.core.utilities.file.FileContentHandler; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java index 3a3fbd16a3..5f71565843 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/XmlArtifact.java @@ -23,6 +23,8 @@ package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -34,6 +36,7 @@ import org.openecomp.sdc.vendorlicense.errors.JsonErrorBuilder; public abstract class XmlArtifact { XmlMapper xmlMapper = new XmlMapper(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); abstract void initMapper(); @@ -49,6 +52,7 @@ public abstract class XmlArtifact { try { xml = xmlMapper.writeValueAsString(this); } catch (com.fasterxml.jackson.core.JsonProcessingException exception) { + log.debug("",exception); MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_DB, LoggerTragetServiceName.WRITE_ARTIFACT_XML, ErrorLevel.ERROR.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), LoggerErrorDescription.INVALID_JSON); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java index dc0db0d96c..ac45528acd 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVendorLicenseArtifact.java @@ -21,23 +21,20 @@ package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; +import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementTime; import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; -import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; import org.openecomp.sdc.vendorlicense.dao.types.xml.AggregationFunctionForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementMetricForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementTimeForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.OperationalScopeForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml; -import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml; import java.util.Collection; import java.util.Set; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java index 8a2d17d9ff..ad1a9a6bdf 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinEntitlementPoolEntityForVnfArtifact.java @@ -21,10 +21,7 @@ package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import org.openecomp.sdc.vendorlicense.dao.types.AggregationFunction; import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; import org.openecomp.sdc.vendorlicense.dao.types.EntitlementMetric; @@ -34,9 +31,9 @@ import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; import org.openecomp.sdc.vendorlicense.dao.types.xml.AggregationFunctionForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementMetricForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.EntitlementTimeForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.OperationalScopeForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml; -import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml; import java.util.Collection; import java.util.Set; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java index 78bf531e82..5a8e9966cc 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVendorLicenseArtifact.java @@ -21,17 +21,14 @@ package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; import org.openecomp.sdc.vendorlicense.dao.types.xml.LicenseKeyTypeForXml; +import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.OperationalScopeForXml; import org.openecomp.sdc.vendorlicense.dao.types.xml.ThresholdForXml; -import org.openecomp.sdc.vendorlicense.dao.types.xml.LimitForXml; import java.util.Collection; import java.util.Set; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java index b25b93ff7c..4af4b592a9 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-license-lib/openecomp-sdc-vendor-license-core/src/main/java/org/openecomp/sdc/vendorlicense/licenseartifacts/impl/types/mixins/MixinLicenseKeyGroupEntityForVnfArtifact.java @@ -21,10 +21,7 @@ package org.openecomp.sdc.vendorlicense.licenseartifacts.impl.types.mixins; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper; -import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty; import org.openecomp.sdc.vendorlicense.dao.types.ChoiceOrOther; import org.openecomp.sdc.vendorlicense.dao.types.LimitEntity; import org.openecomp.sdc.vendorlicense.dao.types.OperationalScope; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDependencyModelDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDependencyModelDao.java index 1be4a5cda5..a980918c36 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDependencyModelDao.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ComponentDependencyModelDao.java @@ -2,7 +2,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.dao; import org.openecomp.core.dao.BaseDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; import org.openecomp.sdc.versioning.dao.VersionableDao; import org.openecomp.sdc.versioning.dao.types.Version; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java index 348b777fe6..da57b0a2b4 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/NetworkDao.java @@ -21,13 +21,10 @@ package org.openecomp.sdc.vendorsoftwareproduct.dao; import org.openecomp.core.dao.BaseDao; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; import org.openecomp.sdc.versioning.dao.VersionableDao; import org.openecomp.sdc.versioning.dao.types.Version; -import java.util.Collection; - public interface NetworkDao extends VersionableDao, BaseDao<NetworkEntity> { diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ImageEntity.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ImageEntity.java index 4950229486..7d22cdd13f 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ImageEntity.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/type/ImageEntity.java @@ -9,7 +9,6 @@ import org.openecomp.core.utilities.json.JsonUtil; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Image; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Nic; import org.openecomp.sdc.versioning.dao.types.Version; @Table(keyspace = "dox", name = "vsp_component_image") diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/QuestionnnaireDataServiceFactory.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/QuestionnnaireDataServiceFactory.java index a1b9430e41..a45eb3db6f 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/QuestionnnaireDataServiceFactory.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/QuestionnnaireDataServiceFactory.java @@ -22,7 +22,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.factory; import org.openecomp.core.factory.api.AbstractComponentFactory; import org.openecomp.core.factory.api.AbstractFactory; -import org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.InformationArtifactGenerator; import org.openecomp.sdc.vendorsoftwareproduct.questionnaire.QuestionnaireDataService; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/InformationArtifactGenerator.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/InformationArtifactGenerator.java index 11d8e7b501..5813a18bd7 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/InformationArtifactGenerator.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/InformationArtifactGenerator.java @@ -23,7 +23,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.informationArtifact; import org.openecomp.sdc.versioning.dao.types.Version; import java.io.IOException; -import java.nio.ByteBuffer; /** * @author katyr diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGenerator.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGenerator.java index 6b1837fa10..edfbd8c94f 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGenerator.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/schemagenerator/SchemaGenerator.java @@ -25,6 +25,8 @@ import freemarker.template.TemplateException; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateContext; import org.openecomp.sdc.vendorsoftwareproduct.types.schemagenerator.SchemaTemplateInput; @@ -35,6 +37,7 @@ import java.io.Writer; public class SchemaGenerator { public static final String SCHEMA_GENERATION_ERROR = "SCHEMA_GENERATION_ERROR"; + private final static Logger log = (Logger) LoggerFactory.getLogger(SchemaGenerator.class.getName()); /** * Generate string. @@ -56,6 +59,7 @@ public class SchemaGenerator { schemaTemplate.process(input, writer); return writer.toString(); } catch (IOException | TemplateException exception) { + log.debug("",exception); throw new CoreException( new ErrorCode.ErrorCodeBuilder().withCategory(ErrorCategory.APPLICATION) .withId(SCHEMA_GENERATION_ERROR).withMessage(exception.getMessage()).build()); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/candidateheat/AnalyzedZipHeatFiles.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/candidateheat/AnalyzedZipHeatFiles.java index 5e04a1683c..3d652607ce 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/candidateheat/AnalyzedZipHeatFiles.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-api/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/types/candidateheat/AnalyzedZipHeatFiles.java @@ -24,7 +24,6 @@ import org.apache.commons.collections4.CollectionUtils; import java.util.Collection; import java.util.HashSet; -import java.util.Objects; import java.util.Set; /** diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductCreationFailedBuilder.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductCreationFailedBuilder.java index 45989ddbf0..6ca694364e 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductCreationFailedBuilder.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/errors/VendorSoftwareProductCreationFailedBuilder.java @@ -3,9 +3,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.dao.errors; import org.openecomp.sdc.common.errors.ErrorCategory; import org.openecomp.sdc.common.errors.ErrorCode; import org.openecomp.sdc.vendorsoftwareproduct.errors.VendorSoftwareProductErrorCodes; -import org.openecomp.sdc.versioning.dao.types.Version; - -import java.text.MessageFormat; public class VendorSoftwareProductCreationFailedBuilder { private static final String VSP_CREATION_FAILED = "Failed to create VSP; %s"; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java index b46486eb32..aa611c0bd2 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ComponentDependencyModelDaoCassandraImpl.java @@ -13,8 +13,6 @@ import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDependencyModelDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentDependencyModelEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ProcessEntity; import org.openecomp.sdc.versioning.VersioningManagerFactory; import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdc.versioning.types.UniqueValueMetadata; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ImageDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ImageDaoFactoryImpl.java index e4f13b3ee1..7f3ae7531a 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ImageDaoFactoryImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/ImageDaoFactoryImpl.java @@ -3,7 +3,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.dao.impl; import org.openecomp.core.zusammen.api.ZusammenAdaptorFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ImageDaoZusammenImpl; public class ImageDaoFactoryImpl extends ImageDaoFactory { diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java index 37917284e0..0b29fdab27 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/PackageInfoDaoImpl.java @@ -29,7 +29,6 @@ import com.datastax.driver.mapping.annotations.Query; import org.openecomp.core.dao.impl.CassandraBaseDao; import org.openecomp.core.nosqldb.api.NoSqlDb; import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.vendorsoftwareproduct.dao.PackageInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.PackageInfo; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java index 96bb16ca70..0a80b2ae51 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/VendorSoftwareProductDaoFactoryImpl.java @@ -20,7 +20,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.dao.impl; -import org.openecomp.sdc.vendorsoftwareproduct.VendorSoftwareProductConstants; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NetworkDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NetworkDaoZusammenImpl.java index 898ee434e8..b22c9f32ed 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NetworkDaoZusammenImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/NetworkDaoZusammenImpl.java @@ -14,7 +14,6 @@ import org.openecomp.core.zusammen.api.ZusammenUtil; import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NetworkEntity; import org.openecomp.sdc.versioning.dao.types.Version; -import org.openecomp.sdc.versioning.dao.types.VersionStatus; import java.io.ByteArrayInputStream; import java.util.Collection; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java index c101955292..ea51b770bf 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/OrchestrationTemplateCandidateDaoZusammenImpl.java @@ -16,7 +16,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.OrchestrationTemplateCandidat import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateData; import org.openecomp.sdc.vendorsoftwareproduct.types.candidateheat.FilesDataStructure; import org.openecomp.sdc.versioning.dao.types.Version; -import org.openecomp.sdc.versioning.dao.types.VersionStatus; import java.io.ByteArrayInputStream; import java.nio.ByteBuffer; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java index 7ad7929ccb..517a01e58d 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VendorSoftwareProductInfoDaoZusammenImpl.java @@ -1,6 +1,5 @@ package org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen; -import com.amdocs.zusammen.adaptor.inbound.api.types.item.ElementInfo; import com.amdocs.zusammen.adaptor.inbound.api.types.item.ZusammenElement; import com.amdocs.zusammen.datatypes.Id; import com.amdocs.zusammen.datatypes.SessionContext; @@ -22,7 +21,6 @@ import org.openecomp.sdc.versioning.types.VersionableEntityStoreType; import java.io.ByteArrayInputStream; import java.util.Collection; import java.util.Date; -import java.util.Optional; import java.util.stream.Collectors; public class VendorSoftwareProductInfoDaoZusammenImpl implements VendorSoftwareProductInfoDao { diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java index dde3603896..5e80d4c355 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/dao/impl/zusammen/VspZusammenUtil.java @@ -51,8 +51,10 @@ class VspZusammenUtil { if (Objects.isNull(head)) { head = father = element; } else { - father.getSubElements().add(element); - father = element; + if (father != null) { + father.getSubElements().add(element); + father = element; + } } } diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/QuestionnaireDataServiceFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/QuestionnaireDataServiceFactoryImpl.java index 5c569dbf08..865c7f1189 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/QuestionnaireDataServiceFactoryImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/QuestionnaireDataServiceFactoryImpl.java @@ -21,7 +21,6 @@ package org.openecomp.sdc.vendorsoftwareproduct.factory; -import org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.InformationArtifactGenerator; import org.openecomp.sdc.vendorsoftwareproduct.questionnaire.QuestionnaireDataService; import org.openecomp.sdc.vendorsoftwareproduct.quiestionnaire.QuestionnaireDataServiceImpl; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java index 393325d437..a7e55bd290 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/factory/impl/CompositionEntityDataManagerFactoryImpl.java @@ -21,15 +21,11 @@ package org.openecomp.sdc.vendorsoftwareproduct.factory.impl; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComponentDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ComputeDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.DeploymentFlavorDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.ImageDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.NetworkDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.NicDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.factory.CompositionEntityDataManagerFactory; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/quiestionnaire/QuestionnaireDataServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/quiestionnaire/QuestionnaireDataServiceImpl.java index 76d8210ca5..de29d5b8f0 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/quiestionnaire/QuestionnaireDataServiceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/quiestionnaire/QuestionnaireDataServiceImpl.java @@ -22,13 +22,16 @@ package org.openecomp.sdc.vendorsoftwareproduct.quiestionnaire; import org.openecomp.core.utilities.json.JsonUtil; -import org.openecomp.sdc.common.utils.CommonUtil; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductDaoFactory; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDaoFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.*; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.CompositionEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.NicEntity; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; +import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; import org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.InformationArtifactData; import org.openecomp.sdc.vendorsoftwareproduct.questionnaire.QuestionnaireDataService; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.ComponentQuestionnaire; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/ManualVspDataCollectionService.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/ManualVspDataCollectionService.java index 1499bccec2..100425858f 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/ManualVspDataCollectionService.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/ManualVspDataCollectionService.java @@ -9,6 +9,8 @@ import org.openecomp.sdc.generator.datatypes.tosca.DeploymentFlavorModel; import org.openecomp.sdc.generator.datatypes.tosca.LicenseFlavor; import org.openecomp.sdc.generator.datatypes.tosca.MultiFlavorVfcImage; import org.openecomp.sdc.generator.datatypes.tosca.VendorInfo; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -71,6 +73,8 @@ public class ManualVspDataCollectionService { private static final VendorLicenseFacade vendorLicenseFacade = VendorLicenseFacadeFactory.getInstance().createInterface(); + private final Logger log = (Logger) LoggerFactory.getLogger(this.getClass().getName()); + /** * Gets vendor name for the vsp. @@ -312,26 +316,28 @@ public class ManualVspDataCollectionService { computeQuestionnaire = computeDao.getQuestionnaireData(vspId, version, componentId, computeFlavorId); } catch (Exception ex) { + log.debug("",ex); computeQuestionnaire = null; MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API, LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Failed to get compute questionnaire : " + ex.getMessage()); } - if (Objects.nonNull(computeQuestionnaire)) { + if (computeQuestionnaire != null && Objects.nonNull(computeQuestionnaire)) { String computeQuestionnaireData = computeQuestionnaire.getQuestionnaireData(); if (Objects.nonNull(computeQuestionnaireData)) { Compute compute; try { compute = JsonUtil.json2Object(computeQuestionnaireData, Compute.class); } catch (Exception ex) { + log.debug("",ex); compute = null; MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API, LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to parse compute questionnaire : " + ex.getMessage()); } - if (Objects.nonNull(compute.getVmSizing())) { + if (compute != null && Objects.nonNull(compute.getVmSizing())) { computeFlavor = new ComputeFlavor(); if (Objects.nonNull(compute.getVmSizing().getNumOfCPUs())) { computeFlavor.setNum_cpus(compute.getVmSizing().getNumOfCPUs()); @@ -392,13 +398,14 @@ public class ManualVspDataCollectionService { imageDetails = JsonUtil.json2Object(imageQuestionnaireDataEntity .getQuestionnaireData(), ImageDetails.class); } catch (Exception ex) { + log.debug("",ex); imageDetails = null; MdcDataErrorMessage.createErrorMessageAndUpdateMdc(LoggerConstants.TARGET_ENTITY_API, LoggerTragetServiceName.COLLECT_MANUAL_VSP_TOSCA_DATA, ErrorLevel.INFO.name(), LoggerErrorCode.DATA_ERROR.getErrorCode(), "Unable to parse image questionnaire : " + ex.getMessage()); } - if (Objects.nonNull(imageDetails) + if (imageDetails != null && Objects.nonNull(imageDetails) && Objects.nonNull(imageDetails.getVersion())) { //Image version is used as a key for the image block //So excluding the population if questionnaire data is absent or invalid diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java index a16fea19ab..93b95240d1 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionDataExtractorImpl.java @@ -391,6 +391,7 @@ public class CompositionDataExtractorImpl implements CompositionDataExtractor { try { value= (String) inputEntry.getValue().get_default(); } catch (Exception e) { + logger.debug(e.getMessage(), e); value = inputEntry.getValue().get_default().toString(); } return value; diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java index c76b15d221..39534cf9b7 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/composition/CompositionEntityDataManagerImpl.java @@ -51,14 +51,12 @@ import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspQuestionnaireEntity; import org.openecomp.sdc.vendorsoftwareproduct.services.composition.CompositionEntityDataManager; import org.openecomp.sdc.vendorsoftwareproduct.services.schemagenerator.SchemaGenerator; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Component; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentComputeAssociation; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComponentData; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionData; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityId; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityType; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.CompositionEntityValidationData; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.ComputeData; -import org.openecomp.sdc.vendorsoftwareproduct.types.composition.DeploymentFlavor; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Image; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.Network; import org.openecomp.sdc.vendorsoftwareproduct.types.composition.NetworkType; @@ -69,6 +67,7 @@ import org.openecomp.sdc.versioning.dao.types.Version; import java.util.ArrayList; import java.util.Collection; +import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -82,6 +81,8 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa "COMPOSITION_ENTITY_DATA_MANAGER_ERR"; private static final String COMPOSITION_ENTITY_DATA_MANAGER_ERR_MSG = "Invalid input: %s may not be null"; + private static final String MISSING_OR_INVALID_QUESTIONNAIRE_MSG = + "Data is missing/invalid for this %s. Please refill and resubmit."; private static final Logger logger = LoggerFactory.getLogger(CompositionEntityDataManagerImpl.class); @@ -105,7 +106,7 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa NicDao nicDao, NetworkDao networkDao, ImageDao imageDao, ComputeDao computeDao, DeploymentFlavorDao deploymentFlavorDao, - VendorSoftwareProductDao vendorSoftwareProductDao ) { + VendorSoftwareProductDao vendorSoftwareProductDao) { this.vspInfoDao = vspInfoDao; this.componentDao = componentDao; this.nicDao = nicDao; @@ -272,7 +273,7 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa return true; } - result = result || isThereErrorsInSubTree(subEntity); + result = isThereErrorsInSubTree(subEntity) || result; if (result) { return true; } @@ -588,12 +589,10 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa compositionEntityData.entity.getCompositionEntityId().toString(), compositionEntityData.entity.getQuestionnaireData())); - if(Objects.isNull(compositionEntityData.entity.getQuestionnaireData()) || !JsonUtil.isValidJson - (compositionEntityData.entity.getQuestionnaireData())){ - List<String> errors = new ArrayList<>(); - errors.add("Data is missing for the above " + compositionEntityData.entity.getType() + - ". Complete the mandatory fields and resubmit."); - return errors; + if (Objects.isNull(compositionEntityData.entity.getQuestionnaireData()) || + !JsonUtil.isValidJson(compositionEntityData.entity.getQuestionnaireData())) { + return Collections.singletonList(String + .format(MISSING_OR_INVALID_QUESTIONNAIRE_MSG, compositionEntityData.entity.getType())); } return JsonUtil.validate( @@ -677,8 +676,8 @@ public class CompositionEntityDataManagerImpl implements CompositionEntityDataMa return compute; } - public void saveComputesFlavorByComponent(String vspId, Version version, Component component, String - componentId) { + public void saveComputesFlavorByComponent(String vspId, Version version, Component component, + String componentId) { if (CollectionUtils.isNotEmpty(component.getCompute())) { for (ComputeData flavor : component.getCompute()) { ComputeEntity computeEntity = new ComputeEntity(vspId, version, componentId, null); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java index e5f1a4c3ac..c18a0cbedd 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/services/impl/filedatastructuremodule/CandidateServiceImpl.java @@ -107,6 +107,7 @@ public class CandidateServiceImpl implements CandidateService { Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage())); } } catch (IOException e) { + logger.debug(e.getMessage(), e); mdcDataDebugMessage.debugExitMessage(null); return Optional.of(new ErrorMessage(ErrorLevel.ERROR, Messages.NO_ZIP_FILE_WAS_UPLOADED_OR_ZIP_NOT_EXIST.getErrorMessage())); @@ -141,12 +142,16 @@ public class CandidateServiceImpl implements CandidateService { (SdcCommon.MANIFEST_NAME)); List<String> structureArtifacts = structure.getArtifacts(); structureArtifacts.addAll(fileDataStructureFromManifest.getArtifacts().stream().filter - (artifact -> !structureArtifacts.contains(artifact)).collect((Collectors.toList()))); + (artifact -> isNotStrctureArtifact(structureArtifacts, artifact)).collect((Collectors.toList()))); handleArtifactsFromTree(tree, structure); return JsonUtil.object2Json(structure); } + private boolean isNotStrctureArtifact(List<String> structureArtifacts, String artifact) { + return !structureArtifacts.contains(artifact); + } + @Override public OrchestrationTemplateCandidateData createCandidateDataEntity( CandidateDataEntityTo candidateDataEntityTo, InputStream zipFileManifest, diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java index fe42f6ccd3..39c14e64fd 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/dao/ServiceModelDaoFactoryTest.java @@ -122,12 +122,15 @@ public class ServiceModelDaoFactoryTest { Assert.assertTrue(model instanceof ToscaServiceModel); if (model instanceof ToscaServiceModel) { - artifact001 = - (String) ((ToscaServiceModel) model).getArtifactFiles().getFileList().toArray()[0]; + setArtifact((ToscaServiceModel) model); } } - + private static void setArtifact(ToscaServiceModel model) + { + artifact001 = + (String) (model).getArtifactFiles().getFileList().toArray()[0]; + } private ToscaServiceModel getToscaServiceModel() { Map<String, ServiceTemplate> serviceTemplates = getServiceTemplates(baseServiceTemplateName); diff --git a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java index ab36e8e5a1..9f2f733a64 100644 --- a/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java +++ b/openecomp-be/lib/openecomp-sdc-vendor-software-product-lib/openecomp-sdc-vendor-software-product-core/src/test/java/org/openecomp/sdc/vendorsoftwareproduct/informationArtifact/impl/TxtInformationArtifactGeneratorImplTest.java @@ -21,6 +21,11 @@ package org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Matchers.anyString; +import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.HEADER; +import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.VFC_COMPUTE_CPU_OVER_SUBSCRIPTION; + import org.junit.Assert; import org.mockito.InjectMocks; import org.mockito.Mock; @@ -36,8 +41,6 @@ import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.com import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.general.Hypervisor; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.general.Recovery; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.network.NetworkCapacity; -import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.storage.Backup; -import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.component.storage.Storage; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.IpConfiguration; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.Network; import org.openecomp.sdc.vendorsoftwareproduct.types.questionnaire.nic.NicQuestionnaire; @@ -50,16 +53,10 @@ import org.openecomp.sdc.versioning.dao.types.Version; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import javax.annotation.processing.SupportedAnnotationTypes; import java.io.IOException; import java.util.ArrayList; import java.util.List; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Matchers.anyString; -import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.HEADER; -import static org.openecomp.sdc.vendorsoftwareproduct.informationArtifact.impl.TxtInformationArtifactConstants.VFC_COMPUTE_CPU_OVER_SUBSCRIPTION; - public class TxtInformationArtifactGeneratorImplTest { private static final String NETWORK_DESC = "\"network desc\""; diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java index f0f67cf064..62d7c81cae 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-api/src/main/java/org/openecomp/sdc/versioning/dao/types/Version.java @@ -22,9 +22,12 @@ package org.openecomp.sdc.versioning.dao.types; import com.datastax.driver.mapping.annotations.Transient; import com.datastax.driver.mapping.annotations.UDT; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; @UDT(name = "version", keyspace = "dox") public class Version { + private static final Logger logger = LoggerFactory.getLogger(Version.class); public static final String VERSION_STRING_VIOLATION_MSG = "Version string must be in the format of: {integer}.{integer}"; @@ -59,6 +62,7 @@ public class Version { try { version = new Version(Integer.parseInt(versionLevels[0]), Integer.parseInt(versionLevels[1])); } catch (Exception ex) { + logger.debug(ex.getMessage(), ex); throw new IllegalArgumentException(VERSION_STRING_VIOLATION_MSG); } diff --git a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/VersioningManagerImplTest.java b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/VersioningManagerImplTest.java index d4bccc677b..d35de4f3d1 100644 --- a/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/VersioningManagerImplTest.java +++ b/openecomp-be/lib/openecomp-sdc-versioning-lib/openecomp-sdc-versioning-core/src/test/java/org/openecomp/sdc/versioning/impl/VersioningManagerImplTest.java @@ -21,6 +21,10 @@ package org.openecomp.sdc.versioning.impl; +import static org.mockito.Matchers.anyObject; +import static org.mockito.Mockito.doReturn; +import static org.mockito.Mockito.verify; + import org.mockito.ArgumentCaptor; import org.mockito.Captor; import org.mockito.InjectMocks; @@ -29,7 +33,6 @@ import org.mockito.MockitoAnnotations; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.versioning.dao.VersionInfoDao; import org.openecomp.sdc.versioning.dao.VersionInfoDeletedDao; -import org.openecomp.sdc.versioning.dao.VersionableEntityDao; import org.openecomp.sdc.versioning.dao.types.UserCandidateVersion; import org.openecomp.sdc.versioning.dao.types.Version; import org.openecomp.sdc.versioning.dao.types.VersionInfoDeletedEntity; @@ -43,13 +46,8 @@ import org.testng.annotations.Test; import java.util.Collections; import java.util.HashSet; -import java.util.Map; import java.util.Set; -import static org.mockito.Matchers.anyObject; -import static org.mockito.Mockito.doReturn; -import static org.mockito.Mockito.verify; - public class VersioningManagerImplTest { private static final String USR1 = "usr1"; private static final String USR2 = "usr2"; diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml index 39f02becf8..fe3375a174 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/pom.xml @@ -22,7 +22,7 @@ <dependency> <groupId>org.openecomp.sdc.jtosca</groupId> <artifactId>jtosca</artifactId> - <version>1.1.1-SNAPSHOT</version> + <version>${jtosca.version}</version> </dependency> <dependency> <groupId>org.openecomp.sdc</groupId> @@ -47,5 +47,5 @@ <artifactId>openecomp-tosca-converter-core</artifactId> <version>1.1.0-SNAPSHOT</version> - + </project>
\ No newline at end of file diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java index 9e353a25df..fd382b7899 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaArtifactType.java @@ -29,9 +29,9 @@ public class ToscaArtifactType { private static Configuration config = ConfigurationManager.lookup(); - public static String ARTIFACT_TYPE_PREFIX = + public static final String ARTIFACT_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_ARTIFACT_TYPE); - public static String NATIVE_DEPLOYMENT = "tosca.artifacts.Deployment"; + public static final String NATIVE_DEPLOYMENT = "tosca.artifacts.Deployment"; } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java index b3a0e69c88..33dd9e142c 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaCapabilityType.java @@ -29,26 +29,26 @@ public class ToscaCapabilityType { private static Configuration config = ConfigurationManager.lookup(); - public static String CAPABILITY_PREFIX = + public static final String CAPABILITY_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_CAPABILITY_TYPE); //TOSCA native types - public static String NATIVE_ROOT = "tosca.capabilities.Root"; - public static String NATIVE_NODE = "tosca.capabilities.Node"; - public static String NATIVE_CONTAINER = "tosca.capabilities.Container"; - public static String NATIVE_COMPUTE = "tosca.capabilities.Compute"; - public static String NATIVE_NETWORK_BINDABLE = "tosca.capabilities.network.Bindable"; - public static String NATIVE_SCALABLE = "tosca.capabilities.Scalable"; - public static String NATIVE_OPERATING_SYSTEM = "tosca.capabilities.OperatingSystem"; - public static String NATIVE_ENDPOINT_ADMIN = "tosca.capabilities.Endpoint.Admin"; - public static String NATIVE_ATTACHMENT = "tosca.capabilities.Attachment"; - public static String NATIVE_NETWORK_LINKABLE = "tosca.capabilities.network.Linkable"; - public static String NATIVE_NFV_METRIC = "tosca.capabilities.nfv.Metric"; + public static final String NATIVE_ROOT = "tosca.capabilities.Root"; + public static final String NATIVE_NODE = "tosca.capabilities.Node"; + public static final String NATIVE_CONTAINER = "tosca.capabilities.Container"; + public static final String NATIVE_COMPUTE = "tosca.capabilities.Compute"; + public static final String NATIVE_NETWORK_BINDABLE = "tosca.capabilities.network.Bindable"; + public static final String NATIVE_SCALABLE = "tosca.capabilities.Scalable"; + public static final String NATIVE_OPERATING_SYSTEM = "tosca.capabilities.OperatingSystem"; + public static final String NATIVE_ENDPOINT_ADMIN = "tosca.capabilities.Endpoint.Admin"; + public static final String NATIVE_ATTACHMENT = "tosca.capabilities.Attachment"; + public static final String NATIVE_NETWORK_LINKABLE = "tosca.capabilities.network.Linkable"; + public static final String NATIVE_NFV_METRIC = "tosca.capabilities.nfv.Metric"; //Additional types - public static String METRIC = CAPABILITY_PREFIX + "Metric"; - public static String METRIC_CEILOMETER = CAPABILITY_PREFIX + "metric.Ceilometer"; - public static String METRIC_SNMP_TRAP = CAPABILITY_PREFIX + "metric.SnmpTrap"; - public static String METRIC_SNMP_POLLING = CAPABILITY_PREFIX + "metric.SnmpPolling"; + public static final String METRIC = CAPABILITY_PREFIX + "Metric"; + public static final String METRIC_CEILOMETER = CAPABILITY_PREFIX + "metric.Ceilometer"; + public static final String METRIC_SNMP_TRAP = CAPABILITY_PREFIX + "metric.SnmpTrap"; + public static final String METRIC_SNMP_POLLING = CAPABILITY_PREFIX + "metric.SnmpPolling"; } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java index 37d1d2c4ba..3d5453ac0d 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaDataType.java @@ -29,75 +29,75 @@ public class ToscaDataType { private static Configuration config = ConfigurationManager.lookup(); - public static String DATA_TYPE_PREFIX = + public static final String DATA_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_DATA_TYPE); //TOSCA native types - public static String NATIVE_ROOT = "tosca.datatypes.Root"; - public static String NATIVE_NETWORK_NETWORK_INFO = "tosca.datatypes.network.NetworkInfo"; - public static String NATIVE_NETWORK_PORT_INFO = "tosca.datatypes.network.PortInfo"; + public static final String NATIVE_ROOT = "tosca.datatypes.Root"; + public static final String NATIVE_NETWORK_NETWORK_INFO = "tosca.datatypes.network.NetworkInfo"; + public static final String NATIVE_NETWORK_PORT_INFO = "tosca.datatypes.network.PortInfo"; //Additional types - public static String NOVA_SERVER_PORT_EXTRA_PROPERTIES = + public static final String NOVA_SERVER_PORT_EXTRA_PROPERTIES = DATA_TYPE_PREFIX + "heat.novaServer.network.PortExtraProperties"; - public static String NETWORK_ADDRESS_PAIR = DATA_TYPE_PREFIX + "heat.network.AddressPair"; - public static String NEUTRON_PORT_FIXED_IPS = DATA_TYPE_PREFIX + "heat.neutron.port.FixedIps"; - public static String CONTRAIL_NETWORK_RULE = DATA_TYPE_PREFIX + "heat.contrail.network.rule.Rule"; - public static String CONTRAIL_NETWORK_RULE_LIST = + public static final String NETWORK_ADDRESS_PAIR = DATA_TYPE_PREFIX + "heat.network.AddressPair"; + public static final String NEUTRON_PORT_FIXED_IPS = DATA_TYPE_PREFIX + "heat.neutron.port.FixedIps"; + public static final String CONTRAIL_NETWORK_RULE = DATA_TYPE_PREFIX + "heat.contrail.network.rule.Rule"; + public static final String CONTRAIL_NETWORK_RULE_LIST = DATA_TYPE_PREFIX + "heat.contrail.network.rule.RuleList"; - public static String CONTRAIL_NETWORK_RULE_PORT_PAIRS = + public static final String CONTRAIL_NETWORK_RULE_PORT_PAIRS = DATA_TYPE_PREFIX + "heat.contrail.network.rule.PortPairs"; - public static String CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK = + public static final String CONTRAIL_NETWORK_RULE_VIRTUAL_NETWORK = DATA_TYPE_PREFIX + "heat.contrail.network.rule.VirtualNetwork"; - public static String CONTRAILV2_NETWORK_RULE = + public static final String CONTRAILV2_NETWORK_RULE = DATA_TYPE_PREFIX + "heat.contrailV2.network.rule.Rule"; - public static String CONTRAILV2_NETWORK_RULE_LIST = + public static final String CONTRAILV2_NETWORK_RULE_LIST = DATA_TYPE_PREFIX + "heat.contrailV2.network.rule.RuleList"; - public static String CONTRAILV2_NETWORK_RULE_SRC_PORT_PAIRS = + public static final String CONTRAILV2_NETWORK_RULE_SRC_PORT_PAIRS = DATA_TYPE_PREFIX + "heat.contrailV2.network.rule.SrcPortPairs"; - public static String CONTRAILV2_NETWORK_RULE_DST_PORT_PAIRS = + public static final String CONTRAILV2_NETWORK_RULE_DST_PORT_PAIRS = DATA_TYPE_PREFIX + "heat.contrailV2.network.rule.DstPortPairs"; - public static String CONTRAILV2_NETWORK_RULE_DST_VIRTUAL_NETWORK = + public static final String CONTRAILV2_NETWORK_RULE_DST_VIRTUAL_NETWORK = DATA_TYPE_PREFIX + "heat.contrailV2.network.rule.DstVirtualNetwork"; - public static String CONTRAILV2_NETWORK_RULE_SRC_VIRTUAL_NETWORK = + public static final String CONTRAILV2_NETWORK_RULE_SRC_VIRTUAL_NETWORK = DATA_TYPE_PREFIX + "heat.contrailV2.network.rule.SrcVirtualNetwork"; - public static String CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_PROPERTIES = + public static final String CONTRAILV2_VIRTUAL_MACHINE_INTERFACE_PROPERTIES = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.machine.interface.Properties"; - public static String CONTRAILV2_NETWORK_RULE_ACTION_LIST = + public static final String CONTRAILV2_NETWORK_RULE_ACTION_LIST = DATA_TYPE_PREFIX + "heat.contrailV2.network.rule.ActionList"; - public static String CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA = + public static final String CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.network.rule.IpamRefData"; - public static String CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET_LIST = + public static final String CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET_LIST = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.network.rule.ref.data.IpamSubnetList"; - public static String CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET = + public static final String CONTRAILV2_VIRTUAL_NETWORK_IPAM_REF_DATA_IPAM_SUBNET = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.network.rule.ref.data.IpamSubnet"; - public static String CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA = + public static final String CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.network.rule.RefData"; - public static String CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA_SEQUENCE = + public static final String CONTRAILV2_VIRTUAL_NETWORK_POLICY_REF_DATA_SEQUENCE = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.network.rule.RefDataSequence"; - public static String NOVA_SERVER_NETWORK_ADDRESS_INFO = + public static final String NOVA_SERVER_NETWORK_ADDRESS_INFO = DATA_TYPE_PREFIX + "heat.novaServer.network.AddressInfo"; - public static String NEUTRON_SUBNET = DATA_TYPE_PREFIX + "heat.network.neutron.Subnet"; - public static String NETWORK_ALLOCATION_POOL = DATA_TYPE_PREFIX + "heat.network.AllocationPool"; - public static String NETWORK_HOST_ROUTE = DATA_TYPE_PREFIX + "heat.network.subnet.HostRoute"; - public static String SUBSTITUTION_FILTERING = + public static final String NEUTRON_SUBNET = DATA_TYPE_PREFIX + "heat.network.neutron.Subnet"; + public static final String NETWORK_ALLOCATION_POOL = DATA_TYPE_PREFIX + "heat.network.AllocationPool"; + public static final String NETWORK_HOST_ROUTE = DATA_TYPE_PREFIX + "heat.network.subnet.HostRoute"; + public static final String SUBSTITUTION_FILTERING = DATA_TYPE_PREFIX + "heat.substitution.SubstitutionFiltering"; - public static String NEUTRON_SECURITY_RULES_RULE = + public static final String NEUTRON_SECURITY_RULES_RULE = DATA_TYPE_PREFIX + "heat.network.neutron.SecurityRules.Rule"; - public static String CONTRAIL_STATIC_ROUTE = + public static final String CONTRAIL_STATIC_ROUTE = DATA_TYPE_PREFIX + "heat.network.contrail.port.StaticRoute"; - public static String CONTRAIL_ADDRESS_PAIR = + public static final String CONTRAIL_ADDRESS_PAIR = DATA_TYPE_PREFIX + "heat.network.contrail.AddressPair"; - public static String CONTRAIL_INTERFACE_DATA = + public static final String CONTRAIL_INTERFACE_DATA = DATA_TYPE_PREFIX + "heat.network.contrail.InterfaceData"; - public static String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_PROPERTIES = + public static final String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_PROPERTIES = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.machine.subInterface.Properties"; - public static String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_MAC_ADDRESS = + public static final String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_MAC_ADDRESS = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.machine.subInterface.MacAddress"; - public static String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_ADDRESS_PAIRS = + public static final String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_ADDRESS_PAIRS = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.machine.subInterface.AddressPairs"; - public static String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_ADDRESS_PAIR = + public static final String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_ADDRESS_PAIR = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.machine.subInterface.AddressPair"; - public static String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_ADDRESS_PAIR_IP = + public static final String CONTRAILV2_VIRTUAL_MACHINE_SUB_INTERFACE_ADDRESS_PAIR_IP = DATA_TYPE_PREFIX + "heat.contrailV2.virtual.machine.subInterface.AddressPairIp"; } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java index c2070c34f4..a4a083b5c7 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaGroupType.java @@ -28,14 +28,14 @@ public class ToscaGroupType { private static Configuration config = ConfigurationManager.lookup(); - public static String GROUP_TYPE_PREFIX = + public static final String GROUP_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_GROUP_TYPE); //TOSCA native types - public static String NATIVE_ROOT = "tosca.groups.Root"; + public static final String NATIVE_ROOT = "tosca.groups.Root"; //Additional types - public static String HEAT_STACK = GROUP_TYPE_PREFIX + "heat.HeatStack"; + public static final String HEAT_STACK = GROUP_TYPE_PREFIX + "heat.HeatStack"; } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java index 745f77f7f5..d8e090261c 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaNodeType.java @@ -29,64 +29,64 @@ public class ToscaNodeType { private static Configuration config = ConfigurationManager.lookup(); - public static String VFC_NODE_TYPE_PREFIX = + public static final String VFC_NODE_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_NODE_TYPE_VFC); - public static String CP_NODE_TYPE_PREFIX = + public static final String CP_NODE_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_NODE_TYPE_CP); - public static String NETWORK_NODE_TYPE_PREFIX = + public static final String NETWORK_NODE_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_NODE_TYPE_NETWORK); - public static String ABSTRACT_NODE_TYPE_PREFIX = + public static final String ABSTRACT_NODE_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_NODE_TYPE_ABSTARCT); - public static String RULE_NODE_TYPE_PREFIX = + public static final String RULE_NODE_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_NODE_TYPE_RULE); - public static String NODE_TYPE_PREFIX = + public static final String NODE_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX); //TOSCA native types - public static String NATIVE_COMPUTE = "tosca.nodes.Compute"; - public static String NATIVE_ROOT = "tosca.nodes.Root"; - public static String NATIVE_BLOCK_STORAGE = "tosca.nodes.BlockStorage"; - public static String NATIVE_NETWORK = "tosca.nodes.network.Network"; - public static String NATIVE_NETWORK_PORT = "tosca.nodes.network.Port"; + public static final String NATIVE_COMPUTE = "tosca.nodes.Compute"; + public static final String NATIVE_ROOT = "tosca.nodes.Root"; + public static final String NATIVE_BLOCK_STORAGE = "tosca.nodes.BlockStorage"; + public static final String NATIVE_NETWORK = "tosca.nodes.network.Network"; + public static final String NATIVE_NETWORK_PORT = "tosca.nodes.network.Port"; //Additional types - public static String NOVA_SERVER = VFC_NODE_TYPE_PREFIX + "heat.nova.Server"; - public static String CINDER_VOLUME = VFC_NODE_TYPE_PREFIX + "heat.cinder.Volume"; - public static String COMPUTE = VFC_NODE_TYPE_PREFIX + "Compute"; - public static String CONTRAIL_COMPUTE = VFC_NODE_TYPE_PREFIX + "heat.contrail.Compute"; + public static final String NOVA_SERVER = VFC_NODE_TYPE_PREFIX + "heat.nova.Server"; + public static final String CINDER_VOLUME = VFC_NODE_TYPE_PREFIX + "heat.cinder.Volume"; + public static final String COMPUTE = VFC_NODE_TYPE_PREFIX + "Compute"; + public static final String CONTRAIL_COMPUTE = VFC_NODE_TYPE_PREFIX + "heat.contrail.Compute"; - public static String NEUTRON_SECURITY_RULES = + public static final String NEUTRON_SECURITY_RULES = RULE_NODE_TYPE_PREFIX + "heat.network.neutron.SecurityRules"; - public static String CONTRAILV2_NETWORK_RULE = + public static final String CONTRAILV2_NETWORK_RULE = RULE_NODE_TYPE_PREFIX + "heat.network.contrailV2.NetworkRules"; - public static String CONTRAIL_NETWORK_RULE = + public static final String CONTRAIL_NETWORK_RULE = RULE_NODE_TYPE_PREFIX + "heat.network.contrail.NetworkRules"; - public static String NEUTRON_NET = NETWORK_NODE_TYPE_PREFIX + "heat.network.neutron.Net"; - public static String CONTRAILV2_VIRTUAL_NETWORK = + public static final String NEUTRON_NET = NETWORK_NODE_TYPE_PREFIX + "heat.network.neutron.Net"; + public static final String CONTRAILV2_VIRTUAL_NETWORK = NETWORK_NODE_TYPE_PREFIX + "heat.network.contrailV2.VirtualNetwork"; - public static String CONTRAIL_VIRTUAL_NETWORK = + public static final String CONTRAIL_VIRTUAL_NETWORK = NETWORK_NODE_TYPE_PREFIX + "heat.network.contrail.VirtualNetwork"; - public static String NETWORK = NETWORK_NODE_TYPE_PREFIX + "network.Network"; + public static final String NETWORK = NETWORK_NODE_TYPE_PREFIX + "network.Network"; - public static String NEUTRON_PORT = CP_NODE_TYPE_PREFIX + "heat.network.neutron.Port"; - public static String CONTRAILV2_VIRTUAL_MACHINE_INTERFACE = + public static final String NEUTRON_PORT = CP_NODE_TYPE_PREFIX + "heat.network.neutron.Port"; + public static final String CONTRAILV2_VIRTUAL_MACHINE_INTERFACE = CP_NODE_TYPE_PREFIX + "heat.contrailV2.VirtualMachineInterface"; - public static String CONTRAIL_PORT = CP_NODE_TYPE_PREFIX + "heat.network.contrail.Port"; - public static String NETWORK_PORT = CP_NODE_TYPE_PREFIX + "network.Port"; - public static String NETWORK_SUB_INTERFACE = CP_NODE_TYPE_PREFIX + "network.SubInterface"; - public static String CONTRAILV2_VLAN_SUB_INTERFACE = CP_NODE_TYPE_PREFIX + public static final String CONTRAIL_PORT = CP_NODE_TYPE_PREFIX + "heat.network.contrail.Port"; + public static final String NETWORK_PORT = CP_NODE_TYPE_PREFIX + "network.Port"; + public static final String NETWORK_SUB_INTERFACE = CP_NODE_TYPE_PREFIX + "network.SubInterface"; + public static final String CONTRAILV2_VLAN_SUB_INTERFACE = CP_NODE_TYPE_PREFIX + "heat.network.contrailV2.VLANSubInterface"; - public static String ABSTRACT_SUBSTITUTE = ABSTRACT_NODE_TYPE_PREFIX + "AbstractSubstitute"; - public static String VFC_ABSTRACT_SUBSTITUTE = ABSTRACT_NODE_TYPE_PREFIX + "VFC"; - public static String CONTRAIL_ABSTRACT_SUBSTITUTE = + public static final String ABSTRACT_SUBSTITUTE = ABSTRACT_NODE_TYPE_PREFIX + "AbstractSubstitute"; + public static final String VFC_ABSTRACT_SUBSTITUTE = ABSTRACT_NODE_TYPE_PREFIX + "VFC"; + public static final String CONTRAIL_ABSTRACT_SUBSTITUTE = ABSTRACT_NODE_TYPE_PREFIX + "contrail.AbstractSubstitute"; - public static String COMPLEX_VFC_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "ComplexVFC"; + public static final String COMPLEX_VFC_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "ComplexVFC"; //Questionnaire to Tosca Types - public static String VNF_CONFIG_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "VnfConfiguration"; - public static String MULTIFLAVOR_VFC_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "MultiFlavorVFC"; - public static String MULTIDEPLOYMENTFLAVOR_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + public static final String VNF_CONFIG_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "VnfConfiguration"; + public static final String MULTIFLAVOR_VFC_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "MultiFlavorVFC"; + public static final String MULTIDEPLOYMENTFLAVOR_NODE_TYPE = ABSTRACT_NODE_TYPE_PREFIX + "MultiDeploymentFlavor.CVFC"; } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java index ed0232929b..ad24e260b1 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaPolicyType.java @@ -28,13 +28,13 @@ public class ToscaPolicyType { private static Configuration config = ConfigurationManager.lookup(); - public static String POLICY_TYPE_PREFIX = + public static final String POLICY_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_POLICY_TYPE); //TOSCA native types - public static String NATIVE_PLACEMENT = "tosca.policy.placement"; + public static final String NATIVE_PLACEMENT = "tosca.policy.placement"; //Additional types - public static String PLACEMENT_ANTILOCATE = POLICY_TYPE_PREFIX + "placement.Antilocate"; - public static String PLACEMENT_COLOCATE = POLICY_TYPE_PREFIX + "placement.Colocate"; + public static final String PLACEMENT_ANTILOCATE = POLICY_TYPE_PREFIX + "placement.Antilocate"; + public static final String PLACEMENT_COLOCATE = POLICY_TYPE_PREFIX + "placement.Colocate"; } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java index f1ef5ab234..0fcdc3a590 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/ToscaRelationshipType.java @@ -28,16 +28,16 @@ public class ToscaRelationshipType { private static Configuration config = ConfigurationManager.lookup(); - public static String RELATIONSHIP_TYPE_PREFIX = + public static final String RELATIONSHIP_TYPE_PREFIX = config.getAsString(ConfigConstants.NAMESPACE, ConfigConstants.PREFIX_RELATIONSHIP_TYPE); - public static String NATIVE_ROOT = "tosca.relationships.Root"; - public static String NATIVE_ATTACHES_TO = "tosca.relationships.AttachesTo"; - public static String NATIVE_DEPENDS_ON = "tosca.relationships.DependsOn"; - public static String NATIVE_NETWORK_LINK_TO = "tosca.relationships.network.LinksTo"; - public static String NATIVE_NETWORK_BINDS_TO = "tosca.relationships.network.BindsTo"; - public static String CINDER_VOLUME_ATTACHES_TO = + public static final String NATIVE_ROOT = "tosca.relationships.Root"; + public static final String NATIVE_ATTACHES_TO = "tosca.relationships.AttachesTo"; + public static final String NATIVE_DEPENDS_ON = "tosca.relationships.DependsOn"; + public static final String NATIVE_NETWORK_LINK_TO = "tosca.relationships.network.LinksTo"; + public static final String NATIVE_NETWORK_BINDS_TO = "tosca.relationships.network.BindsTo"; + public static final String CINDER_VOLUME_ATTACHES_TO = RELATIONSHIP_TYPE_PREFIX + "VolumeAttachesTo"; - public static String ATTACHES_TO = RELATIONSHIP_TYPE_PREFIX + "AttachesTo"; + public static final String ATTACHES_TO = RELATIONSHIP_TYPE_PREFIX + "AttachesTo"; } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Old1610ServiceTemplate.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Old1610ServiceTemplate.java index 2ee7bca5bc..c4aa4ec6aa 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Old1610ServiceTemplate.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/datatypes/model/Old1610ServiceTemplate.java @@ -1,19 +1,5 @@ package org.openecomp.sdc.tosca.datatypes.model; -import org.openecomp.sdc.tosca.datatypes.model.ArtifactType; -import org.openecomp.sdc.tosca.datatypes.model.CapabilityType; -import org.openecomp.sdc.tosca.datatypes.model.DataType; -import org.openecomp.sdc.tosca.datatypes.model.GroupType; -import org.openecomp.sdc.tosca.datatypes.model.Import; -import org.openecomp.sdc.tosca.datatypes.model.InterfaceType; -import org.openecomp.sdc.tosca.datatypes.model.NodeType; -import org.openecomp.sdc.tosca.datatypes.model.PolicyType; -import org.openecomp.sdc.tosca.datatypes.model.RelationshipType; -import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; -import org.openecomp.sdc.tosca.datatypes.model.Template; -import org.openecomp.sdc.tosca.datatypes.model.TopologyTemplate; - -import java.util.List; import java.util.Map; /** diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java index d908b2cf74..0effd40519 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/DataModelUtil.java @@ -25,6 +25,8 @@ import org.apache.commons.collections4.MapUtils; import org.openecomp.core.utilities.CommonMethods; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataDebugMessage; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; @@ -84,6 +86,7 @@ public class DataModelUtil { */ private static MdcDataDebugMessage mdcDataDebugMessage = new MdcDataDebugMessage(); + private static final Logger logger = LoggerFactory.getLogger(DataModelUtil.class); /** * Add substitution mapping. @@ -698,7 +701,7 @@ public class DataModelUtil { * @return the metadata */ public static Map<String, String> createMetadata(String templateName, String templateVersion, - String templateAuthor) { + String templateAuthor) { mdcDataDebugMessage.debugEntryMessage(null, null); @@ -1318,7 +1321,7 @@ public class DataModelUtil { * @return the relationship template */ public static Map<String, RelationshipTemplate> getRelationshipTemplates(ServiceTemplate - serviceTemplate) { + serviceTemplate) { if (serviceTemplate == null || serviceTemplate.getTopology_template() == null || serviceTemplate.getTopology_template().getRelationship_templates() == null) { @@ -1442,9 +1445,11 @@ public class DataModelUtil { ObjectInputStream objectInputStream = new ObjectInputStream(byteArrayInputStream); clonedObjectValue = objectInputStream.readObject(); } catch (NotSerializableException ex) { - return getClonedObject(obj, obj.getClass()); + logger.debug(ex.getMessage(), ex); + return getClonedObject(obj, obj.getClass()); } catch (IOException | ClassNotFoundException ex) { - return null; + logger.debug(ex.getMessage(), ex); + return null; } return clonedObjectValue; } @@ -1575,4 +1580,9 @@ public class DataModelUtil { mdcDataDebugMessage.debugExitMessage(null, null); } + + public static boolean isNodeTemplateSectionMissingFromServiceTemplate(ServiceTemplate serviceTemplate){ + return Objects.isNull(serviceTemplate.getTopology_template() ) + || MapUtils.isEmpty(serviceTemplate.getTopology_template().getNode_templates()); + } } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java index 9a3ed8e73f..fb7010358b 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/main/java/org/openecomp/sdc/tosca/services/impl/ToscaFileOutputServiceCsarImpl.java @@ -25,6 +25,8 @@ import org.openecomp.core.utilities.file.FileContentHandler; import org.openecomp.core.utilities.file.FileUtils; import org.openecomp.sdc.common.errors.CoreException; import org.openecomp.sdc.datatypes.error.ErrorLevel; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.logging.context.impl.MdcDataErrorMessage; import org.openecomp.sdc.logging.types.LoggerConstants; import org.openecomp.sdc.logging.types.LoggerErrorCode; @@ -64,6 +66,7 @@ public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService { private static final String META_FILE_DELIMITER = ":"; private static final String SPACE = " "; private static final String FILE_SEPARATOR = File.separator; + private static final Logger logger = LoggerFactory.getLogger(ToscaFileOutputServiceCsarImpl.class); @Override @@ -146,7 +149,7 @@ public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService { try { zos.closeEntry(); } catch (IOException ignore) { - //do nothing + logger.debug(ignore.getMessage(), ignore); } } } @@ -169,7 +172,7 @@ public class ToscaFileOutputServiceCsarImpl implements ToscaFileOutputService { try { zos.closeEntry(); } catch (IOException ignore) { - //do nothing + logger.debug(ignore.getMessage(), ignore); } } } diff --git a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java index 9a90d4539e..ca0c0ea506 100644 --- a/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java +++ b/openecomp-be/lib/openecomp-tosca-lib/src/test/java/org/openecomp/sdc/tosca/TestUtil.java @@ -20,6 +20,8 @@ package org.openecomp.sdc.tosca; +import org.openecomp.sdc.logging.api.Logger; +import org.openecomp.sdc.logging.api.LoggerFactory; import org.openecomp.sdc.tosca.datatypes.ToscaServiceModel; import org.openecomp.sdc.tosca.datatypes.model.ServiceTemplate; import org.openecomp.sdc.tosca.services.ToscaExtensionYamlUtil; @@ -36,6 +38,8 @@ import java.util.Map; public class TestUtil { + private static final Logger logger = LoggerFactory.getLogger(TestUtil.class); + public static ToscaServiceModel loadToscaServiceModel(String serviceTemplatesPath, String globalServiceTemplatesPath, String entryDefinitionServiceTemplate) @@ -84,6 +88,7 @@ public class TestUtil { try { yamlFile.close(); } catch (IOException ignore) { + logger.debug(ignore.getMessage(), ignore); } } catch (FileNotFoundException e) { throw e; diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java index e0f3e016fe..1711e41a65 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/MigrationMain.java @@ -70,7 +70,7 @@ public class MigrationMain { private static Logger logger = LoggerFactory.getLogger(MigrationMain.class); private static int status = 0; - public static Map<String, VersionInfoEntity> versionInfoMap = new HashMap<>(); + private static Map<String, VersionInfoEntity> versionInfoMap = new HashMap<>(); public static void main(String[] args) { CassandraElementRepository cassandraElementRepository = new CassandraElementRepository(); @@ -116,8 +116,7 @@ public class MigrationMain { convertVsp(context, itemCassandraDao, versionCassandraDao, cassandraElementRepository); printMessage(logger, "Converted VSPs\n"); } catch (Exception e) { - printMessage(logger, "Could not perform migration for VSPs ,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } @@ -125,9 +124,7 @@ public class MigrationMain { convertOrchestrationTemplateCandidate(context, cassandraElementRepository); printMessage(logger, "Converted OrchestrationTemplateCandidates\n"); } catch (Exception e) { - printMessage(logger, - "Could not perform migration for OrchestrationTemplateCandidates ,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } @@ -136,61 +133,49 @@ public class MigrationMain { convertComponent(context, cassandraElementRepository); printMessage(logger, "Converted Components\n"); } catch (Exception e) { - printMessage(logger, - "Could not perform migration for Components ,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertNic(context, cassandraElementRepository); printMessage(logger, "Converted Nics\n"); } catch (Exception e) { - printMessage(logger, "Could not perform migration for Nics ,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertNetwork(context, cassandraElementRepository); printMessage(logger, "Converted Networks\n"); } catch (Exception e) { - printMessage(logger, - "Could not perform migration for Networks ,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertMibs(context, cassandraElementRepository); printMessage(logger, "Converted MIBs\n"); } catch (Exception e) { - printMessage(logger, "Could not perform migration for MIBs,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertServiceArtifact(context, cassandraElementRepository); printMessage(logger, "Converted Service Artifacts\n"); } catch (Exception e) { - printMessage(logger, - "Could not perform migration for Service Artifacts,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertServiceTemplate(context, cassandraElementRepository); printMessage(logger, "Converted Service Templates\n"); } catch (Exception e) { - printMessage(logger, - "Could not perform migration for Service Templates,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertProcesses(context, cassandraElementRepository); printMessage(logger, "Converted Processes\n"); } catch (Exception e) { - printMessage(logger, - "Could not perform migration for Processes,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } @@ -199,40 +184,35 @@ public class MigrationMain { convertVlm(context, itemCassandraDao, versionCassandraDao, cassandraElementRepository); printMessage(logger, "Converted VLMs\n"); } catch (Exception e) { - printMessage(logger, "Could not perform migration for VLMs,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertLKG(context, cassandraElementRepository); printMessage(logger, "Converted LKGs\n"); } catch (Exception e) { - printMessage(logger, "Could not perform migration for LKGs,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertFeatureGroup(context, cassandraElementRepository); printMessage(logger, "Converted Feature Groups\n"); } catch (Exception e) { - printMessage(logger, "Could not perform migration for Feature Groups,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertEP(context, cassandraElementRepository); printMessage(logger, "Converted EPs\n"); } catch (Exception e) { - printMessage(logger, "Could not perform migration for EPs,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } try { convertLicenseAgreement(context, cassandraElementRepository); printMessage(logger, "Converted License Agreements\n"); } catch (Exception e) { - printMessage(logger, "Could not perform migration for License Agreements,the error is :"); - e.printStackTrace(); + logger.debug(e.getMessage(), e); status = -1; } } @@ -482,5 +462,8 @@ public class MigrationMain { .getViewableVersions().contains(versionId)); } - + public static Map<String, VersionInfoEntity> getVersionInfoMap() + { + return versionInfoMap; + } } diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/OrchestrationTemplateCandidateConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/OrchestrationTemplateCandidateConvertor.java index c6778544fd..e6ceb360bd 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/OrchestrationTemplateCandidateConvertor.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/OrchestrationTemplateCandidateConvertor.java @@ -1,25 +1,17 @@ package org.openecomp.core.migration.convertors; import com.amdocs.zusammen.datatypes.item.ElementContext; -import com.amdocs.zusammen.datatypes.item.Info; -import com.amdocs.zusammen.datatypes.item.ItemVersionData; import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext; import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement; import org.openecomp.core.migration.MigrationMain; -import org.openecomp.core.migration.loaders.VspInformation; import org.openecomp.core.migration.store.ElementHandler; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; -import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; -import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementPropertyName; -import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementType; import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateDataEntity; -import java.util.HashSet; import java.util.List; -import java.util.Set; public class OrchestrationTemplateCandidateConvertor { diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VlmConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VlmConvertor.java index 2e5fac830e..2e483747ed 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VlmConvertor.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VlmConvertor.java @@ -5,9 +5,7 @@ import com.amdocs.zusammen.datatypes.item.Info; import com.amdocs.zusammen.datatypes.item.ItemVersionData; import com.amdocs.zusammen.plugin.statestore.cassandra.dao.types.ElementEntityContext; import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement; -import org.openecomp.core.migration.loaders.VspInformation; import org.openecomp.core.migration.store.ElementHandler; -import org.openecomp.sdc.vendorlicense.dao.impl.zusammen.VendorLicenseModelDaoZusammenImpl; import org.openecomp.sdc.vendorlicense.dao.types.VendorLicenseModelEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.StructureElement; diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceArtifactConvertor.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceArtifactConvertor.java index 76e35b56c4..15b8ad729a 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceArtifactConvertor.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/convertors/VspServiceArtifactConvertor.java @@ -7,11 +7,8 @@ import com.amdocs.zusammen.sdk.collaboration.types.CollaborationElement; import org.openecomp.core.migration.store.ElementHandler; import org.openecomp.core.model.types.ServiceArtifact; import org.openecomp.core.utilities.file.FileUtils; -import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementPropertyName; -import org.openecomp.sdc.vendorsoftwareproduct.dao.impl.zusammen.ElementType; import org.openecomp.sdc.model.impl.zusammen.StructureElement; - import java.util.HashSet; import java.util.List; import java.util.Set; diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/OrchestrationTemplateCandidateCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/OrchestrationTemplateCandidateCassandraLoader.java index b8c173843d..09da455847 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/OrchestrationTemplateCandidateCassandraLoader.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/OrchestrationTemplateCandidateCassandraLoader.java @@ -25,7 +25,6 @@ import com.datastax.driver.mapping.annotations.Accessor; import com.datastax.driver.mapping.annotations.Query; import org.openecomp.core.nosqldb.api.NoSqlDb; import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.ComponentEntity; import org.openecomp.sdc.vendorsoftwareproduct.dao.type.OrchestrationTemplateCandidateDataEntity; import java.util.Collection; diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorSoftwareProductInfoLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorSoftwareProductInfoLoader.java index bac4b6e440..26fc23cf5d 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorSoftwareProductInfoLoader.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VendorSoftwareProductInfoLoader.java @@ -20,21 +20,14 @@ package org.openecomp.core.migration.loaders; -import com.datastax.driver.core.ResultSet; -import com.datastax.driver.core.UDTValue; import com.datastax.driver.mapping.Mapper; import com.datastax.driver.mapping.Result; import com.datastax.driver.mapping.UDTMapper; import com.datastax.driver.mapping.annotations.Accessor; import com.datastax.driver.mapping.annotations.Query; -import org.openecomp.core.dao.impl.CassandraBaseDao; import org.openecomp.core.nosqldb.api.NoSqlDb; import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; -import org.openecomp.sdc.vendorsoftwareproduct.dao.VendorSoftwareProductInfoDao; -import org.openecomp.sdc.vendorsoftwareproduct.dao.type.VspDetails; -import org.openecomp.sdc.versioning.VersioningManagerFactory; import org.openecomp.sdc.versioning.dao.types.Version; -import org.openecomp.sdc.versioning.types.VersionableEntityMetadata; import java.util.Collection; diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VersionInfoCassandraLoader.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VersionInfoCassandraLoader.java index 2a6efd22f3..725298b195 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VersionInfoCassandraLoader.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/loaders/VersionInfoCassandraLoader.java @@ -24,10 +24,8 @@ import com.datastax.driver.mapping.Mapper; import com.datastax.driver.mapping.Result; import com.datastax.driver.mapping.annotations.Accessor; import com.datastax.driver.mapping.annotations.Query; -import org.openecomp.core.dao.impl.CassandraBaseDao; import org.openecomp.core.nosqldb.api.NoSqlDb; import org.openecomp.core.nosqldb.factory.NoSqlDbFactory; -import org.openecomp.sdc.versioning.dao.VersionInfoDao; import org.openecomp.sdc.versioning.dao.types.VersionInfoEntity; import java.util.Collection; diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ElementHandler.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ElementHandler.java index 34e7d79001..548a8d989b 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ElementHandler.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ElementHandler.java @@ -104,7 +104,7 @@ public class ElementHandler { private static Id getVersionId(String itemId, Version versionId) { VersionInfoEntity versionInfo = - MigrationMain.versionInfoMap.get(itemId); + MigrationMain.getVersionInfoMap().get(itemId); if (versionInfo == null) { return new Id(versionId.toString()); } @@ -121,7 +121,7 @@ public class ElementHandler { private static boolean isActiveVersion(String itemId, Version versionId) { VersionInfoEntity versionInfo = - MigrationMain.versionInfoMap.get(itemId); + MigrationMain.getVersionInfoMap().get(itemId); return versionInfo != null && versionInfo.getActiveVersion().equals(versionId); } diff --git a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ItemHandler.java b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ItemHandler.java index 97f5aaf265..801984ab24 100644 --- a/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ItemHandler.java +++ b/openecomp-be/tools/migration/1702_to_1707_zusammen/src/main/java/org/openecomp/core/migration/store/ItemHandler.java @@ -94,7 +94,7 @@ public class ItemHandler { private static Id getVersionId(String itemId, Version versionId) { VersionInfoEntity versionInfo = - MigrationMain.versionInfoMap.get(itemId); + MigrationMain.getVersionInfoMap().get(itemId); if (versionInfo == null) { return new Id(versionId.toString()); } @@ -110,7 +110,7 @@ public class ItemHandler { } private static boolean isActiveVersion(String itemId, Version versionId) { VersionInfoEntity versionInfo = - MigrationMain.versionInfoMap.get(itemId); + MigrationMain.getVersionInfoMap().get(itemId); if (versionInfo == null) { return false; } diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java index 685f70db98..487b4131e6 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ExportDataCommand.java @@ -1,5 +1,7 @@ package org.openecomp.core.tools.Commands; +import static java.nio.file.Files.createDirectories; + import com.amdocs.zusammen.datatypes.SessionContext; import org.apache.commons.io.FileUtils; import org.openecomp.core.tools.Commands.exportdata.ElementHandler; @@ -18,12 +20,8 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.time.LocalDateTime; import java.time.format.DateTimeFormatter; -import java.util.ArrayList; import java.util.HashSet; -import java.util.List; import java.util.Set; - -import static java.nio.file.Files.createDirectories; public class ExportDataCommand { private static final Logger logger = LoggerFactory.getLogger(ExportDataCommand.class); @@ -45,7 +43,6 @@ public class ExportDataCommand { FileUtils.forceDelete(rootDir.toFile()); } catch (Exception ex) { logger.error(ex.getMessage(), ex); - ex.printStackTrace(); } } diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java index 57486b81e3..cebff91160 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ImportCommand.java @@ -24,19 +24,21 @@ public class ImportCommand { if (zippedFile == null){ logger.error("Import must have a valid file as an input."); } - zippedFile = zippedFile.replaceAll("\\r", ""); - if(filterItem != null) { - filterItem = filterItem.replaceAll("\\r", ""); + if (zippedFile != null) { + zippedFile = zippedFile.replaceAll("\\r", ""); + if (filterItem != null) { + filterItem = filterItem.replaceAll("\\r", ""); + } + Path rootDir = Paths.get(ImportProperties.ROOT_DIRECTORY); + ExportDataCommand.initDir(rootDir); + ZipUtils.unzip(Paths.get(zippedFile), rootDir); + TreeWalker.walkFiles(context, rootDir, filterItem); + FileUtils.forceDelete(rootDir.toFile()); // clear all unzip data at the end. } - Path rootDir = Paths.get(ImportProperties.ROOT_DIRECTORY); - ExportDataCommand.initDir(rootDir); - ZipUtils.unzip(Paths.get(zippedFile), rootDir); - TreeWalker.walkFiles(context, rootDir, filterItem); - FileUtils.forceDelete(rootDir.toFile()); // clear all unzip data at the end. + } catch (Exception ex) { logger.error(ex.getMessage(), ex); - ex.printStackTrace(); } } diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ResetOldVersion.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ResetOldVersion.java index 7058c57e85..031d1328b5 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ResetOldVersion.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/ResetOldVersion.java @@ -16,9 +16,9 @@ import java.util.*; public class ResetOldVersion { - public static Map<String, List<String>> itemVersionMap = new HashMap<>(); + private static Map<String, List<String>> itemVersionMap = new HashMap<>(); - public static int count =0; + private static int count =0; public static void reset(SessionContext context, String oldVersion,String emptyOldVersion) { diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java index 49eaaeaa76..e03b7ffa82 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ElementHandler.java @@ -94,7 +94,6 @@ public class ElementHandler { } catch (Exception ex) { logger.error(ex.getMessage(), ex); - ex.printStackTrace(); } } diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java index 710b731f8b..ebbfb56ed0 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/ItemHandler.java @@ -76,7 +76,6 @@ public class ItemHandler { write(itemFilePath, itemJson.getBytes()); } catch (Exception ex) { logger.error(ex.getMessage(), ex); - ex.printStackTrace(); } } diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java index e8e703bff0..4ff562484c 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/exportdata/VersionHandler.java @@ -51,7 +51,6 @@ public class VersionHandler { write(versionFilePath, versionJson.getBytes()); } catch (Exception ex) { logger.error(ex.getMessage(), ex); - ex.printStackTrace(); } } @@ -68,7 +67,6 @@ public class VersionHandler { } } catch (Exception ex) { logger.error(ex.getMessage(), ex); - ex.printStackTrace(); } } diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java index d51458aff1..d439468e97 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ElementImport.java @@ -91,7 +91,6 @@ public class ElementImport { versionCassandraLoader.insertElementToVersion(elementEntity); } catch (Exception ex) { logger.error(ex.getMessage(), ex); - ex.printStackTrace(); } } diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java index 9ec5d639c2..4dd4a1f2c8 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/ItemImport.java @@ -25,7 +25,7 @@ public class ItemImport { return; } String itemJson = new String(Files.readAllBytes(itemPath)); - if (itemJson == null || itemJson.trim().isEmpty()) { + if (itemJson.trim().isEmpty()) { return; } Item item = JsonUtil.json2Object(itemJson, Item.class); @@ -35,7 +35,6 @@ public class ItemImport { System.out.println("Item Created :"+item.getInfo().getName()+" , "+item.getId()); } catch (Exception ex) { logger.error(ex.getMessage(), ex); - ex.printStackTrace(); } } diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java index 15f8b02e2b..30c4152491 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/TreeWalker.java @@ -4,14 +4,10 @@ import com.amdocs.zusammen.datatypes.SessionContext; import org.openecomp.sdc.logging.api.Logger; import org.openecomp.sdc.logging.api.LoggerFactory; -import javax.validation.constraints.Min; import java.io.File; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; import java.util.stream.Stream; public class TreeWalker { diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java index 8f6c67d212..48433d8a90 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionImport.java @@ -26,7 +26,7 @@ public class VersionImport { return; } String versionJson = new String(Files.readAllBytes(versionPath)); - if (versionJson == null || versionJson.trim().isEmpty()) { + if (versionJson.trim().isEmpty()) { return; } VersionEntity versionEntity = JsonUtil.json2Object(versionJson, VersionEntity.class); diff --git a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java index 5da7407c9f..e9d4174d6c 100644 --- a/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java +++ b/openecomp-be/tools/zusammen-tools/src/main/java/org/openecomp/core/tools/Commands/importdata/VersionInfoImport.java @@ -26,7 +26,7 @@ public class VersionInfoImport { return; } String versionInfoJson = new String(Files.readAllBytes(versionInfoFilePath)); - if (versionInfoJson == null || versionInfoJson.trim().isEmpty()) { + if (versionInfoJson.trim().isEmpty()) { return; } VersionInfoEntity versionInfoEntity = JsonUtil.json2Object(versionInfoJson, VersionInfoEntity.class); @@ -6,7 +6,7 @@ <artifactId>sdc-main</artifactId> <version>1.1.0-SNAPSHOT</version> <packaging>pom</packaging> - + <name>sdc</name> <properties> @@ -381,9 +381,9 @@ <properties> <ecomp.version>1.2.7</ecomp.version> - <artifact-generator-api.version>1710.0.0-SNAPSHOT</artifact-generator-api.version> - <artifact-generator-core.version>1710.0.0-SNAPSHOT</artifact-generator-core.version> - <dox-common-lib.version>1710.0.0-SNAPSHOT</dox-common-lib.version> + <artifact-generator-api.version>1710.0.0</artifact-generator-api.version> + <artifact-generator-core.version>1710.0.0</artifact-generator-core.version> + <dox-common-lib.version>1710.0.0</dox-common-lib.version> <sdc-tosca-parser.version>1.1.14</sdc-tosca-parser.version> </properties> @@ -398,6 +398,7 @@ <activeByDefault>false</activeByDefault> </activation> <modules> + <module>build-tools</module> <module>onboarding</module> </modules> </profile> diff --git a/sdc-os-chef/pom.xml b/sdc-os-chef/pom.xml index 79eab3502a..654284741c 100644 --- a/sdc-os-chef/pom.xml +++ b/sdc-os-chef/pom.xml @@ -186,10 +186,10 @@ <plugin> <groupId>io.fabric8</groupId> <artifactId>docker-maven-plugin</artifactId> - <version>0.19.1</version> + <version>0.22.1</version> <configuration> - <verbose>true</verbose> + <verbose>false</verbose> <apiVersion>1.23</apiVersion> <images> @@ -291,11 +291,10 @@ <id>clean-images</id> <phase>pre-clean</phase> <goals> - <goal>remove</goal> + <goal>remove</goal> </goals> <configuration> - <removeAll>true</removeAll> - <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana<!-- ,openecomp/sdc-sanity --></image> + <removeAll>true</removeAll> </configuration> </execution> @@ -315,7 +314,7 @@ <goal>push</goal> </goals> <configuration> - <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana<!-- ,openecomp/sdc-sanity --></image> + <image>openecomp/sdc-backend,openecomp/sdc-frontend,openecomp/sdc-elasticsearch,openecomp/sdc-kibana,openecomp/sdc-cassandra<!--,openecomp/sdc-sanity--></image> </configuration> </execution> </executions> diff --git a/test-apis-ci/pom.xml b/test-apis-ci/pom.xml index 7184c8b06f..14e1fc3fcd 100644 --- a/test-apis-ci/pom.xml +++ b/test-apis-ci/pom.xml @@ -226,8 +226,8 @@ </dependency> <dependency> - <groupId>com.thinkaurelius.titan</groupId> - <artifactId>titan-cassandra</artifactId> + <groupId>org.openecomp.sdc.sdc-titan-cassandra</groupId> + <artifactId>sdc-titan-cassandra</artifactId> <version>${titan.version}</version> <scope>compile</scope> <exclusions> @@ -277,10 +277,16 @@ <artifactId>json</artifactId> <version>20090211</version> </dependency> - <dependency> + <!-- <dependency> <groupId>org.openecomp.sdc.sdc-distribution-client</groupId> <artifactId>sdc-tosca-parser</artifactId> - <version>${sdc-tosca-parser.version}</version> + <version>${sdc-tosca-parser.version}</version> + <scope>compile</scope> + </dependency> --> + <dependency> + <groupId>org.openecomp.sdc.sdc-tosca</groupId> + <artifactId>sdc-tosca</artifactId> + <version>1.1.32-SNAPSHOT</version> <scope>compile</scope> </dependency> </dependencies> diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java index a9cc119b20..cfd132d5d0 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ComponentBaseTest.java @@ -35,7 +35,6 @@ import java.util.function.Consumer; import java.util.stream.Collectors; import org.apache.commons.collections.CollectionUtils; -import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.tuple.ImmutablePair; import org.apache.commons.lang3.tuple.ImmutableTriple; import org.apache.log4j.Logger; @@ -60,7 +59,6 @@ import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.cassandra.CassandraUtils; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; -import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.CatalogRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.CategoryRestUtils; @@ -71,13 +69,8 @@ import org.openecomp.sdc.ci.tests.utils.rest.ServiceRestUtils; import org.slf4j.LoggerFactory; import org.testng.ITestContext; import org.testng.ITestResult; -import org.testng.annotations.AfterClass; -import org.testng.annotations.AfterMethod; -import org.testng.annotations.AfterSuite; -import org.testng.annotations.BeforeMethod; -import org.testng.annotations.BeforeSuite; +import org.testng.annotations.*; -import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.ExtentTest; import com.aventstack.extentreports.Status; import com.thinkaurelius.titan.core.TitanFactory; @@ -94,17 +87,16 @@ public abstract class ComponentBaseTest { protected static Logger logger= Logger.getLogger(ComponentBaseTest.class); - // public ComponentBaseTest(TestName testName, String className) { - // super(testName, className); - // } +// public ComponentBaseTest(TestName testName, String className) { +// super(testName, className); +// } - protected static ExtentReports extentReport; - public static final String REPORT_FOLDER = "./ExtentReport/"; + protected static final String REPORT_FOLDER = "." + File.separator + "ExtentReport" + File.separator; private static final String VERSIONS_INFO_FILE_NAME = "versions.info"; private static final String REPORT_FILE_NAME = "SDC_CI_Extent_Report.html"; protected static TitanGraph titanGraph; - private static Config myconfig; public static Config config; + protected static ITestContext myContext; @@ -125,104 +117,45 @@ public abstract class ComponentBaseTest { lc.getLogger("io.netty").setLevel(Level.INFO); lc.getLogger("c.d").setLevel(Level.INFO); } + + public static String getReportFolder() { + return REPORT_FOLDER; + } @BeforeSuite(alwaysRun = true) - public static void openTitan(ITestContext context) throws Exception { - - logger.info("<<<BeforeSuite>>>"); - myconfig = Utils.getConfig(); + public void setupBeforeSuite(ITestContext context) throws Exception { config = Utils.getConfig(); - - File dir = new File(REPORT_FOLDER); - try { - FileUtils.deleteDirectory(dir); - } catch (IOException e) { - } - dir.mkdir(); - - System.out.println("BeforeSuite - get reporter"); - extentReport = ExtentManager.getReporter(REPORT_FOLDER + REPORT_FILE_NAME); - - String onboardVersion = AutomationUtils.getOnboardVersion(); - String osVersion = AutomationUtils.getOSVersion(); - String envData = myconfig.getUrl(); - // TODO: uncomment config file -// extentReport.loadConfig(AutomationUtils.getConfigFile(CONFIG_FILE)); - - extentReport.setSystemInfo("Onboard Version", onboardVersion); - extentReport.setSystemInfo("OS Version", osVersion); - extentReport.setSystemInfo("ExecutedOn", envData); - extentReport.setSystemInfo("SuiteName", context.getName()); - AutomationUtils.createVersionsInfoFile(REPORT_FOLDER + VERSIONS_INFO_FILE_NAME, onboardVersion, osVersion, envData); - - System.out.println("BeforeSuite - open titan"); - openTitanLogic(); - - System.out.println("BeforeSuite - createConsumer"); + myContext=context; + ExtentManager.initReporter(getReportFolder(), REPORT_FILE_NAME, context); AtomicOperationUtils.createDefaultConsumer(true); - - System.out.println("BeforeSuite - performClean"); + openTitanLogic(); performClean(); - } - - protected static void openTitanLogic() throws Exception { - - logger.trace(config.toString()); - String titanConfigFilePath = myconfig.getTitanPropertiesFile(); - titanGraph = TitanFactory.open(titanConfigFilePath); - assertNotNull(titanGraph); - - } - - @AfterClass(alwaysRun = true) - public synchronized static void cleanAfterClass() throws Exception{ - -// System.out.println("<<<<<<<<class name>>>>>"+method.getDeclaringClass()); -// System.out.println("<<<<<<<<class name>>>>>"+method.getName()); - System.out.println("delete components AfterClass"); - deleteCreatedComponents(getCatalogAsMap()); -// extentReport.flush(); } - @AfterSuite(alwaysRun = true) - public static void shutdownTitan() throws Exception { - - System.out.println("AfterSuite - flush report"); - extentReport.flush(); - System.out.println("AfterSuite - perform clean"); - performClean(); - System.out.println("AfterSuite - close report"); -// extentReport.close(); - System.out.println("AfterSuite - close titan"); - shutdownTitanLogic(); - System.out.println("AfterSuite - suite ended"); - } - - protected static void shutdownTitanLogic() { - if (titanGraph.isOpen()) { - titanGraph.close(); - } - CassandraUtils.close(); - } - @BeforeMethod(alwaysRun = true) - public void beforeState(java.lang.reflect.Method method) throws Exception { - - - ExtentTestManager.startTest(method.getName()); - String[] parts = this.getClass().getName().toString().split("\\."); - String lastOne1 = parts[parts.length-1]; - String lastOne2 = parts[parts.length-2]; - getExtendTest().assignCategory(lastOne2 + "-" + lastOne1); - getExtendTest().log(Status.INFO, "Test started"); + public void setBrowserBeforeTest(java.lang.reflect.Method method, ITestContext context) throws Exception { + + + boolean emptyDataProvider = method.getAnnotation(Test.class).dataProvider().isEmpty(); + String className = method.getDeclaringClass().getName(); + if (emptyDataProvider && !className.contains("ToscaValidationTest") ) { + System.out.println("ExtentReport instance started from BeforeMethod..."); + String suiteName = ExtentManager.getSuiteName(context); + ExtentTestManager.startTest(method.getName()); + ExtentTestManager.assignCategory(this.getClass()); + + } else { + System.out.println("ExtentReport instance started from Test..."); + } + } @AfterMethod(alwaysRun = true) - public void afterState(ITestResult result) throws Exception { + public void quitAfterTest(ITestResult result, ITestContext context) throws Exception { String testName = result.getName(); Throwable throwable = result.getThrowable(); @@ -248,8 +181,55 @@ public abstract class ComponentBaseTest { ExtentTestManager.endTest(); - extentReport.flush(); + + + } + + @AfterClass(alwaysRun = true) + public synchronized static void cleanAfterClass() throws Exception{ + +// System.out.println("<<<<<<<<class name>>>>>"+method.getDeclaringClass()); +// System.out.println("<<<<<<<<class name>>>>>"+method.getName()); + + + System.out.println("delete components AfterClass"); + deleteCreatedComponents(getCatalogAsMap()); +// extentReport.flush(); + + } + + @AfterSuite(alwaysRun = true) + public static void shutdownTitan() throws Exception { + + performClean(); + shutdownTitanLogic(); + + } + + protected static void openTitanLogic() throws Exception { + + logger.trace(config.toString()); + String titanConfigFilePath = config.getTitanPropertiesFile(); + titanGraph = TitanFactory.open(titanConfigFilePath); + assertNotNull(titanGraph); + } + + + protected static void shutdownTitanLogic() { + if (titanGraph.isOpen()) { + titanGraph.close(); + } + CassandraUtils.close(); + } + + + + public void setLog(String fromDataProvider) { + + String suiteName = ExtentManager.getSuiteName(myContext); + ExtentTestManager.startTest(Thread.currentThread().getStackTrace()[2].getMethodName() + " " + fromDataProvider); + ExtentTestManager.assignCategory(this.getClass()); } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java index 2b970fd8a1..ae16f7406e 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentManager.java @@ -20,53 +20,149 @@ package org.openecomp.sdc.ci.tests.api; -import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils; - import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.reporter.ExtentHtmlReporter; import com.aventstack.extentreports.reporter.ExtentXReporter; import com.aventstack.extentreports.reporter.configuration.Protocol; import com.aventstack.extentreports.reporter.configuration.Theme; +import org.openecomp.sdc.ci.tests.config.Config; + +import org.openecomp.sdc.ci.tests.utils.Utils; +import org.openecomp.sdc.ci.tests.utils.general.FileHandling; +import org.openecomp.sdc.ci.tests.utils.rest.AutomationUtils; +import org.testng.ITestContext; + +import java.io.File; public class ExtentManager { + + private static final String VERSIONS_INFO_FILE_NAME = "versions.info"; + private static ExtentReports extent; + private static ExtentHtmlReporter htmlReporter; + private static ExtentXReporter extentxReporter; + private static final String icon = "$(document).ready(function() {" +"\n"+ + "$('.brand-logo').html('').prepend(\"<span><img src='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ4AAAB7CAYAAACFKW5jAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAABaAAAAWgBwI7h9AAAAB3RJTUUH3wwXFAQf1clFIAAANNxJREFUeNrtnXeYXVXV/z+n3To101ImvZFGQiCANKUoSBEFebEj1hcb2MWC+lpAbGD5CaKoiL2ggIgoRUIgQAohJCG9TTLJ9Dszt52y9++PfSeZTO6duXfmTkk4n+eZJ5Nbztn7zNnrrL32Wt8NPj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+PgOjjXYDhpX7WgkZMD2qY2qQFtDlSkSvjlsaGJpGUIeQAS1pyb60hMurRrv1Pj5jFnO0G1As9PvbmBiEDkeS8CSmpuEhCOi6FTW0sAYhiTRNTTM8JBoaGmDpSEODoK65EQM7YpLCCCVC97ciAUODuSU6UpO88Jpxo91NH58xwTHtcSx6vJ2DKUlTSlBVVqKVesnqlrSosaWcFTa0eXFX1nmSmrChjTc1qoCIKwlJ1W8NkDoITUPokAQ6U0I2uYL9FZZ+UNfYnvDkhoWlRnNdhIMP7HWcsqDOonKDsK7znzPLRvsS+PiMCsec4VjwWDvNaUFTh8eS8VbFvpSc4Qh5esJjKbBASDnDlZTqGmEpQQ7yPLoGSGxdIx4xtEZbyhdrA/pGIVk+ParveEt9qOH69d3i1AqTcbg8eE71aF8aH58RY8wbjresjbGiCTzpsb/JYUF9oKwpJZekhLzQkfJMIVnkCMoBY7BGIl90DQyNeEjXdhsaz4UN7V9TwvozK88p31Pzzza5uNykOqDzh2Wlo33ZfHyGlTFrOC58opMGT9DuCG6YGdG/ty0xxxby4pTgEkfKpa6gYrgNRX9ogKHhBHVta4WlPR4xtPtmRPXn/7U73XlGfYCoAf8+o2K0L6OPz7AwJg3H/Mc6aEoLFpUawe0J79RuV76525WXuYLpYrQblwUNCOh0Rk3tuQpL/119WHv4yS3O/lNnBji53OQnS6Kj3UQfn6IypgzHOcvb2ZWQnFRpWavbnDM6XfmelJCXOIKq0fQuCsHScKOmtqbE1H41K2r89Yl9qQPvmh3hnqX+9MXn+GHMGI4TH+vgX2eEtLOXJ09sscUHEx5XOUJWHysGoy+mhltmas9OCOl3/E998O9rO9yub82PMLf0uFkB93kFM+qG44HGNF/dnCSoU7s9Lt4bc+UHUp6cdqwajL6EdS01OaI/eOY469t3nxR9PuFJGTX10W6Wj8+QGFXDIaUE0M5d0XnW+k73pg5HnutJjNG+KMVG12Ba2NjzwWnB2z89O/xLDdoANG3U7baPz6AYlUeflLLHaES++nLius1d3m/bbHnB8Wg0AISEnXFvyv0H7Fu2x727gaU918HH51hkxA1Hr8EyrdkW31vZ7n67MSXqj/chJDXY3O1Zrba8HPgN8DYg2MuI+vgcM4yo4eg1QM4B7m1Kyw++2OlFRvsijEznoTaoMyGkA5wA/AT4IlDR59r4+Ix5Rsxw/L4hBWAAbwF+AZz5SprhmzpcPSnIpNChS14GfBa4HZjSYgu+uTkx2s308cmLETEc5yzvoMrSw2khrwN+AMwAmBrROXPc8b88qQNXTQxy3bQgxpHW0gLeCdxZFdAXfn5jguWtzmg318dnQIbdcLz26U7Chla+KuZ+xRbcAtT0vBc1NL4wJ8yp48zBV6ONZSSUmxrXzwzx/UURaoJZL7cGXPTPg/Yvrq4PvursPzT50xafMc+wGo4LVnRQH9LKG5LiyxNC+g0lpnZU7vXicpO7TyrhqkkBwoZ2fBgQCRFD47xai7uXlnDz/Ah1wf4v9ZOt7ikr2pw73v+qstO1n+z3jYfPmGbYwgyvf6aTqREt+uAB58uTw/rH/rSsNNhrfn8Una7kvkabn+5KsabDJeUNdwuLTGacjwtonFppcs3kIBfWBai0Bu5AhyO58rkuHm92mFFirHltrfXedTH3hWfOqRjtXvn4ZGVYhuWtWxK80CmsZ9rsT+9JiC9+bGYo/J2F0bzcm4NpwWPNDvc12qxsd9mXEoieyraxZER6OQSllsacEoPzqi0uGW+xtNyk1MyvsRL4xZ40H30xTsKT6BrMiBj/vaQu8J7tCXfHg6eXj3ZPfXyOouhD8SMvdHLj3BL99c90XrM17t2edGXpdxZG+OSscEHHSQvJ1m7Bs+0uT7Q4rIm57E4IEp7kCC9+JIxJn/OFdI1JYZ1ZUZ1lFSbnVFssLjOoCeoFN+fxFof3v9DN9m5xqC+mBnNLjL9cNSn4walhvfXaqaER6KSPT/4UdUlDSon221bWd3WdtyfpfS3pSVUSOojBHdQ1FpYZLCwzuGZKkH0pwY64x/pOj7Uxl21xwYGUoDktSAiJK6CYYQFNU0uoYV2jOqgxKaQzM2qwoFT9zIoa1Id1FZcZJI81O1y/Pn6E0QBwJWxPiDf+p9nZ8+mZoS883+4ml1Ue/6tPPscORX1ev3ZFDFfI2eu7vN+12PJkACR8dk6Ym+dHinYyiYoLtNmCVluyJynYkxQcTAmaMq/FHElaSBwJXsagmErBK/OvRkCHgK5haRDQIWRolJka5abGuIDG1IjBlLBOVUCjOqBTbmlF6UNaSP683+amTUl2xL2cf4VKS+u+bHzg479aWvJzQPq1LT5jhaLdiQ812fx2T7r0v63OHftT4m09gxUJ59da/PXUUsrynPcPlZQnSQpwhcRD1YqAKjbTAV3T0FEehaH1/CgDMtzsSgh+uCPJz3eniTmy37+ABiwsM3Z+aW7kf66aGFjlGw6fsULR/N/X11jaFzcm3tmUFld6fWICz7e7PN7icPn4wIh0KmRohIzMyccIHY7k/gM2P9ihVo1kHs2TwM6EmL4z7n0RuFZK2e4bD5+xQFHyOKSUfH5jYv7BlPh4WhDs+36nI7llS5It3d5gDn9ME3PUtOStq7r433VxVre7BaWqdDuS3UlxkSO4llGqZvbx6UuxbsRQxNA+1u7IWVnf1WBlu8snNyTYmxyLqqHF50Ba8Ku9af5nVRfXrOnm4YMOSU8OygnalxLBtJAfBZb4iWE+Y4EhT1UyN/IFC8uM/xnolv7HAZuPAN9eEGFOyfEnvZEW8HKXy0NNDvftt1nX6WJ7HN7+aZBICbrGNOB64DopZcKfsviMJkMyHBmjUQVcf3qlWbGk3OCZVjfnIJHA/QdsmtKCr5wQ4fwaixGKlw4bnoQ9ScEzbQ4PHHBY3uqwLyVUZ4doMHqYEtYJ6RrAG4G/PN5s3z/a/fZ5ZTOk2zpjON4P/BAIPnDA5n0vxGlKif6PLKEmpPOeKUHeOzXI7Oix5X2khVoCXtPh8Z9mm+WtLjsSHk6Pd1FEgrrGL5eW8JZJKrAsJI90OOLqXzekO26Y+cqQMvEZewz6Ns8YjQnAfcBpoJ6+9+xNc+PGBAcHMh4ZTigxuHpSgCsmBplXYmCNwfCfI6HdFmzu9lgT81je6rA25tGQ9NRUZEhXsh8kLKs0+ftppT0CQOxLitSdu1Mf+sbWxC/EG2qGeAIfn8ExVMPxQZS+xqF1Vk/CAwdsvrgpwYZOb+AzZFz6yWGdc6stLqixOL3SHHJW5mAREuKepM2WbI17bOzyeCHmsibmsjchaHN6bUg7zM0L6Ro/PjHKtVODh061Nuby4RfjK84cZ17+7QXRVj/W4TMaDCrGkTEa1cDb6WU0QCVTvXFCgFlRg1u2Jrmv0Sbh9rOakHl9b0Jwz540v9+XZmJI56Ryk6UVJovKDE4oMai0NEpMjUiRjIktIOFJ4p6kOS3ZnfTYHvfY1i3YFvfYnvBoSUs63SyGYgTGqga8tT7AVZMCR5zuYFqytds7pdLSzr9xY+KPw98SnwLp+XMd18tfgxoCpz3Zwcqzy98M3APkrF7rdiV/O2Dz4x0pVnW4uCLPM/a65BFTo9zSmBDUmRLRmRDUqQ3q1AY1qgIapaZOqan0L/Q+9R62kKQ96HKVAYi5klZb0pxWaelNaUFDStBqC5KeMiSMdAFdDi6tC/DjxVGmhI+cu31ra5IvbExwQqnxt1sXRt92SV0gOXqt9EEJUy0CFgNTgCjqzkkCDcALmZ+m0W5oMSnY45BS8udGO5ry5NUhQ+u35LXE1HhHfZDzqi3+2mhz7940L8Rc0gMFEXu9l/AkCU/SmBSs6Tj8uqEfrjnpSSXv7bXLjA0QEjzAkxJPcrhEP8f5RjXZVIKlw5snBbl5XuQoo9HpSh5rcfAkHEzLs//YkF4spFypj73pylnANeTOE4qjAupbBzjOFcAlo9D+DuA2YG8/n5kEvBV4MzAfKCH73dMNbAR+B/yW/AxIFfAZlFc/0vwX5RD0S8GG4/vbkzzR6i4bH9Bee1aVldd3JoZ0PjI9xJsnBHik2eEP+2yebXdoTWce7/nc930+4x0qXivQIxxzYyyDhPEhnQ/PCPGh6SHGZSmc+W+Lw8o2tdzd4YhxOxPiMg1WjnbT+2AC1wLvGeBzu4DvDfCZU/M4znDQDPya7IZDQ6n0fw04k4GTKEsy/VgKXAx8HliVx3feBtSPQt8FeRiOgtcw6sO6tqXLu+jZdrdghZnxIZ13TQ7yh1NK+PtpZXx+bpjTxvUSvTmuZ4U5kFBmalw1KcDvl5Vw4+xwVqPRlBb8YEeKTkddJE+i7Ut5F/xkZ2qsLa1MQw2sgbgYGGgn7tGqUXDIfTe+Dvg5cDaFjR8TeC1wF5kNuQbAHaW+53XNC/Y4VnV445psce7L3R5CZTQWTImpceY4kzPHmdwwQ/Bip8cTLQ6rOlw2dnkcSIvDy5wwdr2EwZJZSaoL6rym2uTt9UHOrbYoyZENlxZw+44UT7Q4h66FBNpsuWBlu7tESvnvMbS68mpgah6fOwkVF3hqtBtcADOAbwIzh3CMJShv5RqgZbQ7NFgKMhxSSi5d2XWiLZi3ocuj3ZFUBYZ2w9YEdc6v0Tm/xiLuSfYkBC/EXFbHPF7qVII9TWml/OX1jU+MmbEy0IU7/GvU1JhbYvC6WovLJwRYUm70ZIVmxZFw1+4UP9qRwu3zDOz2ZKTZFucD/x7tLmaIoDyJfOaw44CLgBUcG76mAbwbNfD7w830p79rcAFwGWp/oWOSgj2Odke8KunJ0p78hvNr8otz5EPU0JhXajCv1OCt9Wo1pNVWS6Uvd3lsjwt2Jz12JQSNKUG3K0l6kBIy96030salTztChlr9mVdqsKzC5Owqi5MqDMYHB/Zy0wLu3JXiKy8n1BSlT19cgbY/KZa91OWVA7ER7mk25gJnFPD516HygMbaikO2u6YOuJzc05O9wN+A9aipzhzgysy/fQmgAr9/AHLtwjVaj8W8zluQ4eh2ZUBDe5WUELMlv99nc1aVRR5jYFCUmhqlpsa0iM6rM4HYlJDEXYi5ksaUoCEp2J8SHEyrn6a04GBaJXAlPUlSqFUZZ5hny4aupmAlhkZtUGdmVGdeqcGiMpOFpQaTwnpBQkZtjuS27Ulu256iK4fgj1QrRgufb3enoG7Y0URDGYLaAr6zABU4fDDH+w65B1Y2LLI/6QWQJj/Ppmcpta9/Ox8Vv8lGM/BR4IE+3/s3Ksg6Kct3FqKCn1uyvCcz/U7m2WYdCJJ90DuZn3zQADufDxZkODQYb2rMEJn//L0xzVsmBYrqdQxESNcIBaAqoDEjcqTFcgTYUmILiLuSFlvSYgtabEGbncnhyEgLdjoqt6PLzUgMCnCkxJXZtUsNDayMzGDE0KiwlCcxIaQzMaQf+ndSSOWZRA3lbQyG9Z0e/7c5wd8bbZyeYrkcpDwqyi1toZRy/SjHOcpRU49sj5Fu1I3d90aJoJZb/0n2oNwfgLV5nl+ilkffkuW9PcD/AW15HiuV+U5vJpM7mPtQ5qevsfkvagn201m+U0luw9GCqoTOtxipFvgy2Q3Ub1CeUD5owM58PliQ4Qga2vSpEX0KLeoUzWnJzVuTzC81DtVSjCaWDhYaUQMqLY36MKip6WGEVMlhQspMfgekPUlKQNKTpAXILEY+oGvKaBlKwNjSD8sNDiZAnI1OV4n+fHdbko35pOsDZaYWmBU1lgC/Z3RjBUtRAc++eMAvUUHTRVnePxeVOJXtht2U+cmXE3O83okyTgeG0L8w2f8iHvAI2Z/qAvgPyhvpK1UfILdhSFBY3Koe+DjZDccG4O9D6HdW8jYcmTTzBadVmtF796bp8TqeaHb45pYkN8+P5FwVGEvoGqh4bq+2jnK7XQkr2xxu25HioQOFCf5MDutMi+jzUDdhfJS6oKO8jWxL9C3Ar1BP8WyGYwZqaTOvJ90Q2jdU7Zl0jtcFcLCf7+WaJLvkOS3Is3+5GBZ5/ELdhPkX1lra3FLj0LPNA362O8XXtyTpco+F4PjYQUhY3eHy0RfjXPV8N3/ZZ5MU+RsNTYMl5QZlpjYDKBvFrtShchSysQp4CfXEzxbAtVDTlWJsHpPrBtQZerAxRvaBbgCz+vnePDhaThM1fWsuQp9BGa/++l50CjloGJg5I2rw3inBI8rfU0JllH755YSqHvXpF1eqKtcbNyZ403Nd3LEzxYF0fjIEvSm3tJ74Uh2FBSWLzRmoFZW+COBfKG9jTeYnG2cCs4vQjly6lMWQVNpDdsOno+IqdVneOxGV+Zrt3Ps4Oo4yWCRj2HBUAHUa8O4pIS6sDRzRVFvAj3akuO6F7lekKHE+JDzJ8laHD63r5rKVXdy6LcneROEGAwAJZ42zWFJugjLqkwZxlGLQ4zFkq1tqRAUIQQ26B8nuuo9H5TYMlVyGoxgex2ZUvCAbZwEf43CluI6K3fyM7HEfULGPjiL0GTJlWf30vegUctByMkU3VQGNr84Ls7DMOMJ4OBL+uN/mHau7efCAjfPK0CUekIak4J69ad62ups3PdfFXbvS7OsRbR7k7Rw2Nd45OUipqZEWMrSy3c0nW3M4mIYKfGbjOQ6vGkhUEHF/ls8ZqBjJUKdbw+lxdAJ/JHsQ1AQ+hMrbqEMVqN0DLMtxrPWoZdpiPWFHfKpSSOCkDLWEBMDScpPvLYpy3bo427uPXAF4vt3l3Wu6efvkIB+eHjouhYkHIuZIVnW4/KvJ4ZEmh03dxREuBkDC62stLqpTq5vb48K4ZWuyLiEkkWIt8eTPa1CrIn3xgIdR05QetgJPonRc+nIKKni6YghtGU6PQ6LU7q4mu6GsAG5GTUFOJffY2g18FlUxWyxGfKpSiOGooM86/GtrLH6wKMr16+Ns6208NGh1JD/YkeLRZof3TA1x9aQAk8bAku1wEvckW7o9Hm12+GeTw+oOl5jdqwK4GGNawpSIzqdmhQ8llD3V6vBsmzsupDaoG0k/LwxcSvb7qAFY3ue1NCpJ6kqODoZWoryOpxn8snJ/+cPFuPoHgFuAE8ge05hK/3U661FG4+EitKVvv8es4ajM1oiL6ywiRpRPvpRgTcfRCucbOj0+syHO7xrSvL0+yOUTLKZHjh8PpMuVbO72+G+Ly2MtNms6PA6mhUoiK9bt2ouoqfG52WFOy2xCnfQkDx100DRqV7d7AY58wg83C8jozWZhJbA9y+tPoeIFi/u83pN5+gMGv9ownB5HD0+jvIW6Ar7johLEvgS8WKR29O33mDUc0VyNeE21xT0nl/ClTQkeOGAfWYylqSSrVe1Kt/Onuw3eNCHApXUBFpUZx0TuR2+UiI5gQ5fHilaHFW0uL3Z6NPc2FjAslQaWBh+eEeLdU4KHks7WxjxWtLlEDMpXxdyR3tL+tWRfzXFRy6/Zli8bUSstJ2a5SvNRbv4/Btme4Yxx9PAqVLp4vhwEfgz8P6C1SG3oy9j1OJrSIloTzK01taDU4K4lJdyxK8WPd6Ro7Ktyrqm8hU2dHpu6kvx0V4qlFSavrw1w5jiTuaXGiG1KXQieVBmd2+IeL8Y8VrSpKciOhCqyY5iNRQ+WBh+YFuLG2eFDIs4pIbl7T4qWtGBaVA82pcVIzgUrUZWw2Xq9m9yxCoFaXXk/vWJmGUqA16MMy2D0KIbT4wijYjM3ouQC82U5SrCov+S8bHUmWqY/NgNP3cau4bi3IV37jvqgXttPRVtVQLnRZ44zuX1HikeanKOFijO/t9iSRw6qwGFtUOeEEoNXjTM5rdJkYZnBhKB+lI7ocONJNRjbbMmOuMembo+1MY91MZedCXHYq+jVj2GvYZQQNuBDM0J8cU6Eil4iP/886PCX/XZPM4wRaE1vlpI7xXsFynjkYh3wPGpq0pfzUEvL/X2/n6uVlaF6HJUog/EhlOddCK8D3gXcSXbDthRVZ1KSpc0vomIiafpnIMOhUeRyhLwNx0MHHX121OCyAXacNzQ1dVlaYfLgAZuf7U7zTJtLKlsadeb/TWlBU0rwZItDyNAYH9KYHjFYVGYwt8RgWkRnWsSgKqDqRYIGBLTBGZWeQri0p4KZB9OCPQnBrqRge9xjc7fHnoQqjGvPthXCSA5NCXUhnU/NCnHd9BDRXkVz2+IeX9+SpMOWPdNBGfdGLPlOR+VuZFs+TaOCf/1VZHaigqQXcPQTsScFfTCGo2eu3/evNBSPoxK1WvJeBpe+XYaKbexGxTl6EwA+ALwhx3e3kp/nJRjhPI68L8TBtLAfOODw+rpAXqUdZabG2+qDXFgb4OEmJVT8dJt7SPoulxFJCcmuuGRXXPB4s1K8KsmU15ebGnUhnbqgRpWlUxXQKLNUKXuJqR3RLg9whTpetyuJe9DhqCrZNlsZjGZbEHeh25Mk+6bLj4ah6CGjrPaqKpMvzInwulqL3oW2bbbkpk1J1vYKRnsS1xUjVuQ2ETg/x3s7UQHEgfgPKnNyWp/Xgyij9CcGftL2JZfhGKzHEUZ5Gv0ZjRZUwPfUzHXJxgTUakwjR1b7LiC30WhGCRznk+sxdqcqpkb838223NAV1BaX5W94qwIab68Pctn4AM+0udzXaPNYi8OuuHc4QSyHEemh25V0O5JG4OWuo6+jnlE813p9USJ79CoQ/V3W0TQQfcm0cWpU592Tg7xvWoj6PkvYcU/yrW1J/rw/fUSXBHRPCGkjpVOZK8Uc4AnyS6XeDDxGdjHiM1H1HxvyOE5vih3jeBNwHbnHyUvAF1BG8ApULCNX/GMR8K1Mfxsyr12Eyprti4fSNc3HAMNYNhwBXduzJ+m59+61rYXzTQqVmigzNS6stTi/xmJvUvB4i8M/Dtisjrk0JMVhWcABNm7KhpBgD6R4PhYMQy4yzR4f0nnDhAD/Oy3I4jLzqKlYypN8d1uKH25P0bckKOnJfcsqzZFYig2gcjeyFW45KKOxkPz28NuMcsX73oeTULGOQg1HrgE0GI9jMvAJjo499LAWZVSezfz/d6j4x80cHfTt4Xzgq6gS+HJUPku2dq1AbR+Rb/Xs2F2OnR4x9u+IC/c3DWnryokBTq8c3MqfqcH0iM70KUHeXh9kR1ztxfpYi8MLMY/dCXGkFOBYHvBDJeNUT4noXFwX4JopQU4uN7Pun9vlSm7ZmuT27SlVQdsLS4fqgN68LuaORPLXdFQMIhsmKt36E3key6SvYIqiJ4byC1QVab7kGkCD8Tgu5+hckx52ATdw2GiA8hLuRhmPr5Ld4OjAO1Bp92Vk1y9NAneQPTU/F2M3OPrxmaFYY0p0PdnihL+7LcnPTyoZ8vJpUOeQxui1U0M0JAWbulye7/BY1eGyucujISWUPsXxYkgyxqLM1FhcbnJxncWldQHmlRo5vbiDacHXNif52e4U6SymIaRr4txqs/VjM8JcP/w9OI/c+31oqAzjYnAyyr1/poDvFCuPowS11JxtfLiovIzlWd5zUPkapcDnyC4VEOCwIlg2o7kJeLzAazV2pyqnVZqxyycEmp9td2ofPODw891pPjYjVPCUJRdWjycSCXBxnRLqbUh6bI0L1sVcNnR57Ih77E4q6b+UJ4+W+BuLRiXTRkOHSktnQanB2VUm59VYLC4zGTeASvyGLo8vbkrwQKOdPUomoT6kpy4dH9g1AtKB/Q2oYlMNXEjhhiOXx1EItSgdjWw0oVZHcg3UFPAdlOdxPX32Vs4QzPHdNCq2Uah489idqgAdb54YaL6/0ea/zQ63bk0yp0TnkrpAAYfIn6AOM6MGM6MGF9VaCAntjtIM3ZUQbOry2JXwaEwJ9qWUYHGrrfRD7VyXcTjHVZ/zBQyosHRmZ0SLT64wWVZhMiOqNtAeCEfAPw7afOXlBOtiuWUEdQ1eV2slLqix9g540KEzn9wp5sPBhcCPyH//kWLlcZSTO07RRP+KX6CSvb6BUmX7IPmPs3+gYiWFTjlHvKy+EMPRNSWs7/7YzBBrYy4HUoLPbEgwztJ51bjhfwDpmlqhqQqo3esvqlX1drZQmZ2drlI835sUHEgppfOmzJJrU1qJFic9JUjsCCWm4wglTlzw7C+zV62pKy3SoK4EjCeGdKZFdGZGDeaXGiwoNZkc1hkX0Aq6a3cmPH68M8Uvdqdps/tRBJMwOapz9aRgU8TQBrqZh4qGGsgjuZ/pIlTVbL5FYcWKcVj0e9XzIsbhxK53MvAAPgB8F2gf5LUaiTqdQxQy4iWw+ZI6i/dPC/H9jKDuR9fHuWNxlFMqRrpMQhHQoTqgUR0wmNGneM6VaiUiJSQpT+VrxDLq5j0q5zFHbZ9gS4ntKU0RL4vMuaFphA2lsh42lGhxmalRFdAZZ2lUB3XKTY0SE4KDTHeNOUqs+Ec7k6yLeeoO7edQmgZXTwxySoW5A5VUNZz0bKCUrUVp8pfgz9oV1NO577GjqCDpI+T3FO7P1yzkj5Ikd/5EBdlFi7LRisr8DKFWUPobJLsYeBPugfqejdH1ODRNQ0r5UlDX7E/NDAU2dXk8dMBmdbvL/66Lc9vCKGdVjY7xyNm5TPJYyZgMfhwm7kmebHH4ya40/25ysmfZ9kXCnFKDa5WM4yYK239kMJxC9uIuG7Ut4vMM/skWROVDnJzlvXNRwdh8ckP6C44WMoC6Uepc2aYrFaiktYY8j3UQ+CkqqNxfjcti4COo5dzBLKuPTcORYSvQOD6kT/32gggxR7Ci1WV1u8t71nbztXkRrpyYX2apj0pse7zF4Zd70jza4ijtjjyfjRFT45OzQswtNWzgBYZ3awQDVXyWLcV8F0rFfDAp4r05EVW30bf3s1HSfL/N4xjFyuNoz/Rnepb3ylGJYc+RX57FKcBXgKoBPhdGLWN3A7dRuAc3ZqUDQVnZ7QDzSw1uXxTl5Ew+x9Zujw+t6+abW5JqXu6Tk/0pwa8zUoLvXN3NX/fbxJw8vIwMGvCW+gBvqw8CtKcFw70Z00Rya4I+g1K9GipPkn26FUBNV4J5HKNYqwud5N4ISkeloL+H/h+8Zqbdd5P/zvYlwOdRe9QWIlozpjVHQVnDQ8tjJ1eY3LWkhFdXW6CpGoqvb05wzdpunm5zEb79OETCkzzX7vLVlxNc9mwX73uhmwcabWJu/gYDAKmKCL80J0JY13iyxdl/w/p4sWT2c3EW2Xdod1Dp1sVIdV8PvFzg+fvSXxykkHtdoAKyXTneL0dNzz6BynLtPciDqCnXt1EJbIsojArg68BVFHZnjNngaA9PoebTEYCTyg3uOinKjRszWxYKeLDR5oWYy3unBHn3lBDTIsNi9MY8CU+yMyF4qtXhHwcdnm13aVJbxQ0uCVrCSRUm310YYVpEZ1WHy81bk+v+tTmV73LlYOh54mdLZtrDkdmTQ6EN5XVkW+7tSUEfSKezv+BooTfhSlQtzeU53q8EvobKBH0eZfQqUbKCp5G74I1MG7ei0tqzBVprgVtRD+oHyY+xG+PIBEjXoZSrl/S8PjtqcOfiEuaVJPnRzhQdtqQhobId/9po8+4pQa6aGGRy+Pg3IDFHif482ery72aHlzpd9qcytThDKaiTsLDc4EcnRjmp3KQ5Lbh5S9Le0OU9EqwLuIWWkRbATNQTPxvPoWIcxUCgMiav4+h07Z4Yy6/I7QX0HCMXhd58ncD3UTGKXFtPBFAeRaFexUvA+1Cxkk+QPUlscub8CZQBy+f6FaPfeTEYj+Mgaq+MJb1frApo3DQ3wsIyg1u3plgTU1OV9TGPz25IcO9emysnBrhsfIB5JUbWeoxjkbgn2Z8UrImpNPnn2l1e7vaOFv0ZirMo4eRKk9sWRjljnIkj4Ac7UjzR6uycV2o83XB2xXB2MVeKuYfa33Qoy7B9WQtsI3sNx6moMvSV/V+pomZQLkd5FbdQvFT6nagVpOdQRX4VKDW0bDGNWcDtqJjKcwP0e8wbjp7dud5LnyeDpcPVk4KcXGFy2/YUv21I026rJKu1HS5rYy4/3ZXi3BqLi2pVoVx9WD+mVmE6XaXlsbHTY3XMZW2Hx0tdLo0pSbq3kE6RVC414Nwai+8sjHBSuYmQ8Mu9aX60M0W5pT16UXVw71D2ExiAKKoSNttNvZfC0sHzoRk1FV6S5b1xKDWtZ8ltHIo5Vek53t2ZY97E0Da9kqjB/3kO16LEUCI/JcDbcrRxIapS9n2oOFB/bc3G2DAcmenKs6inQ9YqyVlRg+8ujHJxXYAf7kjyeItDOpNOsych+NXuNL9vsJkW0TljnKrbOKXCZEpYyQWOFWwBLbbKSN3QpSQEN3UrlbCmdB/xn2IrmksIGWrTpS/ODTMlrKuNPRptbtqUICXoPiGk/21n0hvOitglwOk53lsN7Cjy+TyUW/4Bjnbfeypmf0JuFXRJdiNnUNgqRW8c4C7U9PwzqH1k8k0A62E/aoOmn3L05totqIK4EuCNOb5/Kqqw7v0oL6UQ+suCHTSDzdhq73bl/WFDO9PQslu0oK62Tji90uS+Rpu796RY1XF4U6K0kGzu8tjc5XFvQ5rxQZ0Ty0xOrTQ5vdJkdonB+KB2SJh3OJFApyNpslW6+ta4qoXZFvfYmRDsSXh0uZIjitaHYeuD3g2aEVV7p7xzcpASU0MCf2+0+eRLcQ6kBOND+qolZdbzdywpVAKzIKaSe6XjTxRvt/XePIcKCGYLLnZlXs9lONpQXlCkz+tphpZZK1ECRS+i0u6vQsU+xtNnr6FeJFCKX4+jCteeJ3c26j7gk6iM1Z7ckd5ygE6mDZeg8kv6JohJVFVttmncywxDjs+gbn0pJbdsSS4+s8p86Kwqa2I+BzmYFjx00OHXe9M81+4S73la9/5yZrUhYmhMDuvMiOrMLzWYX2oyI6JTG9SpDmiUWxpmRnN0oHMLUEpgUq1yxBxJW0ZCsCEl2BH32BEX7EkKGlKCgymlB+L1NRIjgVSJXZeNt/jkrDDLMmn8noQ/7U/z6ZcSNCQFloE3t8T4yEuNyTt4+8QhnrRfguQeGP2lZQ8FDbWCk8tDSJF7+dfIfLfvX0xmvles9oZQ8Yc5KI3U8ahSeoHyIPagPIvdqOBxvnGg3tfbI/v0I5fqeYjcMgBFF3ga9JCI3t8SvGJS8Ccfnxm69qTy/B2XNlvydJvDn/crCcF9SaHyPbL9qXsaqamNiKosjXEBncqARnVAoyagU2YqvdHenokjJEkhibtk6lFU5WwsU6PS4ajfU57kKOGwUdIYNXU4rdLkuukhLh8fOLTfTMKT3Lkrzc1bEjSnVc5HpaWtP63SvOT2RaV755YeJ1HmY5+eO+cVkb00+GFy135OnxM5a0bU+MvXTgjXzogWNoV0BGzu9ni0xeGxZofnO1TF7VHbD/RmIN3QfD47tF4XF6nK70+uMHlHfZArJwao67X9xL6U4Ftbk/xsd1rFUzSwdLy5UeNzvz+57DsLK46fHfF8ji2GNITu3Jm07tmb/t7EkP6R7y6MDjpPI+FJNnV5PN7i8Eyby+qYy/6kyC1mfCyTMWhllsaZ40yumhTk4jrrCIMhJDze4vDVzUlWtDpH+KuTQvraC2oCb6gL6g23LowUdm4fnyIxpCF5yTMxrpgYXHTXrtR99WF95m0Lo0waYpJX0pPsTgqebXd5ts1lVYfL9oSn6l+OVfnATLutjDjR+TUWl45XO9iV9lmLbkwJ7t6T5ic7U+xLHrkbXoWlpS+osT72p2WlPx0BtS8fn5wM+e6TUmq/3pv+1Pe2p745Oayb318YYWaB05ZcCAltjlp9WRVzWdXusr7TY19K0GqLI6UDx9I46tWusKkCvadVmpxfbXF2tcnU8NH6oklP8kizw/e2pVjR5hyZaYrSAXldrfXgh6eH3vly3O24fobvbfiMHkMebq6QGBoT/rjP/sPnNyXOnhTSuW2RSlYqNraAmCPYFld5FS9ktEj3JQVNtlAVpiNtTPqcL2JoTMgogZ1WqeQCl5SbTAzpBLI4Y46AZ9odfrorzT8O2od2ZuuNDlwxMdD8iZnht57x345HuaKQrUt9fIpPUYbWj3cm+dC00KV/3Gff8/GX4pXVAY1b5ke4sDYwrHu/isxer01pya6E2utV5V8I9ic9mjK7ttkiy+rJEK+anjES1QGNuqCSC1xYarC43GRuic6EUP/JbLaAtTGXe/am+ct+m4N9N+nOoANvmhjwbpwdvvXkCvPLgONPU3xGm6LcgVLNGQKe5Na/N9ofveGluJ7y4OMzQ7xvapCa4MgtGUrUU7zNOaw9ui8l2J3w2JPRI+12JUkBtpBZS/91DSxdI9Dzb0ZTtNzUqA4qQzElrDMprFMbUEai1NTyUnzvdiXPdbjcuzfNPw86HMhhMHr+OFdODPCNeZGn55QYb5GwV/eNhs8YoGh3YcZ4TJbwm4ebnLM/+VKcLV0e59ZYfGJmmPNrrKyu+kjSY1SSGR1SR2TPsOkRIrY0DUtXWzcE9PwSzrIhJOxNCh5tcfjrfptn2pz+RYhRm3e/tT7IN+ZFmqaE9WuE5GFjON03H58CKOqdmDEe5wG/Xt3hTvzcxgT/aXKoDGhcOTHA+6eGWFphHlNFbUOh2Zas7nB5+KDNv5sdtnZn9svtr/+Z7NEPTAvyhTlhpzqgfwP4hqaN2L6wPj4DMhyGQ0cVKX27ISlKbt2W5O7daeKOZGJE500TAry1PsjJFQah4+wJKiQ02YJ1MY8nWx0ebXbY2OXR5WRJr896AWFCSOezc8J8YGqQsKH9Fvgo0ObHNXzGEkW/GzPGI4ySP7s+5Unjj/ttvrMtyfqYKhWoCemcX23x5okBzqoyj0h+OtbodlUMZU2Hy1NtLk+3uWyPF2AsenFqpcn/nRDhtTUWmsYzmtqPY7tvNHzGGsNyR2aMRxVKhORtgLa52+OHO1L8fl+a1rQaVGFTY1GpwWtrLc6ttlhUZlA7xo1IzJEcSAu2dHs835HJLelSwj090gGFaoiWWRrvmBzkU7PCTIvo7E6IXZ2ueNeJZeZy32j4jEWG7a7MGI+pqJ23LwQ0W8CTrQ4/3ZXikSZH5V1kWlFqapxQYnBKhcmrxqnch0lhnUqrsF3QikmXq3aD259SZfYvdqrl3q1xj+bM/rWDzmaVavVmWaXJJ2aGuXyChY7GYy1O2+Mtzg3fumnXvfLP86VvOHzGIsNtOECVH98BnN/zQtyTPNXq8puGNI80OSqHoRemDjVBnRkRnRNKDRaXmcwtMRgf0qkNaoyzdEx96NJGErXbW7crabMFzbakISnYHle5IDsSHnsSgsa0IOX1KrUf6lWTMDWic+3UEO+ZorRYW23Jr/amuh466Hzu0fWpO9+9IOj9cnglAX18Bs2wPs56GY95KPmz83u/nxbwQszlj/tUTsO2hIfT293vcUgyy6FVmWSr2qDap7U6oFNhqbL6qKERMVS+RTCHupArJUlP5Xg0ppSR2J8StNhKn6PZFnS5Eq+vcmWxrpKE2pDOFRMCfGBa8FB27eoOl9t3pGKrO9ybtnaJn9RHDGfn6yqG80/j4zMkht0P7uN53A5cfNRngN0JwdNtDvc12qxoU9sIZH3C903Y0o78VdNU/kXfBRuJ2hPW65270c+xincBVJsmhnQuHR/gXZODLKswsXQVL/ndvjS/2JNubk6LL0wKa7+IpTV3/QUVw/K38PEpFiM2gc4YkCmo1Za3kkO2MOlJtsUFK1od/tXs8Hy7y8G0OCzbdyxM+TMGKWhozCs1eNOEAG8Yb7GgVBkMV8LTbQ7f357iuXZ32+SwfuMPFkf/+vEXu8XT51QO7dw+PiPAiA7DjPEYB3xWwHW6klvLSc+GRk+3uSxvdVjV4bI3oVLGR6cH/XVO/WPoMCmkc8Y4i8vGW7y62mJS6PDEaVOXx527Uvxxv40j5PMLy8xPPn5m2fIbXopz+6KSQZ7cx2dkGfFhJ6Uk4cnQupj3fk9y04Iyo7rSGrgZjlC6pes6XVa2uazucNkSFzSnBZ3u6FbFllqqIvbkCpNXV5mcXWUxI6ofSnCTqL11/7DP5t69afYkPbcupP9lbtS46ZGNiS3fObeCT80qVDjbx2f0GJXntSMk1p2N5gUnRi+dXWJ86dVV5tLzqq2CiuHinqTVlmzp9lgbUzodW7o9DqQELY5UYsi5dtjojwEqaDWl+UlNUGdOZvn41EqThaUGNUGd3l1IC8mLnR5/2mfzt0ab7XGPkKG1zIzqt79hQuD/PdbktN04O8QbJobw8TmWGDVH/9KVncyMaDzc5M60dD5bH9LfcnFdoPSiOouZEaPgcnxHqKlNY1qwOyHYm1QVsbuT6vd2R9Ltqp90piq2x0bomlraNTRVCRvQVVVsMFMVW2oqj2JmRJXPT4voTIsY1AS1o9LmJdCQFDzT5nL/ASXI3JgU6BqyOqivnB7Rv/G3ZSX//MLmpLj7pNLCOunjM0YY1QjBOU910pj0uKDGDD3a4l7W5crPVFraKa+psrh4vMXJFSodfSiN9KQqn+92JR0ZlfOUUEuzPQs+hga6pmFqaj+YoK6WdMO6UlcP6sqo5CrO8yQcSAtejHk83KSMxdZuoXZ206DE1JprgvrP5kb1Hz+8Pbnvo4tL+OGJfjzD59hl1EOLUkres6abX+xIcuXU0ORn2933tdry3YbGlDlRg7OqTM6qsjixzGBKWB+RDZoGQkg1VdqVEKyNufy3Ram0b48LEr32iwkbWrzS0v45Oaz/6OdLS5766Lq4d2qFxbd8kWGfY5zRH4UZ3vp8FwlP8rfTSrXTnoydtDsh3t9qiytcSa2lQ31IZ26JwbJKkxPLTKZHdCaHlYBOQM9PRGcwOEKpjLU5kt0Jj5e7PdbFPF6MuezOJJD1zjfRgJChpSstbfnUiH7XKZXmQw802t03zApz/fQQfgq5z/HAmLuLr9/QzQP7Hc6uMq2Vbe7p7Y54R6fDJSkhJ/UEJQIGjLN0qgIaUyMG0yNK43NCSCly1QQ1yjIGxeonNV2gJPxSQpL2VIxEbeCkpjX7kmqnt+0Jj8aUSkvvcGRWkWQdCBlavNzSnpoS1n89r9T4x1/22x1XTArwKz+W4XOcMeYMRw9nLu9gS7fHOyYHzYcOOItabXlFSshL00LOcwTBbKsflg5hQ+3qFtBV7MLsJzbhSBXr8DJbRLpCrYTYmbiI6CsPluU4GVnBhgpLe3xqxPjz7Kj+xIMHnM4zq0z+cmrZaF9GH59hYcwajh5e/VQH2+OChguf4pQnzpnQ5ohXdzjy9SmPM1wpp9oiy96mgxUlzvNqBFQA9WCJqa2psLR/zY7qj15dH9zy9c1Je3ZU5++nlflTEp/jmmPm7j5neSfNtkeXC5fWBaw1Mbu+xZanJ1zOTgq51BZM9aSsdYSamRRR0BxDBTq7TJ09tQF9o6nxxLSI8Vx9SN9457Z44uzxQWZGDX651J+S+LwyOGYMRw/jH9jH1LIoaaG2PvjdyaXGDRsSEUtjzr6kNytsaEsTnlzQbMvagMYENCpTHkFbSKOnv7n2t5YgLA0R0LUEcCBssH9CSN8LPDcxpG8aH9I3XjUx2HrpEx326yar2dIZ5QG+utDP+vR5ZXHMGY7enL68i1Jd0JiWVFoaqztc4peO47MbEta6Lq+kxNDqW21RtS3uhbtdWV1uaVODulZqaRi9Ku/TmqZ1t9ui5UBatpQYxKdFjXh9SG8I6TT+YVmpo922z3v96aWMD+lIqXFulck1U/1sT59XLse04ejLHTuSbOwSrIo5TI4YmEBTWvByt8fedhfWxeHmBmAb8CJQAcZ58I4aOKMcakyqQio7dGZER5OSoKlzTrXFtVN8Q+Hj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+Pj4+PzSuP/AzE1e5ONHe7vAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE1LTEyLTIzVDIwOjA0OjMxKzAwOjAwHarZDQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNS0xMi0yM1QyMDowNDozMSswMDowMGz3YbEAAABNdEVYdHNvZnR3YXJlAEltYWdlTWFnaWNrIDYuOS4yLTcgUTE2IHg4Nl82NCAyMDE1LTEyLTAyIGh0dHA6Ly93d3cuaW1hZ2VtYWdpY2sub3Jnbo4WPwAAAEp0RVh0c3ZnOmJhc2UtdXJpAGZpbGU6Ly8vdG1wL3ZpZ25ldHRlL2MxZDQ0ZGY2LWM1ZDYtNDkwMC04ZDBhLWQ0OWVmMzBiZGE3MS5zdmd90CehAAAAGHRFWHRUaHVtYjo6RG9jdW1lbnQ6OlBhZ2VzADGn/7svAAAAGHRFWHRUaHVtYjo6SW1hZ2U6OkhlaWdodAAyNjLFg9PDAAAAF3RFWHRUaHVtYjo6SW1hZ2U6OldpZHRoADU3Mz0hlMwAAAAZdEVYdFRodW1iOjpNaW1ldHlwZQBpbWFnZS9zdme/73BOAAAAF3RFWHRUaHVtYjo6TVRpbWUAMTQ1MDkwMTA3McPsyX0AAAAPdEVYdFRodW1iOjpTaXplADBCQpSiPuwAAABIdEVYdFRodW1iOjpVUkkAZmlsZTovLy90bXAvdmlnbmV0dGUvYzFkNDRkZjYtYzVkNi00OTAwLThkMGEtZDQ5ZWYzMGJkYTcxLnN2Z4N+SbEAAAAASUVORK5CYII=' style='display: block; margin-left: auto; margin-right: auto; margin-top: 7px; width: 89px;'/></span>\").width(\"120px\").css(\"float\",\"left\").css(\"padding-left\",\"0\");$('.report-name').css(\"font-weight\",\"bold\");"+"\n"+ +// "$('.logo-content' ).remove();"+"\n"+ +// "$('#slide-out li:first-child').on('click', function(){ $('#charts-row').hide() }) ; $('#slide-out li:last-child').on('click', function(){ $('#charts-row').show() });"+"\n"+ +// "$('.charts div:nth-child(2)').remove();"+"\n"+ + "})"; - private static ExtentReports extent; + public enum suiteNameXml { + + TESTNG_FAILED_XML_NAME("testng-failed.xml"); + + suiteNameXml(String value) { + this.value = value; + } + + private String value; + + public String getValue() { + return value; + } + + } - public synchronized static ExtentReports getReporter(String filePath) { - if (extent == null) { - // initialize the HtmlReporter - ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter(filePath); - - // initialize ExtentReports and attach the HtmlReporter - extent = new ExtentReports(); + public synchronized static ExtentReports setReporter(String filePath, String htmlFile, Boolean isAppend) throws Exception { + String dbIp = Utils.getConfig().getReportDBhost(); + int dbPort = Utils.getConfig().getReportDBport(); - // attach all reporters - extent.attachReporter(htmlReporter); - - + if (extent == null) { + extentxReporter = new ExtentXReporter(dbIp, dbPort); + extent = new ExtentReports(); + initAndSetExtentHtmlReporter(filePath, htmlFile, isAppend); + + if(extentxReporter.config().getReportObjectId() != null){ + setExtentXReporter(isAppend); + }else{ + extentxReporter.stop(); + } } - return extent; } - public synchronized static ExtentHtmlReporter setConfiguration(ExtentHtmlReporter htmlReporter) { + public synchronized static void setExtentXReporter(Boolean isAppend){ + extentxReporter.setAppendExisting(isAppend); + extent.attachReporter(extentxReporter); + } + + public synchronized static void initAndSetExtentHtmlReporter(String filePath, String htmlFile, Boolean isAppend) throws Exception{ + htmlReporter = new ExtentHtmlReporter(filePath + htmlFile); + setConfiguration(htmlReporter); + htmlReporter.setAppendExisting(isAppend); + extent.attachReporter(htmlReporter); + } + + public synchronized static ExtentReports getReporter() { + return extent; + } + + public static void initReporter(String filepath, String htmlFile, ITestContext context) throws Exception { + + String onboardVersion = AutomationUtils.getOnboardVersion(); + String osVersion = AutomationUtils.getOSVersion(); + Config config = Utils.getConfig(); + String envData = config.getUrl(); + String suiteName = getSuiteName(context); + + if(suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())){ + if (config.getUseBrowserMobProxy()) + setTrafficCaptue(config); + + setReporter(filepath, htmlFile, true); + String suiteNameFromVersionInfoFile = FileHandling.getKeyByValueFromPropertyFormatFile(filepath + VERSIONS_INFO_FILE_NAME, "suiteName"); + reporterDataDefinition(onboardVersion, osVersion, envData, suiteNameFromVersionInfoFile); + }else{ + FileHandling.deleteDirectory(ComponentBaseTest.getReportFolder()); + FileHandling.createDirectory(filepath); + setReporter(filepath, htmlFile, false); + reporterDataDefinition(onboardVersion, osVersion, envData, suiteName); + AutomationUtils.createVersionsInfoFile(filepath + VERSIONS_INFO_FILE_NAME, onboardVersion, osVersion, envData, suiteName); + } + + } + + public static void reporterDataDefinition(String onboardVersion, String osVersion, String envData, String suiteNameFromVersionInfoFile) throws Exception { + extent.setSystemInfo("Onboard Version", onboardVersion); + extent.setSystemInfo("OS Version", osVersion); +// extent.setSystemInfo("Host Name Address", RestCDUtils.getExecutionHostAddress()); + extent.setSystemInfo("ExecutedOn", envData); + extent.setSystemInfo("SuiteName", suiteNameFromVersionInfoFile); + } + + public static String getSuiteName(ITestContext context) { + String suitePath = context.getSuite().getXmlSuite().getFileName(); + if(suitePath != null){ + File file = new File(suitePath); + String suiteName = file.getName(); + return suiteName; + } + return null; + } + + public synchronized static ExtentHtmlReporter setConfiguration(ExtentHtmlReporter htmlReporter) throws Exception { + htmlReporter.config().setTheme(Theme.STANDARD); - htmlReporter.config().setEncoding("UTF-8"); - htmlReporter.config().setProtocol(Protocol.HTTPS); - - htmlReporter.config().setDocumentTitle("ASDC Automation Report"); - + htmlReporter.config().setDocumentTitle("SDC Automation Report"); htmlReporter.config().setChartVisibilityOnOpen(true); - - htmlReporter.config().setReportName(AutomationUtils.getOSVersion()); - +// htmlReporter.config().setReportName(AutomationUtils.getATTVersion()); + htmlReporter.config().setReportName("SDC Automation Report"); + htmlReporter.config().setChartVisibilityOnOpen(false); + htmlReporter.config().setJS(icon); return htmlReporter; } - - public synchronized static ExtentReports getReporter() { - return extent; - } + + public static void closeReporter(){ + extent.flush(); + } + + public static void setTrafficCaptue(Config config) { + boolean mobProxyStatus = config.getUseBrowserMobProxy(); + if (mobProxyStatus){ + config.setCaptureTraffic(true);; + } + } } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestActions.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestActions.java new file mode 100644 index 0000000000..f865ef1699 --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestActions.java @@ -0,0 +1,111 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.ci.tests.api; + +import com.aventstack.extentreports.ExtentTest; +import com.aventstack.extentreports.MediaEntityBuilder; +import com.aventstack.extentreports.Status; +import com.aventstack.extentreports.markuputils.ExtentColor; +import com.aventstack.extentreports.markuputils.Markup; +import com.aventstack.extentreports.markuputils.MarkupHelper; + +import java.io.File; + + +public class ExtentTestActions { + + public static void log(Status logStatus, Markup mark){ + ExtentTest test = ExtentTestManager.getTest(); + test.log(logStatus, mark); + } + + public static void log(Status logStatus, String message){ + ExtentTest test = ExtentTestManager.getTest(); + test.log(logStatus, message); + } + + public static void log(Status logStatus, String message, String duration){ + log(logStatus, message + addDurationTag(duration)); + } + + public static void log(Status logStatus, Throwable throwabel){ + ExtentTest test = ExtentTestManager.getTest(); + test.log(logStatus, throwabel); + } + + public static void addTag(Status logStatus, String message){ + Markup m = null; + switch(logStatus){ + case PASS: + m = MarkupHelper.createLabel(message, ExtentColor.GREEN); + break; + case FAIL: + m = MarkupHelper.createLabel(message, ExtentColor.RED); + break; + case SKIP: + m = MarkupHelper.createLabel(message, ExtentColor.BLUE); + break; + case FATAL: + m = MarkupHelper.createLabel(message, ExtentColor.BROWN); + break; + default: + break; + } + + if (m != null){ + log(logStatus, m); + } + } + +// public static String addScreenshot(Status logStatus, String screenshotName, String message) throws IOException{ +// String imageFilePath = null; +// String uuid = UUID.randomUUID().toString(); +// String[] stringArray = uuid.split("-"); +// screenshotName = screenshotName + "-" + stringArray[stringArray.length - 1]; +// try { +// File imageFile = GeneralUIUtils.takeScreenshot(screenshotName, SetupCDTest.getScreenshotFolder()); +// imageFilePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFile.toURI()).getPath(); +// } catch (IOException e) { +// e.printStackTrace(); +// } +// +// ExtentTest test = ExtentTestManager.getTest(); +// test.log(logStatus, message, MediaEntityBuilder.createScreenCaptureFromPath(imageFilePath).build()); +// return imageFilePath; +// } + + private static String addDurationTag(String duration){ + return "<td width=\"80px\">" + duration + "</td>"; + } + + public static String addLinkTag(String fileName, String pathToFile){ + return String.format("<a download=\"%s\" href=\"%s\">HAR file</a>", fileName, pathToFile); + } + + public static void addFileToReportAsLink(File harFile, String pathToFileFromReportDirectory, String message) { + log(Status.INFO, message, addLinkTag(harFile.getName(), pathToFileFromReportDirectory)); + } + + + + + +} diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java index 9c4acd4367..3d8c6a999e 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/ExtentTestManager.java @@ -20,11 +20,10 @@ package org.openecomp.sdc.ci.tests.api; -import java.util.HashMap; - import com.aventstack.extentreports.ExtentReports; import com.aventstack.extentreports.ExtentTest; +import java.util.HashMap; public class ExtentTestManager { @@ -37,8 +36,6 @@ public class ExtentTestManager { public static synchronized void endTest() { // extent.endTest(extentTestMap.get(Thread.currentThread().getId())); -// extentTestMap.get(Thread.currentThread().getId()); // This is test - // TODO: maybe uncomment becuase we will need it only at the end extent.flush(); } @@ -52,5 +49,14 @@ public class ExtentTestManager { return test; } + + public static synchronized <T> void assignCategory(Class<T> clazz){ + String[] parts = clazz.getName().split("\\."); + String lastOne1 = parts[parts.length-1]; + String lastOne2 = parts[parts.length-2]; + getTest().assignCategory(lastOne2 + "-" + lastOne1); + } + + } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java index ea1c9eff8d..15a1eb783a 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/api/Urls.java @@ -364,5 +364,7 @@ public interface Urls { final String ONBOARD_VERSION = "http://%s:%s/onboarding-api/docs/build-info.json"; final String OS_VERSION = "http://%s:%s/sdc2/rest/version"; +// amdocs APIs + final String GET_VENDOR_SOFTWARE_PRODUCT = "http://%s:%s/onboarding-api/v1.0/vendor-software-products/packages/%s"; } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnbordingDataProviders.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnbordingDataProviders.java new file mode 100644 index 0000000000..8b58ca9993 --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProviders/OnbordingDataProviders.java @@ -0,0 +1,72 @@ +package org.openecomp.sdc.ci.tests.dataProviders; + +import org.openecomp.sdc.ci.tests.utils.general.FileHandling; +import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtils; +import org.testng.annotations.DataProvider; + + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +public class OnbordingDataProviders { + + protected static String filepath = FileHandling.getVnfRepositoryPath(); + +// -----------------------dataProviders----------------------------------------- + @DataProvider(name = "randomVNF_List", parallel = false) + private static final Object[][] randomVnfList() throws Exception { + int randomElementNumber = 3; //how many VNFs to onboard randomly + List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileListExcludeToscaParserFailure(); + List<String> newRandomFileNamesFromFolder = getRandomElements(randomElementNumber, fileNamesFromFolder); + System.out.println(String.format("There are %s zip file(s) to test", newRandomFileNamesFromFolder.size())); + return provideData(newRandomFileNamesFromFolder, filepath); + } + + @DataProvider(name = "VNF_List" , parallel = true) + private static final Object[][] VnfList() throws Exception { + + List<String> fileNamesFromFolder = OnboardingUtils.getVnfNamesFileList(); + + System.out.println(String.format("There are %s zip file(s) to test", fileNamesFromFolder.size())); + return provideData(fileNamesFromFolder, filepath); + } + +// -----------------------factories----------------------------------------- + + + + +// -----------------------methods----------------------------------------- + public static Object[][] provideData(List<String> fileNamesFromFolder, String filepath) { + + Object[][] arObject = new Object[fileNamesFromFolder.size()][]; + int index = 0; + for (Object obj : fileNamesFromFolder) { + arObject[index++] = new Object[] { filepath, obj }; + } + return arObject; + } + + private static List<String> getRandomElements(int randomElementNumber, List<String> fileNamesFromFolder) { + if(fileNamesFromFolder.size() == 0 || fileNamesFromFolder.size() < randomElementNumber){ + return null; + }else{ + List<Integer> indexList = new ArrayList<>(); + List<String> newRandomFileNamesFromFolder = new ArrayList<>(); + for(int i = 0; i < fileNamesFromFolder.size(); i++){ + indexList.add(i); + } + Collections.shuffle(indexList); + Integer[] randomArray = indexList.subList(0, randomElementNumber).toArray(new Integer[randomElementNumber]); + for(int i = 0; i < randomArray.length; i++){ + newRandomFileNamesFromFolder.add(fileNamesFromFolder.get(randomArray[i])); + } + return newRandomFileNamesFromFolder; + } + } + + + + +} diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AmdocsLicenseMembers.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AmdocsLicenseMembers.java new file mode 100644 index 0000000000..9c2cfa809c --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/AmdocsLicenseMembers.java @@ -0,0 +1,56 @@ +package org.openecomp.sdc.ci.tests.datatypes; + +public class AmdocsLicenseMembers { + + private String vendorId; + private String vendorLicenseName; + private String vendorLicenseAgreementId; + private String featureGroupId; + + public AmdocsLicenseMembers(String vendorId, String vendorLicenseName, String vendorLicenseAgreementId, String featureGroupId) { + super(); + this.vendorId = vendorId; + this.vendorLicenseName = vendorLicenseName; + this.vendorLicenseAgreementId = vendorLicenseAgreementId; + this.featureGroupId = featureGroupId; + } + + public String getVendorId() { + return vendorId; + } + + public void setVendorId(String vendorId) { + this.vendorId = vendorId; + } + + public String getVendorLicenseName() { + return vendorLicenseName; + } + + public void setVendorLicenseName(String vendorLicenseName) { + this.vendorLicenseName = vendorLicenseName; + } + + public String getVendorLicenseAgreementId() { + return vendorLicenseAgreementId; + } + + public void setVendorLicenseAgreementId(String vendorLicenseAgreementId) { + this.vendorLicenseAgreementId = vendorLicenseAgreementId; + } + + public String getFeatureGroupId() { + return featureGroupId; + } + + public void setFeatureGroupId(String featureGroupId) { + this.featureGroupId = featureGroupId; + } + + @Override + public String toString() { + return "AmdocsLicenseMembers [vendorId=" + vendorId + ", vendorLicenseName=" + vendorLicenseName + ", vendorLicenseAgreementId=" + vendorLicenseAgreementId + ", featureGroupId=" + featureGroupId + "]"; + } + + +} diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java index 8456e5b35b..5a80fd14ca 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ResourceReqDetails.java @@ -35,8 +35,10 @@ public class ResourceReqDetails extends ComponentReqDetails { Boolean isAbstract; Boolean isHighestVersion; String cost; + String licenseType; String toscaResourceName; + String resourceVendorModelNumber; private String resourceType = ResourceTypeEnum.VFC.toString(); // Default // value @@ -45,6 +47,21 @@ public class ResourceReqDetails extends ComponentReqDetails { super(); } + public ResourceReqDetails(List<String> derivedFrom, String vendorName, String vendorRelease, Boolean isAbstract, Boolean isHighestVersion, String cost, String licenseType, String toscaResourceName, String resourceVendorModelNumber, + String resourceType) { + super(); + this.derivedFrom = derivedFrom; + this.vendorName = vendorName; + this.vendorRelease = vendorRelease; + this.isAbstract = isAbstract; + this.isHighestVersion = isHighestVersion; + this.cost = cost; + this.licenseType = licenseType; + this.toscaResourceName = toscaResourceName; + this.resourceVendorModelNumber = resourceVendorModelNumber; + this.resourceType = resourceType; + } + public ResourceReqDetails(Resource resource) { super(); this.resourceType = resource.getResourceType().toString(); @@ -68,6 +85,7 @@ public class ResourceReqDetails extends ComponentReqDetails { this.UUID = resource.getUUID(); this.categories = resource.getCategories(); this.importedToscaChecksum = resource.getImportedToscaChecksum(); + this.resourceVendorModelNumber = resource.getResourceVendorModelNumber(); } @@ -136,6 +154,13 @@ public class ResourceReqDetails extends ComponentReqDetails { this.toscaResourceName = resourceName; } + public String getResourceVendorModelNumber() { + return resourceVendorModelNumber; + } + + public void setResourceVendorModelNumber(String resourceVendorModelNumber) { + this.resourceVendorModelNumber = resourceVendorModelNumber; + } public String getToscaResourceName() { return toscaResourceName; } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java index e33183ca94..2f3d648ef6 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/ServiceReqDetails.java @@ -26,6 +26,43 @@ import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.category.CategoryDefinition; public class ServiceReqDetails extends ComponentReqDetails { + + protected String serviceType; + protected String serviceRole; + protected String namingPolicy; + protected Boolean ecompGeneratedNaming; + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getServiceRole() { + return serviceRole; + } + + public void setServiceRole(String serviceRole) { + this.serviceRole = serviceRole; + } + + public String getNamingPolicy() { + return namingPolicy; + } + + public void setNamingPolicy(String namingPolicy) { + this.namingPolicy = namingPolicy; + } + + public Boolean getEcompGeneratedNaming() { + return ecompGeneratedNaming; + } + + public void setEcompGeneratedNaming(Boolean ecompGeneratedNaming) { + this.ecompGeneratedNaming = ecompGeneratedNaming; + } public ServiceReqDetails(String serviceName, String category, ArrayList<String> tags, String description, String contactId, String icon) { diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java new file mode 100644 index 0000000000..fbdb88e712 --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java @@ -0,0 +1,102 @@ +package org.openecomp.sdc.ci.tests.datatypes; + +public class VendorSoftwareProductObject { + + private String vendorName; + private String vspId; + private String category; + private String subCategory; + private String componentId; + private String description; + private String attContact; + private String vspName; + + public VendorSoftwareProductObject() { + super(); + // TODO Auto-generated constructor stub + } + + public VendorSoftwareProductObject(String vendorName, String vspId, String category, String subCategory, String componentId, String description, String attContact) { + super(); + this.vendorName = vendorName; + this.vspId = vspId; + this.category = category; + this.subCategory = subCategory; + this.componentId = componentId; + this.description = description; + this.attContact = attContact; + } + + + public String getVspName() { + return vspName; + } + + public void setVspName(String vspName) { + this.vspName = vspName; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSubCategory() { + return subCategory; + } + + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + public String getComponentId() { + return componentId; + } + + public void setComponentId(String componentId) { + this.componentId = componentId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getAttContact() { + return attContact; + } + + public void setAttContact(String attContact) { + this.attContact = attContact; + } + + @Override + public String toString() { + return "VendorSoftwareProductObject [vendorName=" + vendorName + ", vspId=" + vspId + ", category=" + category + ", subCategory=" + subCategory + ", componentId=" + componentId + ", description=" + description + ", attContact=" + + attContact + "]"; + } + + +} diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java index 7e363202bb..1f578d108c 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/ArtifactServletTest.java @@ -311,7 +311,7 @@ public class ArtifactServletTest extends ComponentBaseTest { httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate); httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId()); if (addMd5Header) { - httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody)); + httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody)); } StringEntity input = new StringEntity(jsonBody); input.setContentType("application/json"); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java index bb2b662009..5f1230f4ce 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/artifacts/DownloadComponentArt.java @@ -624,7 +624,7 @@ artifact.setArtifactLabel("configure");*/ httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate); httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId()); if (addMd5Header) { - httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody)); + httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody)); } StringEntity input = new StringEntity(jsonBody); input.setContentType("application/json"); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java index 7ba705fc7d..258619292f 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/distribution/DistributionDownloadArtifactTest.java @@ -212,7 +212,7 @@ public class DistributionDownloadArtifactTest extends ComponentBaseTest { AssertJUnit.assertEquals(artifactDetails.getPayload(), Base64.encodeBase64String(actualContents.getBytes())); // validating checksum - String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(actualContents.getBytes()); + String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(actualContents.getBytes()); AssertJUnit.assertEquals(expectedPayloadChecksum, actualPayloadChecksum); // validate audit @@ -380,7 +380,7 @@ public class DistributionDownloadArtifactTest extends ComponentBaseTest { // validating checksum byte[] bytes = actualContents.getBytes(); - String actualPayloadChecksum = GeneralUtility.calculateMD5ByByteArray(bytes); + String actualPayloadChecksum = GeneralUtility.calculateMD5Base64EncodedByByteArray(bytes); assertEquals(expectedPayloadChecksum, actualPayloadChecksum); // validating valid zip diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java index c069f984d2..56deb3e08b 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/imports/ImportNewResourceCITest.java @@ -189,7 +189,7 @@ public class ImportNewResourceCITest extends ComponentBaseTest { + " \"icon\": \"router\",\r\n" + " \"tags\": [\r\n" + " \"importResource4test\"\r\n" + " ],\r\n" + " \"payloadData\": \"" + encodedPayload + "\"\r\n" + "}"; - String md5 = GeneralUtility.calculateMD5ByString(json); + String md5 = GeneralUtility.calculateMD5Base64EncodedByString(json); Map<String, String> headers = new HashMap<String, String>(); headers.put(Constants.MD5_HEADER, md5); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java new file mode 100644 index 0000000000..2b341f5cbf --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/sanity/Onboard.java @@ -0,0 +1,126 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.ci.tests.sanity; + + + + + +import org.junit.Rule; +import org.junit.rules.TestName; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; +import org.openecomp.sdc.ci.tests.api.ExtentTestActions; +import org.openecomp.sdc.ci.tests.dataProviders.OnbordingDataProviders; +import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; +import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; +import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject; +import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; +import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; +import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; +import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; +import org.openecomp.sdc.ci.tests.utils.general.OnboardingUtillViaApis; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Optional; +import org.testng.annotations.Parameters; +import org.testng.annotations.Test; + +import com.aventstack.extentreports.Status; +import com.clearspring.analytics.util.Pair; + +import fj.data.Either; + + + + + + +public class Onboard extends ComponentBaseTest { + + + @Rule + public static TestName name = new TestName(); + + public Onboard() { + super(name, Onboard.class.getName()); + } + + protected String makeDistributionValue; + + + + @Parameters({ "makeDistribution" }) + @BeforeMethod + public void beforeTestReadParams(@Optional("true") String makeDistributionReadValue) { + makeDistributionValue = makeDistributionReadValue; + } + + + @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List") + public void onboardVNFShotFlow(String filepath, String vnfFile) throws Exception, Throwable { + setLog(vnfFile); + System.out.println("print - >" + makeDistributionValue); + runOnboardToDistributionFlow(filepath, vnfFile); + } + + + + + + public void runOnboardToDistributionFlow(String filepath, String vnfFile) throws Exception { + + ExtentTestActions.log(Status.INFO, String.format("Going to onboard the VNF %s", vnfFile)); + User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); + + Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = OnboardingUtillViaApis.createVspViaApis(filepath, vnfFile, user); + VendorSoftwareProductObject vendorSoftwareProductObject = createVendorSoftwareProduct.right; + vendorSoftwareProductObject.setVspName(createVendorSoftwareProduct.left); + + // create VF base on VNF imported from previous step - have, resourceReqDetails object include part of resource metadata + ResourceReqDetails resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(vendorSoftwareProductObject, vendorSoftwareProductObject.getVspName()); + ExtentTestActions.log(Status.INFO, String.format("Create VF %s From VSP", resourceReqDetails.getName())); + Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails, vendorSoftwareProductObject.getVspName()); + ExtentTestActions.log(Status.INFO, String.format("Certify VF")); + resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft(); + + //--------------------------SERVICE-------------------------------- + ServiceReqDetails serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(user); + ExtentTestActions.log(Status.INFO, String.format("Create Service %s", serviceReqDetails.getName())); + Service service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value(); + ExtentTestActions.log(Status.INFO, String.format("add VF to Service")); + Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true); + addComponentInstanceToComponentContainer.left().value(); + ExtentTestActions.log(Status.INFO, String.format("Certify Service")); + service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft(); + + ExtentTestActions.log(Status.INFO, String.format("Distribute Service")); + AtomicOperationUtils.distributeService(service, true); + + ExtentTestActions.log(Status.INFO, String.format("The onboarding %s test is passed ! ", vnfFile)); + } + + + +} diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java index 18b2329663..d7ac4a5676 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaDefinition.java @@ -29,9 +29,7 @@ public class ToscaDefinition { String tosca_definitions_version; Map<String, String> metadata; -// Map<String, ToscaImportsDefinition> imports; -// TODO waiting for answer about imports representation - Object imports; + List<Map<String, ToscaImportsDefinition>> imports; Map<String, ToscaNodeTypesDefinition> node_types; ToscaTopologyTemplateDefinition topology_template; @@ -39,54 +37,49 @@ public class ToscaDefinition { super(); } - @Override - public String toString() { - return "ToscaDefinition [tosca_definitions_version=" + tosca_definitions_version + ", metadata=" + metadata + ", imports=" + imports + ", node_types=" + node_types + ", topology_template=" + topology_template + "]"; - } - public String getTosca_definitions_version() { - return tosca_definitions_version; - } - public void setTosca_definitions_version(String tosca_definitions_version) { + public ToscaDefinition(String tosca_definitions_version, Map<String, String> metadata, List<Map<String, ToscaImportsDefinition>> imports, Map<String, ToscaNodeTypesDefinition> node_types, + ToscaTopologyTemplateDefinition topology_template) { + super(); this.tosca_definitions_version = tosca_definitions_version; + this.metadata = metadata; + this.imports = imports; + this.node_types = node_types; + this.topology_template = topology_template; } + + public Map<String, String> getMetadata() { return metadata; } + + public void setMetadata(Map<String, String> metadata) { this.metadata = metadata; } - - -// public Map<String,ToscaImportsDefinition> getImports() { -// return (Map<String, ToscaImportsDefinition>) imports; -// } -// -// public void setImports(Map<String,ToscaImportsDefinition> imports) { -// this.imports = imports; -// } -// -// public List<ToscaImportsDefinition> getImports() { -// return (List<ToscaImportsDefinition>) imports; -// } -// -// public void setImports(List<ToscaImportsDefinition> imports) { -// this.imports = imports; -// } - - public Object getImports() { + + public List<Map<String, ToscaImportsDefinition>> getImports() { return imports; } - public void setImports(Object imports) { + public void setImports(List<Map<String, ToscaImportsDefinition>> imports) { this.imports = imports; } + public String getTosca_definitions_version() { + return tosca_definitions_version; + } + + public void setTosca_definitions_version(String tosca_definitions_version) { + this.tosca_definitions_version = tosca_definitions_version; + } + + public Map<String, ToscaNodeTypesDefinition> getNode_types() { return node_types; } @@ -109,9 +102,7 @@ public class ToscaDefinition { public static TypeDescription getTypeDescription(){ TypeDescription typeDescription = new TypeDescription(ToscaDefinition.class); typeDescription.putMapPropertyType("metadata", String.class, String.class); -// TODO Andrey imports format - typeDescription.putMapPropertyType("imports", String.class, ToscaImportsDefinition.class); -// typeDescription.putListPropertyType("imports", List.class); + typeDescription.putListPropertyType("imports", Map.class); typeDescription.putMapPropertyType("node_types", String.class, ToscaNodeTypesDefinition.class); return typeDescription; } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java index dc3c40751c..e3051515cd 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsTopologyTemplateDefinition.java @@ -35,17 +35,17 @@ public class ToscaGroupsTopologyTemplateDefinition { private Map<String, Object> interfaces; private List<String> members; // private Map<String, String> metadata; - private ToscaGroupsMetadataDefinition metadata; + private ToscaServiceGroupsMetadataDefinition metadata; public ToscaGroupsTopologyTemplateDefinition() { super(); } - public ToscaGroupsMetadataDefinition getMetadata() { + public ToscaServiceGroupsMetadataDefinition getMetadata() { return metadata; } - public void setMetadata(ToscaGroupsMetadataDefinition metadata) { + public void setMetadata(ToscaServiceGroupsMetadataDefinition metadata) { this.metadata = metadata; } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java index d62e33e1dd..a5070b8662 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaImportsDefinition.java @@ -20,8 +20,11 @@ package org.openecomp.sdc.ci.tests.tosca.datatypes; +import org.yaml.snakeyaml.TypeDescription; + public class ToscaImportsDefinition { + private String name; private String file; private String repository; private String namespace_uri; @@ -32,17 +35,21 @@ public class ToscaImportsDefinition { // TODO Auto-generated constructor stub } - public ToscaImportsDefinition(String file, String repository, String namespace_uri, String namespace_prefix) { + public ToscaImportsDefinition(String name, String file, String repository, String namespace_uri, String namespace_prefix) { super(); + this.name = name; this.file = file; this.repository = repository; this.namespace_uri = namespace_uri; this.namespace_prefix = namespace_prefix; } - @Override - public String toString() { - return "ToscaImportsDefinition [file=" + file + ", repository=" + repository + ", namespace_uri=" + namespace_uri + ", namespace_prefix=" + namespace_prefix + "]"; + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; } public String getFile() { @@ -76,6 +83,13 @@ public class ToscaImportsDefinition { public void setNamespace_prefix(String namespace_prefix) { this.namespace_prefix = namespace_prefix; } + + //gets Type description for Yaml snake + public static TypeDescription getTypeDescription(){ + TypeDescription typeDescription = new TypeDescription(ToscaImportsDefinition.class); + return typeDescription; + } + } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java index 6f9590f0ae..45feadecca 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaInputsTopologyTemplateDefinition.java @@ -22,6 +22,8 @@ package org.openecomp.sdc.ci.tests.tosca.datatypes; import java.util.Map; +import org.yaml.snakeyaml.TypeDescription; + public class ToscaInputsTopologyTemplateDefinition { private Map<String,Map<String,Object>> inputs; @@ -40,6 +42,10 @@ public class ToscaInputsTopologyTemplateDefinition { } - + //gets Type description for Yaml snake + public static TypeDescription getTypeDescription(){ + TypeDescription typeDescription = new TypeDescription(ToscaInputsTopologyTemplateDefinition.class); + return typeDescription; + } } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaMetadataDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaMetadataDefinition.java new file mode 100644 index 0000000000..ceba7adbe4 --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaMetadataDefinition.java @@ -0,0 +1,196 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.ci.tests.tosca.datatypes; + +import org.yaml.snakeyaml.TypeDescription; + +public class ToscaMetadataDefinition { + + private String invariantUUID; + private String UUID; + private String name; + private String description; + private String type; + private String category; + private String subcategory; + private String resourceVendor; + private String resourceVendorRelease; + private String resourceVendorModelNumber; + private String serviceType; + private String serviceRole; + private String serviceEcompNaming; + private String ecompGeneratedNaming; + private String namingPolicy; + + public ToscaMetadataDefinition(String invariantUUID, String uUID, String name, String description, String type, String category, String subcategory, String resourceVendor, String resourceVendorRelease, String resourceVendorModelNumber, + String serviceType, String serviceRole, String serviceEcompNaming, String ecompGeneratedNaming, String namingPolicy) { + super(); + this.invariantUUID = invariantUUID; + UUID = uUID; + this.name = name; + this.description = description; + this.type = type; + this.category = category; + this.subcategory = subcategory; + this.resourceVendor = resourceVendor; + this.resourceVendorRelease = resourceVendorRelease; + this.resourceVendorModelNumber = resourceVendorModelNumber; + this.serviceType = serviceType; + this.serviceRole = serviceRole; + this.serviceEcompNaming = serviceEcompNaming; + this.ecompGeneratedNaming = ecompGeneratedNaming; + this.namingPolicy = namingPolicy; + } + + public String getInvariantUUID() { + return invariantUUID; + } + + public void setInvariantUUID(String invariantUUID) { + this.invariantUUID = invariantUUID; + } + + public String getUUID() { + return UUID; + } + + public void setUUID(String uUID) { + UUID = uUID; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSubcategory() { + return subcategory; + } + + public void setSubcategory(String subcategory) { + this.subcategory = subcategory; + } + + public String getResourceVendor() { + return resourceVendor; + } + + public void setResourceVendor(String resourceVendor) { + this.resourceVendor = resourceVendor; + } + + public String getResourceVendorRelease() { + return resourceVendorRelease; + } + + public void setResourceVendorRelease(String resourceVendorRelease) { + this.resourceVendorRelease = resourceVendorRelease; + } + + public String getResourceVendorModelNumber() { + return resourceVendorModelNumber; + } + + public void setResourceVendorModelNumber(String resourceVendorModelNumber) { + this.resourceVendorModelNumber = resourceVendorModelNumber; + } + + public String getServiceType() { + return serviceType; + } + + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + + public String getServiceRole() { + return serviceRole; + } + + public void setServiceRole(String serviceRole) { + this.serviceRole = serviceRole; + } + + public String getServiceEcompNaming() { + return serviceEcompNaming; + } + + public void setServiceEcompNaming(String serviceEcompNaming) { + this.serviceEcompNaming = serviceEcompNaming; + } + + public String getEcompGeneratedNaming() { + return ecompGeneratedNaming; + } + + public void setEcompGeneratedNaming(String ecompGeneratedNaming) { + this.ecompGeneratedNaming = ecompGeneratedNaming; + } + + public String getNamingPolicy() { + return namingPolicy; + } + + public void setNamingPolicy(String namingPolicy) { + this.namingPolicy = namingPolicy; + } + + @Override + public String toString() { + return "ToscaMetadataDefinition [invariantUUID=" + invariantUUID + ", UUID=" + UUID + ", name=" + name + ", description=" + description + ", type=" + type + ", category=" + category + ", subcategory=" + subcategory + + ", resourceVendor=" + resourceVendor + ", resourceVendorRelease=" + resourceVendorRelease + ", resourceVendorModelNumber=" + resourceVendorModelNumber + ", serviceType=" + serviceType + ", serviceRole=" + serviceRole + + ", serviceEcompNaming=" + serviceEcompNaming + ", ecompGeneratedNaming=" + ecompGeneratedNaming + ", namingPolicy=" + namingPolicy + "]"; + } + + //gets Type description for Yaml snake + public static TypeDescription getTypeDescription(){ + TypeDescription typeDescription = new TypeDescription(ToscaMetadataDefinition.class); + return typeDescription; + } + +} diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsMetadataDefinition.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaServiceGroupsMetadataDefinition.java index eec057ed52..86ca8f56cf 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaGroupsMetadataDefinition.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/datatypes/ToscaServiceGroupsMetadataDefinition.java @@ -20,7 +20,7 @@ package org.openecomp.sdc.ci.tests.tosca.datatypes; -public class ToscaGroupsMetadataDefinition { +public class ToscaServiceGroupsMetadataDefinition { private String vfModuleModelName; private String vfModuleModelInvariantUUID; @@ -28,7 +28,7 @@ public class ToscaGroupsMetadataDefinition { private String vfModuleModelUUID; private String vfModuleModelVersion; - public ToscaGroupsMetadataDefinition() { + public ToscaServiceGroupsMetadataDefinition() { super(); // TODO Auto-generated constructor stub } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/model/ToscaMetadataFieldsPresentationEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/model/ToscaMetadataFieldsPresentationEnum.java new file mode 100644 index 0000000000..cdea2ff69c --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/tosca/model/ToscaMetadataFieldsPresentationEnum.java @@ -0,0 +1,74 @@ +package org.openecomp.sdc.ci.tests.tosca.model; + +public class ToscaMetadataFieldsPresentationEnum { + + public enum ToscaMetadataFieldsEnum { +// general + INVARIANT_UUID ("invariantUUID", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value), + UUID ("UUID", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value), + NAME ("name", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value), + DESCRIPTION ("description", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value), + CATEGORY ("category", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value), + TYPE ("type", ComponentTypeEnum.RESOURCE_SERVICE_NODE_TEMPLATE.value), + +// resource + SUBCATEGORY ("subcategory", ComponentTypeEnum.RESOURCE_NODE_TEMPLATE.value), + RESOURCE_VENDOR_NAME ("resourceVendor", ComponentTypeEnum.RESOURCE_NODE_TEMPLATE.value), + RESOURCE_VENDOR_RELEASE ("resourceVendorRelease", ComponentTypeEnum.RESOURCE_NODE_TEMPLATE.value), + RESOURCE_VENDOR_MODEL_NUMBER ("resourceVendorModelNumber", ComponentTypeEnum.RESOURCE_NODE_TEMPLATE.value), + +// service + SERVICE_TYPE ("serviceType", ComponentTypeEnum.SERVICE.value), + SERVICE_ROLE ("serviceRole", ComponentTypeEnum.SERVICE.value), + SERVICE_ECOMP_NAMING ("serviceEcompNaming", ComponentTypeEnum.SERVICE.value), + ECOMP_GENERATED_NAMING ("ecompGeneratedNaming", ComponentTypeEnum.SERVICE.value), + NAMING_POLICY ("namingPolicy", ComponentTypeEnum.SERVICE.value), + +// node_template + CUSTOMIZATION_UUID ("customizationUUID", ComponentTypeEnum.NODE_TEMPLATE.value), + VERSION ("version", ComponentTypeEnum.RESOURCE_GROUP_NODE_TEMPLATE.value), + +// service group: + VF_MODULE_MODEL_NAME ("vfModuleModelName", ComponentTypeEnum.RESOURCE_GROUP_SERVICE_GROUP.value), + VF_MODULE_MODEL_INVARIANT_UUID ("vfModuleModelInvariantUUID", ComponentTypeEnum.RESOURCE_GROUP_SERVICE_GROUP.value), + VF_MODULE_MODEL_UUID ("vfModuleModelUUID", ComponentTypeEnum.RESOURCE_GROUP_SERVICE_GROUP.value), + VF_MODULE_MODEL_VERSION ("vfModuleModelVersion", ComponentTypeEnum.RESOURCE_GROUP_SERVICE_GROUP.value), + + VF_MODULE_MODEL_CUSTOMIZATION_UUID ("vfModuleModelCustomizationUUID", ComponentTypeEnum.SERVICE_GROUP.value) + ; + + + + public String value; + public String componentTypes; + + private ToscaMetadataFieldsEnum(String value, String componentTypes) { + this.value = value; + this.componentTypes = componentTypes; + } + + } + + + public enum ComponentTypeEnum { +// RESOURCE_SERVICE_NODE_TEMPLATE_RESOURCE_GROUP("resource, service, nodeTemplate, resourceGroup"), + RESOURCE_SERVICE_NODE_TEMPLATE("resource, service, nodeTemplate"), + RESOURCE_NODE_TEMPLATE("resource, nodeTemplate"), + SERVICE("service"), + NODE_TEMPLATE("nodeTemplate"), + RESOURCE_GROUP_NODE_TEMPLATE("resourceGroup, nodeTemplate"), + SERVICE_GROUP("serviceGroup"), + RESOURCE_GROUP_SERVICE_GROUP("resourceGroup, serviceGroup"), + + ; + + private String value; + + private ComponentTypeEnum(String value) { + this.value = value; + } + + } + + +} diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java index 3bae41fc57..5926798ceb 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/ToscaParserUtils.java @@ -29,12 +29,13 @@ import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Path; import java.util.Map; -import java.util.Set; -import org.openecomp.sdc.ci.tests.datatypes.enums.ToscaKeysEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition; import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupsTopologyTemplateDefinition; +import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaImportsDefinition; +import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaInputsTopologyTemplateDefinition; +import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaMetadataDefinition; import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaNodeTemplatesTopologyTemplateDefinition; import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaParameterConstants; import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaSubstitutionMappingsDefinition; @@ -42,12 +43,10 @@ import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaTopologyTemplateDefinitio import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ImportRestUtils; -import org.openecomp.sdc.ci.tests.utils.validation.CsarValidationUtils; import org.openecomp.sdc.common.rest.api.RestResponseAsByteArray; import org.openecomp.sdc.common.util.ZipUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.yaml.snakeyaml.TypeDescription; import org.yaml.snakeyaml.Yaml; import org.yaml.snakeyaml.constructor.Constructor; import org.yaml.snakeyaml.introspector.PropertyUtils; @@ -158,7 +157,9 @@ public class ToscaParserUtils { toscaStructure.addTypeDescription(ToscaNodeTemplatesTopologyTemplateDefinition.getTypeDescription()); toscaStructure.addTypeDescription(ToscaGroupsTopologyTemplateDefinition.getTypeDescription()); toscaStructure.addTypeDescription(ToscaSubstitutionMappingsDefinition.getTypeDescription()); - + toscaStructure.addTypeDescription(ToscaImportsDefinition.getTypeDescription()); + toscaStructure.addTypeDescription(ToscaMetadataDefinition.getTypeDescription()); + toscaStructure.addTypeDescription(ToscaInputsTopologyTemplateDefinition.getTypeDescription()); // Skip properties which are found in YAML, but not found in POJO PropertyUtils propertyUtils = new PropertyUtils(); propertyUtils.setSkipMissingProperties(true); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java index 17148ce8a9..58ab9f353e 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/AtomicOperationUtils.java @@ -39,6 +39,7 @@ import org.apache.commons.lang3.tuple.Pair; import org.aspectj.apache.bcel.classfile.Code; import org.json.JSONException; import org.openecomp.sdc.be.datatypes.elements.ConsumerDataDefinition; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; import org.openecomp.sdc.be.model.ArtifactDefinition; import org.openecomp.sdc.be.model.Component; @@ -50,6 +51,7 @@ import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.api.Urls; +import org.openecomp.sdc.ci.tests.config.Config; import org.openecomp.sdc.ci.tests.datatypes.ArtifactReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ComponentInstanceReqDetails; import org.openecomp.sdc.ci.tests.datatypes.ImportReqDetails; @@ -67,6 +69,7 @@ import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; +import org.openecomp.sdc.ci.tests.utils.Utils; import org.openecomp.sdc.ci.tests.utils.rest.ArtifactRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ComponentInstanceRestUtils; @@ -134,6 +137,25 @@ public final class AtomicOperationUtils { } } + public static Either<Resource, RestResponse> createResourceByResourceDetails(ResourceReqDetails resourceDetails, UserRoleEnum userRole, Boolean validateState) { + try { + User defaultUser = ElementFactory.getDefaultUser(userRole); + RestResponse resourceResp = ResourceRestUtils.createResource(resourceDetails, defaultUser); + + if (validateState) { + assertTrue(resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED); + } + + if (resourceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) { + Resource resourceResponseObject = ResponseParser.convertResourceResponseToJavaObject(resourceResp.getResponse()); + return Either.left(resourceResponseObject); + } + return Either.right(resourceResp); + } catch (Exception e) { + throw new AtomicOperationException(e); + } + } + public static Either<Resource, RestResponse> createResourcesByTypeNormTypeAndCatregory(ResourceTypeEnum resourceType, NormativeTypesEnum normativeTypes, ResourceCategoryEnum resourceCategory, UserRoleEnum userRole, Boolean validateState) throws Exception { User defaultUser = ElementFactory.getDefaultUser(userRole); @@ -206,6 +228,20 @@ public final class AtomicOperationUtils { return Either.right(createServiceResp); } + public static Either<Service, RestResponse> createCustomService(ServiceReqDetails serviceDetails, UserRoleEnum userRole, Boolean validateState) throws Exception { + User defaultUser = ElementFactory.getDefaultUser(userRole); + RestResponse createServiceResp = ServiceRestUtils.createService(serviceDetails, defaultUser); + + if (validateState) { + assertTrue(createServiceResp.getErrorCode() == ServiceRestUtils.STATUS_CODE_CREATED); + } + + if (createServiceResp.getErrorCode() == ResourceRestUtils.STATUS_CODE_CREATED) { + Service serviceResponseObject = ResponseParser.convertServiceResponseToJavaObject(createServiceResp.getResponse()); + return Either.left(serviceResponseObject); + } + return Either.right(createServiceResp); + } // *********** PRODUCT **************** public static Either<Product, RestResponse> createDefaultProduct(UserRoleEnum userRole, Boolean validateState) throws Exception { @@ -713,16 +749,21 @@ public final class AtomicOperationUtils { } } - public static Either<String, RestResponse> getServiceToscaArtifactPayload(Service service, String artifactType) throws Exception { + public static Either<String, RestResponse> getComponenetArtifactPayload(Component component, String artifactType) throws Exception { - String url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, "localhost", "8080", service.getUniqueId(), service.getToscaArtifacts().get(artifactType).getUniqueId()); - String userId = service.getLastUpdaterUserId(); + String url; + Config config = Utils.getConfig(); + if(component.getComponentType().toString().toUpperCase().equals(ComponentTypeEnum.SERVICE.getValue().toUpperCase())){ + url = String.format(Urls.UI_DOWNLOAD_SERVICE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), component.getUniqueId(), component.getToscaArtifacts().get(artifactType).getUniqueId()); + }else{ + url = String.format(Urls.UI_DOWNLOAD_RESOURCE_ARTIFACT, config.getCatalogBeHost(), config.getCatalogBePort(), component.getUniqueId(), component.getToscaArtifacts().get(artifactType).getUniqueId()); + } + String userId = component.getLastUpdaterUserId(); Map<String, String> headersMap = new HashMap<String, String>(); headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json"); headersMap.put(HttpHeaderEnum.CACHE_CONTROL.getValue(), "no-cache"); headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), basicAuthentication); headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci"); -// headersMap.put("X-ECOMP-InstanceID", "test"); if (userId != null) { headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId); } @@ -735,4 +776,6 @@ public final class AtomicOperationUtils { } + + } diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java index 5c23b5f3fe..ddca429f2c 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/ElementFactory.java @@ -293,7 +293,7 @@ public class ElementFactory { tags.add("serviceTag1"); tags.add(serviceName); String description = "service Description"; - String icon = "myIcon"; + String icon = "defaulticon"; ServiceReqDetails serviceDetails = new ServiceReqDetails(serviceName, category.getValue(), tags, description, contactId, icon); @@ -979,7 +979,7 @@ public class ElementFactory { return requirementDef; } - private static String generateUUIDforSufix() { + public static String generateUUIDforSufix() { String uniqueSufix = UUID.randomUUID().toString(); String[] split = uniqueSufix.split("-"); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java new file mode 100644 index 0000000000..77be6df729 --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/FileHandling.java @@ -0,0 +1,542 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.ci.tests.utils.general; + +import com.aventstack.extentreports.Status; +import com.clearspring.analytics.util.Pair; +import org.apache.commons.io.FileUtils; +import org.openecomp.sdc.be.model.DataTypeDefinition; +import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; +import org.openecomp.sdc.ci.tests.config.Config; + +import org.openecomp.sdc.common.util.GeneralUtility; +import org.yaml.snakeyaml.Yaml; + +import java.io.*; +import java.nio.file.Paths; +import java.util.*; +import java.util.zip.ZipEntry; +import java.util.zip.ZipException; +import java.util.zip.ZipFile; +import java.util.zip.ZipInputStream; + +import static org.testng.AssertJUnit.assertTrue; + +public class FileHandling { + +// ------------------yaml parser methods---------------------------- + public static Map<?, ?> parseYamlFile(String filePath) throws Exception { + Yaml yaml = new Yaml(); + File file = new File(filePath); + InputStream inputStream = new FileInputStream(file); + Map<?, ?> map = (Map<?, ?>) yaml.load(inputStream); + return map; + } + + /** + * The method return map fetched objects by pattern from yaml file + * @param yamlFile + * @param pattern + * @return + * @throws Exception + */ + public static Map<String, Object> parseYamlFileToMapByPattern(File yamlFile, String pattern) throws Exception { + Map<?, ?> yamlFileToMap = FileHandling.parseYamlFile(yamlFile.toString()); + Map<String, Object> objectMap = getObjectMapByPattern(yamlFileToMap, pattern); + return objectMap; + } + + @SuppressWarnings("unchecked") + public static Map<String, Object> getObjectMapByPattern(Map<?, ?> parseUpdetedEnvFile, String pattern) { + Map<String, Object> objectMap = null; + + Object objectUpdetedEnvFile = parseUpdetedEnvFile.get(pattern); + if(objectUpdetedEnvFile instanceof HashMap){ + objectMap = (Map<String, Object>) objectUpdetedEnvFile; + } + return objectMap; + } + + + public static Map<String, DataTypeDefinition> parseDataTypesYaml(String filePath) throws Exception { + @SuppressWarnings("unchecked") + Map<String, DataTypeDefinition> dataTypesMap = (Map<String, DataTypeDefinition>) parseYamlFile(filePath); + return dataTypesMap; + } +// ------------------------------------------------------------------------------------------------- + + public static String getFilePath(String folder) { + String filepath = System.getProperty("filepath"); + if (filepath == null && System.getProperty("os.name").contains("Windows")) { + filepath = FileHandling.getResourcesFilesPath() + folder + File.separator; + } + + else if(filepath.isEmpty() && !System.getProperty("os.name").contains("Windows")){ + filepath = FileHandling.getBasePath() + "Files" + File.separator + folder + File.separator; + } + + System.out.println(filepath); + + return filepath; + } + + public static String getBasePath() { + return System.getProperty("user.dir") + File.separator; + } + + public static String getSdcVnfsPath() { + return getBasePath() + Paths.get("..", "..", "sdc-vnfs").toString(); + } + + public static String getDriversPath() { + return getBasePath() + "src" + File.separator + "main" + File.separator + "resources" + + File.separator + "ci" + File.separator + "drivers" + File.separator; + } + + public static String getResourcesFilesPath() { +// return getBasePath() + "src" + File.separator + "main" + File.separator + "resources" +// + File.separator + "Files" + File.separator; + + return getSdcVnfsPath()+ File.separator + "ui-tests" + File.separator + "Files" + File.separator; + } + + public static String getResourcesEnvFilesPath() { + return getBasePath() + File.separator + "src" + File.separator + "main" + File.separator + "resources" + + File.separator + "Files" + File.separator + "ResourcesEnvFiles" +File.separator; + } + + public static String getCiFilesPath() { + return getBasePath() + "src" + File.separator + "main" + File.separator + "resources" + + File.separator + "ci"; + } + + public static String getConfFilesPath() { + return getCiFilesPath() + File.separator + "conf" + File.separator; + } + + public static String getTestSuitesFilesPath() { + return getCiFilesPath() + File.separator + "testSuites" + File.separator; + } + + public static String getVnfRepositoryPath() { + return getFilePath("VNFs"); + } + + public static File getConfigFile(String configFileName) throws Exception { + File configFile = new File(FileHandling.getBasePath() + File.separator + "conf" + File.separator + configFileName); + if (!configFile.exists()) { + configFile = new File(FileHandling.getConfFilesPath() + configFileName); + } + return configFile; + } + + public static Object[] filterFileNamesFromFolder(String filepath, String extension) { + try { + File dir = new File(filepath); + List<String> filenames = new ArrayList<String>(); + + FilenameFilter extensionFilter = new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.endsWith(extension); + } + }; + + if (dir.isDirectory()) { + for (File file : dir.listFiles(extensionFilter)) { + filenames.add(file.getName()); + } + return filenames.toArray(); + } + + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + public static List<String> filterFileNamesListFromFolder(String filepath, String extension) { + try { + File dir = new File(filepath); + List<String> filenames = new ArrayList<String>(); + + FilenameFilter extensionFilter = new FilenameFilter() { + public boolean accept(File dir, String name) { + return name.endsWith(extension); + } + }; + + if (dir.isDirectory()) { + for (File file : dir.listFiles(extensionFilter)) { + filenames.add(file.getName()); + } + return filenames; + } + + } catch (Exception e) { + e.printStackTrace(); + } + return null; + } + + public static String[] getArtifactsFromZip(String filepath, String zipFilename){ + try{ + ZipFile zipFile = new ZipFile(filepath + File.separator + zipFilename); + Enumeration<? extends ZipEntry> entries = zipFile.entries(); + + String[] artifactNames = new String[zipFile.size() - 1]; + + int i = 0; + while(entries.hasMoreElements()){ + ZipEntry nextElement = entries.nextElement(); + if (!nextElement.isDirectory()){ + if (!nextElement.getName().equals("MANIFEST.json")){ + String name = nextElement.getName(); + artifactNames[i++] = name; + } + } + } + zipFile.close(); + return artifactNames; + } + catch(ZipException zipEx){ + System.err.println("Error in zip file named : " + zipFilename); + zipEx.printStackTrace(); + } catch (IOException e) { + System.err.println("Unhandled exception : "); + e.printStackTrace(); + } + + return null; + + } + +// public static Object[] getZipFileNamesFromFolder(String filepath) { +// return filterFileNamesFromFolder(filepath, ".zip"); +// } + + public static List<String> getZipFileNamesFromFolder(String filepath) { + return filterFileNamesListFromFolder(filepath, ".zip"); + } + + public static int countFilesInZipFile(String[] artifactsArr, String reqExtension){ + int fileCounter = 0; + for (String artifact : artifactsArr){ + String extensionFile = artifact.substring(artifact.lastIndexOf(".") + 1 , artifact.length()); + if (extensionFile.equals(reqExtension)){ + fileCounter++; + } + } + return fileCounter; + } + + + /** + * @return last modified file name from default directory + * @throws Exception + */ +// TODO add download directory capability +// public static synchronized File getLastModifiedFileNameFromDir() throws Exception{ +// return getLastModifiedFileNameFromDir(ComponentBaseTest.getWindowTest().getDownloadDirectory()); +// } + + /** + * @param dirPath + * @return last modified file name from dirPath directory + */ + public static synchronized File getLastModifiedFileNameFromDir(String dirPath){ + File dir = new File(dirPath); + File[] files = dir.listFiles(); + if (files == null) { + assertTrue("File not found under directory " + dirPath, false); + return null; + } + + File lastModifiedFile = files[0]; + for (int i = 1; i < files.length; i++) { + if(files[i].isDirectory()) { + continue; + } + if (lastModifiedFile.lastModified() < files[i].lastModified()) { + lastModifiedFile = files[i]; + } + } + return lastModifiedFile; + } + + public static void deleteDirectory(String directoryPath) { + File dir = new File(directoryPath); + try { + FileUtils.deleteDirectory(dir); + } catch (IOException e) { + System.out.println("Failed to delete " + dir); + ComponentBaseTest.getExtendTest().log(Status.INFO, "Failed to delete " + dir); + } + } + + public static void createDirectory(String directoryPath) { + File directory = new File(String.valueOf(directoryPath)); + if (! directory.exists()){ + directory.mkdir(); + } + } + + + /** + * The method append data to existing file, if file not exists - create it + * @param pathToFile + * @param text + * @param leftSpaceCount + * @throws IOException + */ + public static synchronized void writeToFile(File pathToFile, Object text, Integer leftSpaceCount) throws IOException{ + + BufferedWriter bw = null; + FileWriter fw = null; + if(!pathToFile.exists()){ + createEmptyFile(pathToFile); + } + try { + fw = new FileWriter(pathToFile, true); + bw = new BufferedWriter(fw); + StringBuilder sb = new StringBuilder(); + if(leftSpaceCount > 0 ){ + for(int i = 0; i < leftSpaceCount; i++){ + sb.append(" "); + } + } + bw.write(sb.toString() + text); + bw.newLine(); + bw.close(); + fw.close(); + } catch (Exception e) { + ComponentBaseTest.getExtendTest().log(Status.INFO, "Unable to write to flie " + pathToFile); + } + } + +// public static synchronized void writeToFile(File pathToFile, Map<String, Pair<String, Object>> dataMap, Integer leftSpaceCount) throws IOException{ +// +// BufferedWriter bw = null; +// FileWriter fw = null; +// try { +// if(!pathToFile.exists()){ +// createEmptyFile(pathToFile); +// } +// fw = new FileWriter(pathToFile, true); +// bw = new BufferedWriter(fw); +// StringBuilder sb = new StringBuilder(); +// if(leftSpaceCount > 0 ){ +// for(int i = 0; i < leftSpaceCount; i++){ +// sb.append(" "); +// } +// } +// for(Map.Entry<String, Pair<String, Object>> entry : dataMap.entrySet()){ +// Object record = ArtifactUIUtils.getFormatedData(entry.getKey(), entry.getValue().right); +// bw.write(sb.toString() + record); +// bw.newLine(); +// } +// bw.close(); +// fw.close(); +// } catch (Exception e) { +// ComponentBaseTest.getExtendTest().log(Status.INFO, "Unable to write to flie " + pathToFile); +// } +// } + + public static void deleteLastDowloadedFiles(List<File> files) throws IOException { + for (File file : files) { + File fileToDelete =new File(Config.instance().getWindowsDownloadDirectory()+file.getName()); + fileToDelete.delete(); + } + } +// TODO add work with directory capaability +// public static void cleanCurrentDownloadDir() throws IOException { +// try{ +// ExtentTestActions.log(Status.INFO, "Cleaning directory " + ComponentBaseTest.getWindowTest().getDownloadDirectory()); +// System.gc(); +// FileUtils.cleanDirectory(new File(ComponentBaseTest.getWindowTest().getDownloadDirectory())); +// } +// catch(Exception e){ +// +// } +// } + + public static boolean isFileDownloaded(String downloadPath, String fileName) { + boolean flag = false; + File dir = new File(downloadPath); + File[] dir_contents = dir.listFiles(); + for (int i = 0; i < dir_contents.length; i++) { + if (dir_contents[i].getName().equals(fileName)) + return flag = true; + } + return flag; + } + + public static String getMD5OfFile(File file) throws IOException { + String content = FileUtils.readFileToString(file); + String md5 = GeneralUtility.calculateMD5Base64EncodedByString(content); + return md5; + } + + public static File createEmptyFile(String fileToCreate) { + File file= new File(fileToCreate); + try { + if(file.exists()){ + deleteFile(file); + } + file.createNewFile(); + ComponentBaseTest.getExtendTest().log(Status.INFO, "Create file " + fileToCreate); + } catch (IOException e) { + ComponentBaseTest.getExtendTest().log(Status.INFO, "Failed to create file " + fileToCreate); + e.printStackTrace(); + } + return file; + } + + public static File createEmptyFile(File fileToCreate) { + try { + if(fileToCreate.exists()){ + deleteFile(fileToCreate); + } + fileToCreate.createNewFile(); + ComponentBaseTest.getExtendTest().log(Status.INFO, "Create file " + fileToCreate); + } catch (IOException e) { + ComponentBaseTest.getExtendTest().log(Status.INFO, "Failed to create file " + fileToCreate); + e.printStackTrace(); + } + return fileToCreate; + } + + public static void deleteFile(File file){ + + try{ + if(file.exists()){ + file.deleteOnExit(); + ComponentBaseTest.getExtendTest().log(Status.INFO, "File " + file.getName() + "has been deleted"); + }else{ + ComponentBaseTest.getExtendTest().log(Status.INFO, "Failed to delete file " + file.getName()); + } + }catch(Exception e){ + e.printStackTrace(); + } + + } + + + /** + * get file list from directory by extension array + * @param directory + * @param okFileExtensions + * @return + */ + public static List<File> getHeatAndHeatEnvArtifactsFromZip(File directory, String[] okFileExtensions){ + + List<File> fileList = new ArrayList<>(); + File[] files = directory.listFiles(); + + for (String extension : okFileExtensions){ + for(File file : files){ + if (file.getName().toLowerCase().endsWith(extension)){ + fileList.add(file); + } + } + } + return fileList; + } + + private static final int BUFFER_SIZE = 4096; +// public static void unzip(String zipFilePath, String destDirectory) throws IOException { +// File destDir = new File(destDirectory); +// if (!destDir.exists()) { +// destDir.mkdir(); +// } +// ZipInputStream zipIn = new ZipInputStream(new FileInputStream(zipFilePath)); +// ZipEntry entry = zipIn.getNextEntry(); +//// iterates over entries in the zip file +// while (entry != null) { +// String entryName; +// if(System.getProperty("os.name").contains("Windows")){ +// entryName = entry.getName().replaceAll("/", "\\"+File.separator); +// }else{ +// entryName = entry.getName(); +// } +// String filePath = destDirectory + entryName; +// String currPath = destDirectory; +// String[] dirs = entryName.split("\\"+File.separator); +// String currToken; +// for(int i = 0; i<dirs.length;++i){ +// currToken = dirs[i]; +// if(!entry.isDirectory() && i==dirs.length-1){ +// extractFile(zipIn, filePath); +// } else { +// if(currPath.endsWith(File.separator)){ +// currPath = currPath + currToken; +// }else{ +// currPath = currPath + File.separator + currToken; +// } +//// if the entry is a directory, make the directory +// File dir = new File(currPath); +// dir.mkdir(); +// } +// } +// zipIn.closeEntry(); +// entry = zipIn.getNextEntry(); +// } +// zipIn.close(); +// } + + private static void extractFile(ZipInputStream zipIn, String filePath) throws IOException { + BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(filePath)); + byte[] bytesIn = new byte[BUFFER_SIZE]; + int read = 0; + while ((read = zipIn.read(bytesIn)) != -1) { + bos.write(bytesIn, 0, read); + } + bos.close(); + } + +// public static int getFileCountFromDefaulDownloadDirectory(){ +// return new File(ComponentBaseTest.getWindowTest().getDownloadDirectory()).listFiles().length; +// } + + + public static String getKeyByValueFromPropertyFormatFile(String fullPath, String key) { + Properties prop = new Properties(); + InputStream input = null; + String value = null; + try { + input = new FileInputStream(fullPath); + prop.load(input); + value = (prop.getProperty(key)); + + } catch (IOException ex) { + ex.printStackTrace(); + } finally { + if (input != null) { + try { + input.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + + return value.replaceAll("\"",""); + } +} diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtillViaApis.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtillViaApis.java new file mode 100644 index 0000000000..12f04e282c --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtillViaApis.java @@ -0,0 +1,293 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.ci.tests.utils.general; + +import com.aventstack.extentreports.Status; +import com.clearspring.analytics.util.Pair; +import com.google.gson.Gson; +import fj.data.Either; + +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.ci.tests.api.ExtentTestActions; +import org.openecomp.sdc.ci.tests.api.Urls; +import org.openecomp.sdc.ci.tests.config.Config; +import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers; +import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; +import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; + +import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject; +import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; +import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; +import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; +import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; +import org.openecomp.sdc.ci.tests.utils.Utils; +import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; + +import java.io.*; +import java.nio.charset.StandardCharsets; +import java.util.*; +import org.apache.commons.codec.binary.Base64; + + + +import static org.testng.AssertJUnit.assertTrue; + +public class OnboardingUtillViaApis { + + protected static Map<String, String> prepareHeadersMap(String userId) { + Map<String, String> headersMap = new HashMap<String, String>(); + headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json"); + headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json"); + headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId); + return headersMap; + } + + public static Pair<String, VendorSoftwareProductObject> createVspViaApis(String filepath, String vnfFile, User user) throws Exception { + + VendorSoftwareProductObject vendorSoftwareProductObject = new VendorSoftwareProductObject(); + ExtentTestActions.log(Status.INFO, String.format("Create Vendor License")); + AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUtils.createVendorLicense(user); + ExtentTestActions.log(Status.INFO, String.format("Create Vendor Software Product")); + Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(vnfFile, filepath, user, amdocsLicenseMembers); + Map<String, String> map = createVendorSoftwareProduct.right; + vendorSoftwareProductObject.setAttContact(map.get("attContact")); + vendorSoftwareProductObject.setCategory(map.get("category")); + vendorSoftwareProductObject.setComponentId(map.get("componentId")); + vendorSoftwareProductObject.setDescription(map.get("description")); + vendorSoftwareProductObject.setSubCategory(map.get("subCategory")); + vendorSoftwareProductObject.setVendorName(map.get("vendorName")); + vendorSoftwareProductObject.setVspId(map.get("vspId")); + Pair<String, VendorSoftwareProductObject> pair = new Pair<String, VendorSoftwareProductObject>(createVendorSoftwareProduct.left, vendorSoftwareProductObject); + return pair; + } + +/* public static Resource createResourceFromVSP(Pair<String, Map<String, String>> createVendorSoftwareProduct, String vspName) throws Exception { + List<String> tags = new ArrayList<>(); + tags.add(vspName); + Map<String, String> map = createVendorSoftwareProduct.right; + ResourceReqDetails resourceDetails = new ResourceReqDetails(); + resourceDetails.setCsarUUID(map.get("vspId")); + resourceDetails.setCsarVersion("1.0"); + resourceDetails.setName(vspName); + resourceDetails.setTags(tags); + resourceDetails.setDescription(map.get("description")); + resourceDetails.setResourceType(map.get("componentType")); + resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory()); + resourceDetails.setVendorName(map.get("vendorName")); + resourceDetails.setVendorRelease("1.0"); + resourceDetails.setResourceType("VF"); + resourceDetails.setResourceVendorModelNumber("666"); + resourceDetails.setContactId(map.get("attContact")); + resourceDetails.setIcon("defaulticon"); + Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value(); + + return resource; + }*/ + public static Resource createResourceFromVSP(ResourceReqDetails resourceDetails, String vspName) throws Exception { +// List<String> tags = new ArrayList<>(); +// tags.add(vspName); +// Map<String, String> map = createVendorSoftwareProduct.right; +// ResourceReqDetails resourceDetails = new ResourceReqDetails(); +// resourceDetails.setCsarUUID(map.get("vspId")); +// resourceDetails.setCsarVersion("1.0"); +// resourceDetails.setName(vspName); +// resourceDetails.setTags(tags); +// resourceDetails.setDescription(map.get("description")); +// resourceDetails.setResourceType(map.get("componentType")); +// resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory()); +// resourceDetails.setVendorName(map.get("vendorName")); +// resourceDetails.setVendorRelease("1.0"); +// resourceDetails.setResourceType("VF"); +// resourceDetails.setResourceVendorModelNumber("666"); +// resourceDetails.setContactId(map.get("attContact")); +// resourceDetails.setIcon("defaulticon"); + Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value(); + + return resource; + } + public static void downloadToscaCsarToDirectory(Component component, File file) { + try { + Either<String, RestResponse> componentToscaArtifactPayload = AtomicOperationUtils.getComponenetArtifactPayload(component, "assettoscacsar"); + if(componentToscaArtifactPayload.left().value() != null){ + convertPayloadToFile(componentToscaArtifactPayload.left().value(), file); + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +// public static void convertPayloadToFile(String payload, File file, boolean isBased64, boolean isSdcFormat) throws IOException{ +// +// Gson gson = new Gson(); +// byte[] byteArray = null; +// Map<String, String> fromJson; +// @SuppressWarnings("unchecked") +// String string = null;// = fromJson.get("base64Contents").toString(); +// if(isSdcFormat){ +// fromJson = gson.fromJson(payload, Map.class); +// string = fromJson.get("base64Contents").toString(); +// }else if (isBased64) { +// byteArray = Base64.decode(string.getBytes(StandardCharsets.UTF_8)); +// }else{ +// byteArray = payload.getBytes(StandardCharsets.UTF_8); +// } +// File downloadedFile = new File(file.getAbsolutePath()); +// FileOutputStream fos = new FileOutputStream(downloadedFile); +// fos.write(byteArray); +// fos.flush(); +// fos.close(); +// +// } + + public static void convertPayloadToFile(String payload, File file) throws IOException{ + + Gson gson = new Gson(); + @SuppressWarnings("unchecked") + Map<String, String> fromJson = gson.fromJson(payload, Map.class); + String string = fromJson.get("base64Contents").toString(); + byte[] byteArray = Base64.decodeBase64(string.getBytes(StandardCharsets.UTF_8)); + File downloadedFile = new File(file.getAbsolutePath()); + FileOutputStream fos = new FileOutputStream(downloadedFile); + fos.write(byteArray); + fos.flush(); + fos.close(); + } + + + public static void convertPayloadToZipFile(String payload, File file) throws IOException{ + + byte[] byteArray = payload.getBytes(StandardCharsets.ISO_8859_1); + File downloadedFile = new File(file.getAbsolutePath()); + FileOutputStream fos = new FileOutputStream(downloadedFile); + fos.write(byteArray); + fos.flush(); + fos.close(); + + +// ZipOutputStream fos = null; +// +// +// for (Charset charset : Charset.availableCharsets().values()) { +// try{ +// // System.out.println("How to do it???"); +// File downloadedFile = new File(file.getAbsolutePath() + "_" + charset +".csar"); +// fos = new ZipOutputStream(new FileOutputStream(downloadedFile)); +// byte[] byteArray = payload.getBytes(charset); +// fos.write(byteArray); +// fos.flush(); +// +// } +// catch(Exception e){ +// fos.close(); +// } +// } + System.out.println(""); + +// ZipInputStream zipStream = new ZipInputStream(new ByteArrayInputStream(byteArray)); +// ZipEntry entry = null; +// while ((entry = zipStream.getNextEntry()) != null) { +// +// String entryName = entry.getName(); +// +// FileOutputStream out = new FileOutputStream(file+"/"+entryName); +// +// byte[] byteBuff = new byte[4096]; +// int bytesRead = 0; +// while ((bytesRead = zipStream.read(byteBuff)) != -1) +// { +// out.write(byteBuff, 0, bytesRead); +// } +// +// out.close(); +// zipStream.closeEntry(); +// } +// zipStream.close(); +// + + + + BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(payload.getBytes(StandardCharsets.ISO_8859_1))); + String filePath = file.toString(); + BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(filePath))); + int inByte; + while((inByte = bis.read()) != -1) bos.write(inByte); + bis.close(); + bos.close(); + } + + public static Either<String, RestResponse> getVendorSoftwareProduct(String vspId, User user, Boolean validateState) throws Exception { + + Config config = Utils.getConfig(); + String url = String.format(Urls.GET_VENDOR_SOFTWARE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(), vspId); + String userId = user.getUserId(); + Map<String, String> headersMap = prepareHeadersMap(userId); + headersMap.put(HttpHeaderEnum.X_ECOMP_REQUEST_ID_HEADER.getValue(), "123456"); + headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "*/*"); + headersMap.put("Accept-Encoding", "gzip, deflate, br"); + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendGet(url, headersMap); + if (validateState) { + assertTrue("add property to resource failed: " + response.getResponseMessage(), response.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS); + } + if (response.getErrorCode() != BaseRestUtils.STATUS_CODE_SUCCESS && response.getResponse().getBytes() == null && response.getResponse().getBytes().length == 0) { + return Either.right(response); + } + return Either.left(response.getResponse()); + + } + + public static ResourceReqDetails prepareOnboardedResourceDetailsBeforeCreate(VendorSoftwareProductObject vendorSoftwareProductObject, String vspName) { + + List<String> tags = new ArrayList<>(); + tags.add(vspName); + ResourceReqDetails resourceDetails = new ResourceReqDetails(); + resourceDetails.setCsarUUID(vendorSoftwareProductObject.getVspId()); + resourceDetails.setCsarVersion("1.0"); + resourceDetails.setName(vspName); + resourceDetails.setTags(tags); + resourceDetails.setDescription(vendorSoftwareProductObject.getDescription()); + resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory()); + resourceDetails.setVendorName(vendorSoftwareProductObject.getVendorName()); + resourceDetails.setVendorRelease("1.0"); + resourceDetails.setResourceType("VF"); + resourceDetails.setResourceVendorModelNumber("666"); + resourceDetails.setContactId(vendorSoftwareProductObject.getAttContact()); + resourceDetails.setIcon("defaulticon"); + + return resourceDetails; + } + + public static ServiceReqDetails prepareServiceDetailsBeforeCreate(User user) { + + ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(ServiceCategoriesEnum.NETWORK_L4, user); + serviceDetails.setServiceType("MyServiceType"); + serviceDetails.setServiceRole("MyServiceRole"); + serviceDetails.setNamingPolicy("MyServiceNamingPolicy"); + serviceDetails.setEcompGeneratedNaming(false); + + return serviceDetails; + } +} diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtils.java new file mode 100644 index 0000000000..a1838b66d1 --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/OnboardingUtils.java @@ -0,0 +1,799 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.ci.tests.utils.general; + +import com.aventstack.extentreports.Status; +import com.clearspring.analytics.util.Pair; +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpEntity; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.FileBody; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.json.JSONException; +import org.json.JSONObject; +import org.json.simple.JSONArray; +import org.json.simple.JSONValue; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.ci.tests.api.ComponentBaseTest; +import org.openecomp.sdc.ci.tests.api.ExtentTestActions; +import org.openecomp.sdc.ci.tests.config.Config; + +import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers; +import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition; + +import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; +import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; +import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; +import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar; + +import org.openecomp.sdc.ci.tests.utils.Utils; +import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; + +import org.testng.Assert; + +import java.io.*; +import java.nio.file.FileSystems; +import java.util.*; +import java.util.stream.Collectors; + +import static org.testng.AssertJUnit.assertEquals; + +public class OnboardingUtils { + + protected static List<String> exludeVnfList = Arrays.asList("2016-197_vscp_vscp-fw_1610_e2e.zip", "2016-281_vProbes_BE_11_1_f_30_1610_e2e.zip", + "2016-282_vProbes_FE_11_1_f_30_1610_e2e.zip", "2016-044_vfw_fnat_30_1607_e2e.zip", "2017-376_vMOG_11_1.zip", "vMOG.zip", + + + "vMRF_USP_AIC3.0_1702.zip", "2016-211_vprobesbe_vprobes_be_30_1610_e2e.zip", "2016-005_vprobesfe_vprobes_fe_30_1607_e2e.zip", + "vMRF_RTT.zip", "2016-006_vvm_vvm_30_1607_e2e.zip", "2016-001_vvm_vvm_30_1607_e2e.zip"); + + protected static List<String> exludeVnfListForToscaParser = Arrays.asList("2016-043_vsaegw_fdnt_30_1607_e2e.zip", "vIRC_CC.zip", + "2016-045_vlb_lmsp_30_1607_e2e.zip", "2016-050_vdns_vmdns_30_1607_e2e.zip", + "2016-247_mns_mns_30_1610_e2e.zip", "2016-044_vfw_fcgi_30_1607_e2e.zip"); + + public OnboardingUtils() { + } + + public static Pair<String, Map<String, String>> createVendorSoftwareProduct(String HeatFileName, String filepath, User user, AmdocsLicenseMembers amdocsLicenseMembers) + throws Exception { + Pair<String, Map<String, String>> pair = createVSP(HeatFileName, filepath, user, amdocsLicenseMembers); + + String vspid = pair.right.get("vspId"); + + prepareVspForUse(user, vspid); + + return pair; + } + + public static void prepareVspForUse(User user, String vspid) throws Exception { + RestResponse checkin = checkinVendorSoftwareProduct(vspid, user); + assertEquals("did not succeed to checking new VSP", 200, checkin.getErrorCode().intValue()); + + RestResponse submit = submitVendorSoftwareProduct(vspid, user); + assertEquals("did not succeed to submit new VSP", 200, submit.getErrorCode().intValue()); + + RestResponse createPackage = createPackageOfVendorSoftwareProduct(vspid, user); + assertEquals("did not succeed to create package of new VSP ", 200, createPackage.getErrorCode().intValue()); + + ComponentBaseTest.getExtendTest().log(Status.INFO, "Succeeded in creating the vendor software product"); + } + + public static Pair<String, Map<String, String>> createVSP(String HeatFileName, String filepath, User user, AmdocsLicenseMembers amdocsLicenseMembers) throws Exception { + String vspName = handleFilename(HeatFileName); + + ComponentBaseTest.getExtendTest().log(Status.INFO, "Starting to create the vendor software product"); + + Pair<RestResponse, Map<String, String>> createNewVspPair = createNewVendorSoftwareProduct(vspName, amdocsLicenseMembers, user); + RestResponse createNewVendorSoftwareProduct = createNewVspPair.left; + assertEquals("did not succeed to create new VSP", 200,createNewVendorSoftwareProduct.getErrorCode().intValue()); + String vspid = ResponseParser.getValueFromJsonResponse(createNewVendorSoftwareProduct.getResponse(), "vspId"); + String componentId = ResponseParser.getValueFromJsonResponse(createNewVendorSoftwareProduct.getResponse(), "componentId"); + + Map<String, String> vspMeta = createNewVspPair.right; + Map<String, String> vspObject = new HashMap<String, String>(); + Iterator<String> iterator = vspMeta.keySet().iterator(); + while(iterator.hasNext()){ + Object key = iterator.next(); + Object value = vspMeta.get(key); + vspObject.put(key.toString(), value.toString()); + } + vspObject.put("vspId", vspid); + vspObject.put("componentId", componentId); + vspObject.put("vendorName", amdocsLicenseMembers.getVendorLicenseName()); + vspObject.put("attContact", user.getUserId()); + + RestResponse uploadHeatPackage = uploadHeatPackage(filepath, HeatFileName, vspid, user); + assertEquals("did not succeed to upload HEAT package", 200, uploadHeatPackage.getErrorCode().intValue()); + + RestResponse validateUpload = validateUpload(vspid, user); + assertEquals("did not succeed to validate upload process", 200, validateUpload.getErrorCode().intValue()); + + Pair<String, Map<String, String>> pair = new Pair<String, Map<String, String>>(vspName, vspObject); + + return pair; + } + + public static void updateVspWithVfcArtifacts(String filepath, String vspId, String updatedSnmpPoll, String updatedSnmpTrap, String componentId, User user) throws Exception{ + RestResponse checkout = checkoutVendorSoftwareProduct(vspId, user); + assertEquals("did not succeed to checkout new VSP", 200, checkout.getErrorCode().intValue()); + ExtentTestActions.log(Status.INFO, "Deleting SNMP POLL"); + deleteSnmpArtifact(componentId, vspId, user, SnmpTypeEnum.SNMP_POLL); + ExtentTestActions.log(Status.INFO, "Deleting SNMP TRAP"); + deleteSnmpArtifact(componentId, vspId, user, SnmpTypeEnum.SNMP_TRAP); + addVFCArtifacts(filepath, updatedSnmpPoll, updatedSnmpTrap, vspId, user, componentId); + prepareVspForUse(user, vspId); + } + + public static String updateVendorSoftwareProduct(String vspId, String HeatFileName, String filepath, User user) + throws Exception, Throwable { + String vspName = handleFilename(HeatFileName); + ComponentBaseTest.getExtendTest().log(Status.INFO, "Starting to update the vendor software product"); + + RestResponse checkout = checkoutVendorSoftwareProduct(vspId, user); + assertEquals("did not succeed to checkout new VSP", 200, checkout.getErrorCode().intValue()); + + RestResponse uploadHeatPackage = uploadHeatPackage(filepath, HeatFileName, vspId, user); + assertEquals("did not succeed to upload HEAT package", 200, uploadHeatPackage.getErrorCode().intValue()); + + RestResponse validateUpload = validateUpload(vspId, user); + assertEquals("did not succeed to validate upload process", 200, validateUpload.getErrorCode().intValue()); + + RestResponse checkin = checkinVendorSoftwareProduct(vspId, user); + assertEquals("did not succeed to checking VSP", 200, checkin.getErrorCode().intValue()); + + + RestResponse submit = submitVendorSoftwareProduct(vspId, user); + assertEquals("did not succeed to submit VSP", 200, submit.getErrorCode().intValue()); + + RestResponse createPackage = createPackageOfVendorSoftwareProduct(vspId, user); + assertEquals("did not succeed to update package of VSP ", 200, createPackage.getErrorCode().intValue()); + + ComponentBaseTest.getExtendTest().log(Status.INFO, "Succeeded in updating the vendor software product"); + + return vspName; + } + + public static String handleFilename(String heatFileName) { + final String namePrefix = "ciVFOnboarded-"; + final String nameSuffix = "-" + getShortUUID(); + + String subHeatFileName = heatFileName.substring(0, heatFileName.lastIndexOf(".")); + + if ((namePrefix + subHeatFileName + nameSuffix).length() >= 50) { + subHeatFileName = subHeatFileName.substring(0, 50 - namePrefix.length() - nameSuffix.length()); + } + + if (subHeatFileName.contains("(") || subHeatFileName.contains(")")) { + subHeatFileName = subHeatFileName.replace("(", "-"); + subHeatFileName = subHeatFileName.replace(")", "-"); + } + + String vnfName = namePrefix + subHeatFileName + nameSuffix; + return vnfName; + } + + public static String addVFCArtifacts(String filepath, String snmpPoll, String snmpTrap, String vspid, User user, String vspComponentId) throws Exception{ + vspComponentId = (vspComponentId == null) ? getVSPComponentId(vspid, user) : vspComponentId; + if (vspComponentId != null){ + if (snmpPoll != null){ + ExtentTestActions.log(Status.INFO, "Adding VFC artifact of type SNMP POLL with the file " + snmpPoll); + RestResponse uploadSnmpPollArtifact = uploadSnmpPollArtifact(filepath, snmpPoll, vspid, user, vspComponentId); + assertEquals("Did not succeed to add SNMP POLL", 200, uploadSnmpPollArtifact.getErrorCode().intValue()); + } + if (snmpTrap != null){ + ExtentTestActions.log(Status.INFO, "Adding VFC artifact of type SNMP TRAP with the file " + snmpTrap); + RestResponse uploadSnmpTrapArtifact = uploadSnmpTrapArtifact(filepath, snmpTrap, vspid, user, vspComponentId); + assertEquals("Did not succeed to add SNMP TRAP", 200, uploadSnmpTrapArtifact.getErrorCode().intValue()); + } + } + + return vspComponentId; + } + + public static String addVFCArtifacts(String filepath, String snmpPoll, String snmpTrap, String vspid, User user) throws Exception{ + return addVFCArtifacts(filepath, snmpPoll, snmpTrap, vspid, user, null); + } + + private static RestResponse uploadSnmpPollArtifact(String filepath, String zipArtifact, String vspid, User user, + String vspComponentId) throws FileNotFoundException, IOException, ClientProtocolException { + Config config = Utils.getConfig(); + String snmpPollUrl = String.format("http://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/0.1/components/%s/monitors/snmp/upload", + config.getCatalogBeHost(),config.getCatalogBePort(), vspid, vspComponentId); + return uploadFile(filepath, zipArtifact, snmpPollUrl, user); + } + + private static RestResponse uploadSnmpTrapArtifact(String filepath, String zipArtifact, String vspid, User user, + String vspComponentId) throws FileNotFoundException, IOException, ClientProtocolException { + Config config = Utils.getConfig(); + String snmpTrapUrl = String.format("http://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/0.1/components/%s/monitors/snmp-trap/upload", + config.getCatalogBeHost(),config.getCatalogBePort(), vspid, vspComponentId); + return uploadFile(filepath, zipArtifact, snmpTrapUrl, user); + } + + private static RestResponse deleteSnmpArtifact(String componentId, String vspId, User user, SnmpTypeEnum snmpType) throws Exception + { + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/0.1/components/%s/monitors/%s", + config.getCatalogBeHost(),config.getCatalogBePort(), vspId, componentId, snmpType.getValue()); + String userId = user.getUserId(); + + Map<String, String> headersMap = prepareHeadersMap(userId); + + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendDelete(url, headersMap); + return response; + } + + + + private static String getVSPComponentId(String vspid, User user) throws Exception, JSONException { + RestResponse components = getVSPComponents(vspid, user); + String response = components.getResponse(); + Map<String, Object> responseMap = (Map<String, Object>) JSONValue.parse(response); + JSONArray results = (JSONArray)responseMap.get("results"); + for (Object res : results){ + Map<String, Object> compMap= (Map<String, Object>) JSONValue.parse(res.toString()); + String componentId = compMap.get("id").toString(); + return componentId; + } + return null; + } + + private static RestResponse getVSPComponents(String vspid, User user) throws Exception{ + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/0.1/components", config.getCatalogBeHost(),config.getCatalogBePort(), vspid); + String userId = user.getUserId(); + + Map<String, String> headersMap = prepareHeadersMap(userId); + + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendGet(url, headersMap); + return response; + } + + public static AmdocsLicenseMembers createVendorLicense(User user) throws Exception { + + AmdocsLicenseMembers amdocsLicenseMembers; + ComponentBaseTest.getExtendTest().log(Status.INFO, "Starting to create the vendor license"); + String vendorLicenseName = "ciLicense" + getShortUUID(); + RestResponse vendorLicenseResponse = createVendorLicenseModels_1(vendorLicenseName, user); + assertEquals("did not succeed to create vendor license model", 200, vendorLicenseResponse.getErrorCode().intValue()); + String vendorId = ResponseParser.getValueFromJsonResponse(vendorLicenseResponse.getResponse(), "value"); + + RestResponse vendorKeyGroupsResponse = createVendorKeyGroups_2(vendorId, user); + assertEquals("did not succeed to create vendor key groups", 200, vendorKeyGroupsResponse.getErrorCode().intValue()); + String keyGroupId = ResponseParser.getValueFromJsonResponse(vendorKeyGroupsResponse.getResponse(), "value"); + + RestResponse vendorEntitlementPool = createVendorEntitlementPool_3(vendorId, user); + assertEquals("did not succeed to create vendor entitlement pool", 200, vendorEntitlementPool.getErrorCode().intValue()); + String entitlementPoolId = ResponseParser.getValueFromJsonResponse(vendorEntitlementPool.getResponse(), "value"); + + RestResponse vendorLicenseFeatureGroups = createVendorLicenseFeatureGroups_4(vendorId, keyGroupId, entitlementPoolId, user); + assertEquals("did not succeed to create vendor license feature groups", 200, vendorLicenseFeatureGroups.getErrorCode().intValue()); + String featureGroupId = ResponseParser.getValueFromJsonResponse(vendorLicenseFeatureGroups.getResponse(), "value"); + + RestResponse vendorLicenseAgreement = createVendorLicenseAgreement_5(vendorId, featureGroupId, user); + assertEquals("did not succeed to create vendor license agreement", 200, vendorLicenseAgreement.getErrorCode().intValue()); + String vendorLicenseAgreementId = ResponseParser.getValueFromJsonResponse(vendorLicenseAgreement.getResponse(), "value"); + + RestResponse checkinVendorLicense = checkinVendorLicense(vendorId, user); + assertEquals("did not succeed to checkin vendor license", 200, checkinVendorLicense.getErrorCode().intValue()); + + RestResponse submitVendorLicense = submitVendorLicense(vendorId, user); + assertEquals("did not succeed to submit vendor license", 200, submitVendorLicense.getErrorCode().intValue()); + + ComponentBaseTest.getExtendTest().log(Status.INFO, "Succeeded in creating the vendor license"); + + amdocsLicenseMembers = new AmdocsLicenseMembers(vendorId, vendorLicenseName, vendorLicenseAgreementId, featureGroupId); + + return amdocsLicenseMembers; + } + + private static String getShortUUID() { + return UUID.randomUUID().toString().split("-")[0]; + } + + private static RestResponse actionOnComponent(String vspid, String action, String onboardComponent, User user) + throws Exception { + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/" + onboardComponent + "/%s/versions/0.1/actions", + config.getCatalogBeHost(), config.getCatalogBePort(), vspid); + String userId = user.getUserId(); + + JSONObject jObject = new JSONObject(); + jObject.put("action", action); + + Map<String, String> headersMap = prepareHeadersMap(userId); + + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendPut(url, jObject.toString(), headersMap); + return response; + } + + public static RestResponse checkinVendorLicense(String vspid, User user) throws Exception { + return actionOnComponent(vspid, "Checkin", "vendor-license-models", user); + } + + public static RestResponse submitVendorLicense(String vspid, User user) throws Exception { + return actionOnComponent(vspid, "Submit", "vendor-license-models", user); + } + + public static RestResponse createVendorLicenseModels_1(String name, User user) throws Exception { + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-license-models", config.getCatalogBeHost(), + config.getCatalogBePort()); + String userId = user.getUserId(); + + JSONObject jObject = new JSONObject(); + jObject.put("vendorName", name); + jObject.put("description", "new vendor license model"); + jObject.put("iconRef", "icon"); + + Map<String, String> headersMap = prepareHeadersMap(userId); + + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendPost(url, jObject.toString(), headersMap); + return response; + + } + + public static RestResponse createVendorLicenseAgreement_5(String vspid, String featureGroupId, User user) + throws Exception { + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-license-models/%s/versions/0.1/license-agreements", + config.getCatalogBeHost(), config.getCatalogBePort(), vspid); + String userId = user.getUserId(); + + JSONObject licenseTermpObject = new JSONObject(); + licenseTermpObject.put("choice", "Fixed_Term"); + licenseTermpObject.put("other", ""); + + JSONObject jObjectBody = new JSONObject(); + jObjectBody.put("name", "abc"); + jObjectBody.put("description", "new vendor license agreement"); + jObjectBody.put("requirementsAndConstrains", "abc"); + jObjectBody.put("licenseTerm", licenseTermpObject); + jObjectBody.put("addedFeatureGroupsIds", Arrays.asList(featureGroupId).toArray()); + + Map<String, String> headersMap = prepareHeadersMap(userId); + + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendPost(url, jObjectBody.toString(), headersMap); + return response; + } + + public static RestResponse createVendorLicenseFeatureGroups_4(String vspid, String licenseKeyGroupId, + String entitlementPoolId, User user) throws Exception { + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-license-models/%s/versions/0.1/feature-groups", + config.getCatalogBeHost(), config.getCatalogBePort(), vspid); + String userId = user.getUserId(); + + JSONObject jObject = new JSONObject(); + jObject.put("name", "xyz"); + jObject.put("description", "new vendor license feature groups"); + jObject.put("partNumber", "123abc456"); + jObject.put("manufacturerReferenceNumber", "5"); + jObject.put("addedLicenseKeyGroupsIds", Arrays.asList(licenseKeyGroupId).toArray()); + jObject.put("addedEntitlementPoolsIds", Arrays.asList(entitlementPoolId).toArray()); + + Map<String, String> headersMap = prepareHeadersMap(userId); + + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendPost(url, jObject.toString(), headersMap); + return response; + + } + + public static RestResponse createVendorEntitlementPool_3(String vspid, User user) throws Exception { + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-license-models/%s/versions/0.1/entitlement-pools", + config.getCatalogBeHost(), config.getCatalogBePort(), vspid); + String userId = user.getUserId(); + + JSONObject jEntitlementMetricObject = new JSONObject(); + jEntitlementMetricObject.put("choice", "CPU"); + jEntitlementMetricObject.put("other", ""); + + JSONObject jAggregationFunctionObject = new JSONObject(); + jAggregationFunctionObject.put("choice", "Peak"); + jAggregationFunctionObject.put("other", ""); + + JSONObject jOperationalScope = new JSONObject(); + jOperationalScope.put("choices", Arrays.asList("Availability_Zone").toArray()); + jOperationalScope.put("other", ""); + + JSONObject jTimeObject = new JSONObject(); + jTimeObject.put("choice", "Hour"); + jTimeObject.put("other", ""); + + JSONObject jObjectBody = new JSONObject(); + jObjectBody.put("name", "def"+ getShortUUID()); + jObjectBody.put("description", "new vendor license entitlement pool"); + jObjectBody.put("thresholdValue", "23"); + jObjectBody.put("thresholdUnits", "Absolute"); + jObjectBody.put("entitlementMetric", jEntitlementMetricObject); + jObjectBody.put("increments", "abcd"); + jObjectBody.put("aggregationFunction", jAggregationFunctionObject); + jObjectBody.put("operationalScope", jOperationalScope); + jObjectBody.put("time", jTimeObject); + jObjectBody.put("manufacturerReferenceNumber", "123aaa"); + + Map<String, String> headersMap = prepareHeadersMap(userId); + + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendPost(url, jObjectBody.toString(), headersMap); + return response; + } + + public static RestResponse createVendorKeyGroups_2(String vspid, User user) throws Exception { + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-license-models/%s/versions/0.1/license-key-groups", + config.getCatalogBeHost(), config.getCatalogBePort(), vspid); + String userId = user.getUserId(); + + JSONObject jOperationalScope = new JSONObject(); + jOperationalScope.put("choices", Arrays.asList("Tenant").toArray()); + jOperationalScope.put("other", ""); + + JSONObject jObjectBody = new JSONObject(); + jObjectBody.put("name", "keyGroup" + getShortUUID()); + jObjectBody.put("description", "new vendor license key group"); + jObjectBody.put("operationalScope", jOperationalScope); + jObjectBody.put("type", "Universal"); + + Map<String, String> headersMap = prepareHeadersMap(userId); + + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendPost(url, jObjectBody.toString(), headersMap); + return response; + } + + public static Pair<RestResponse, Map<String, String>> createNewVendorSoftwareProduct(String name, AmdocsLicenseMembers amdocsLicenseMembers, User user) throws Exception { + Map<String, String> vspMetadta = new HashMap<String, String>(); + + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-software-products", + config.getCatalogBeHost(), config.getCatalogBePort()); + + String userId = user.getUserId(); + + JSONObject jlicensingDataObj = new JSONObject(); + jlicensingDataObj.put("licenseAgreement", amdocsLicenseMembers.getVendorLicenseAgreementId()); + jlicensingDataObj.put("featureGroups", Arrays.asList(amdocsLicenseMembers.getFeatureGroupId()).toArray()); + + JSONObject jlicensingVersionObj = new JSONObject(); + jlicensingVersionObj.put("id", "1.0"); + jlicensingVersionObj.put("label", "1.0"); + + JSONObject jObject = new JSONObject(); + jObject.put("name", name); + jObject.put("description", "new VSP description"); + jObject.put("category", "resourceNewCategory.generic"); + jObject.put("subCategory", "resourceNewCategory.generic.database"); + jObject.put("onboardingMethod", "HEAT"); + jObject.put("licensingVersion", jlicensingVersionObj); + jObject.put("vendorName", amdocsLicenseMembers.getVendorLicenseName()); + jObject.put("vendorId", amdocsLicenseMembers.getVendorId()); + jObject.put("icon", "icon"); + jObject.put("licensingData", jlicensingDataObj); + + vspMetadta.put("description", jObject.getString("description")); + vspMetadta.put("category", jObject.getString("category")); + vspMetadta.put("subCategory", jObject.getString("subCategory").split("\\.")[2]); + + Map<String, String> headersMap = prepareHeadersMap(userId); + HttpRequest http = new HttpRequest(); + + RestResponse response = http.httpSendPost(url, jObject.toString(), headersMap); + return new Pair<RestResponse, Map<String, String>>(response, vspMetadta); + } + + public static RestResponse validateUpload(String vspid, User user) throws Exception { + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/0.1/orchestration-template-candidate/process", + config.getCatalogBeHost(), config.getCatalogBePort(), vspid); + + String userId = user.getUserId(); + + Map<String, String> headersMap = prepareHeadersMap(userId); + HttpRequest http = new HttpRequest(); + + String body =null; + + RestResponse response = http.httpSendPut(url, body, headersMap); + + return response; + } + + public static RestResponse uploadHeatPackage(String filepath, String filename, String vspid, User user) throws Exception { + Config config = Utils.getConfig(); + String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/0.1/orchestration-template-candidate", config.getCatalogBeHost(), config.getCatalogBePort(), vspid); + return uploadFile(filepath, filename, url, user); + } + + private static RestResponse uploadFile(String filepath, String filename, String url, User user) + throws FileNotFoundException, IOException, ClientProtocolException { + CloseableHttpResponse response = null; + + MultipartEntityBuilder mpBuilder = MultipartEntityBuilder.create(); + mpBuilder.addPart("upload", new FileBody(getTestZipFile(filepath, filename))); + + Map<String, String> headersMap = prepareHeadersMap(user.getUserId()); + headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "multipart/form-data"); + + CloseableHttpClient client = HttpClients.createDefault(); + try { + HttpPost httpPost = new HttpPost(url); + RestResponse restResponse = new RestResponse(); + + Iterator<String> iterator = headersMap.keySet().iterator(); + while (iterator.hasNext()) { + String key = iterator.next(); + String value = headersMap.get(key); + httpPost.addHeader(key, value); + } + httpPost.setEntity(mpBuilder.build()); + response = client.execute(httpPost); + HttpEntity entity = response.getEntity(); + String responseBody = null; + if (entity != null) { + InputStream instream = entity.getContent(); + StringWriter writer = new StringWriter(); + IOUtils.copy(instream, writer); + responseBody = writer.toString(); + try { + + } finally { + instream.close(); + } + } + + restResponse.setErrorCode(response.getStatusLine().getStatusCode()); + restResponse.setResponse(responseBody); + + return restResponse; + + } finally { + closeResponse(response); + closeHttpClient(client); + + } + } + + private static void closeResponse(CloseableHttpResponse response) { + try { + if (response != null) { + response.close(); + } + } catch (IOException e) { + System.out.println(String.format("failed to close client or response: %s", e.getMessage())); + } + } + + private static void closeHttpClient(CloseableHttpClient client) { + try { + if (client != null) { + client.close(); + } + } catch (IOException e) { + System.out.println(String.format("failed to close client or response: %s", e.getMessage())); + } + } + + private static File getTestZipFile(String filepath, String filename) throws IOException { + Config config = Utils.getConfig(); + String sourceDir = config.getImportResourceTestsConfigDir(); + java.nio.file.Path filePath = FileSystems.getDefault().getPath(filepath + File.separator + filename); + return filePath.toFile(); + } + + public static RestResponse checkinVendorSoftwareProduct(String vspid, User user) throws Exception { + return actionOnComponent(vspid, "Checkin", "vendor-software-products", user); + } + + private static RestResponse checkoutVendorSoftwareProduct(String vspid, User user) throws Exception { + return actionOnComponent(vspid, "Checkout", "vendor-software-products", user); + } + + public static RestResponse submitVendorSoftwareProduct(String vspid, User user) throws Exception { + return actionOnComponent(vspid, "Submit", "vendor-software-products", user); + } + + public static RestResponse createPackageOfVendorSoftwareProduct(String vspid, User user) throws Exception { + return actionOnComponent(vspid, "Create_Package", "vendor-software-products", user); + } + + protected static Map<String, String> prepareHeadersMap(String userId) { + Map<String, String> headersMap = new HashMap<String, String>(); + headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json"); + headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json"); + headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId); + return headersMap; + } + + +// private static void importUpdateVSP(Pair<String, Map<String, String>> vsp, boolean isUpdate) throws Exception{ +// String vspName = vsp.left; +// Map<String, String> vspMetadata = vsp.right; +// boolean vspFound = HomePage.searchForVSP(vspName); +// +// if (vspFound){ +// +// List<WebElement> elemenetsFromTable = HomePage.getElemenetsFromTable(); +//// WebDriverWait wait = new WebDriverWait(GeneralUIUtils.getDriver(), 30); +//// WebElement findElement = wait.until(ExpectedConditions.visibilityOf(elemenetsFromTable.get(1))); +//// findElement.click(); +// elemenetsFromTable.get(1).click(); +// GeneralUIUtils.waitForLoader(); +// +// if (isUpdate){ +// GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.UPDATE_VSP.getValue()); +// +// } +// else{ +// GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ImportVfRepository.IMPORT_VSP.getValue()); +// } +// +// String lifeCycleState = ResourceGeneralPage.getLifeCycleState(); +// boolean needCheckout = lifeCycleState.equals(LifeCycleStateEnum.CHECKIN.getValue()) || lifeCycleState.equals(LifeCycleStateEnum.CERTIFIED.getValue()); +// if (needCheckout) +// { +// try { +// ResourceGeneralPage.clickCheckoutButton(); +// Assert.assertTrue(ResourceGeneralPage.getLifeCycleState().equals(LifeCycleStateEnum.CHECKOUT.getValue()), "Did not succeed to checkout"); +// +// } catch (Exception e) { +// ExtentTestActions.log(Status.ERROR, "Did not succeed to checkout"); +// e.printStackTrace(); +// } +// GeneralUIUtils.waitForLoader(); +// } +// +// //Metadata verification +// VfVerificator.verifyOnboardedVnfMetadata(vspName, vspMetadata); +// +// ExtentTestActions.log(Status.INFO, "Clicking create/update VNF"); +// String duration = GeneralUIUtils.getActionDuration(() -> waitUntilVnfCreated()); +// ExtentTestActions.log(Status.INFO, "Succeeded in importing/updating " + vspName, duration); +// } +// else{ +// Assert.fail("Did not find VSP named " + vspName); +// } +// } + +// private static void waitUntilVnfCreated() { +// GeneralUIUtils.clickOnElementByTestIdWithoutWait(DataTestIdEnum.GeneralElementsEnum.CREATE_BUTTON.getValue()); +// GeneralUIUtils.waitForLoader(60*10); +// GeneralUIUtils.waitForAngular(); +// GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.GeneralElementsEnum.CHECKIN_BUTTON.getValue()); +// } +// +// public static void updateVSP(Pair<String, Map<String, String>> vsp) throws Exception{ +// ExtentTestActions.log(Status.INFO, "Updating VSP " + vsp.left); +// importUpdateVSP(vsp, true); +// } +// +// public static void importVSP(Pair<String, Map<String, String>> vsp) throws Exception{ +// ExtentTestActions.log(Status.INFO, "Importing VSP " + vsp.left); +// importUpdateVSP(vsp, false); +// } +// +// public static void updateVnfAndValidate(String filepath, Pair<String, Map<String, String>> vsp, String updatedVnfFile, User user) throws Exception, Throwable { +// ExtentTestActions.log(Status.INFO, String.format("Going to update the VNF with %s......", updatedVnfFile)); +// System.out.println(String.format("Going to update the VNF with %s......", updatedVnfFile)); +// +// Map<String, String> vspMap = vsp.right; +// String vspId = vspMap.get("vspId"); +// +// updateVendorSoftwareProduct(vspId, updatedVnfFile, filepath, user); +// HomePage.showVspRepository(); +// updateVSP(vsp); +// ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); +// DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, updatedVnfFile); +// } +// +// public static Pair<String, Map<String, String>> onboardAndValidate(String filepath, String vnfFile, User user) throws Exception { +// ExtentTestActions.log(Status.INFO, String.format("Going to onboard the VNF %s", vnfFile)); +// System.out.println(String.format("Going to onboard the VNF %s", vnfFile)); +// +// AmdocsLicenseMembers amdocsLicenseMembers = createVendorLicense(user); +// Pair<String, Map<String, String>> createVendorSoftwareProduct = createVendorSoftwareProduct(vnfFile, filepath, user, amdocsLicenseMembers); +// String vspName = createVendorSoftwareProduct.left; +// +// DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.right.get("vspId")); +// File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); +// +// ExtentTestActions.log(Status.INFO, String.format("Searching for onboarded %s", vnfFile)); +// HomePage.showVspRepository(); +// ExtentTestActions.log(Status.INFO,String.format("Going to import %s", vnfFile.substring(0, vnfFile.indexOf(".")))); +// importVSP(createVendorSoftwareProduct); +// +// ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); +// +// // Verify deployment artifacts +// Map<String, Object> combinedMap = ArtifactFromCsar.combineHeatArtifacstWithFolderArtifacsToMap(latestFilefromDir.getAbsolutePath()); +// +// LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts = ((LinkedList<HeatMetaFirstLevelDefinition>) combinedMap.get("Deployment")); +// ArtifactsCorrelationManager.addVNFartifactDetails(vspName, deploymentArtifacts); +// +// List<String> heatEnvFilesFromCSAR = deploymentArtifacts.stream().filter(e -> e.getType().equals("HEAT_ENV")). +// map(e -> e.getFileName()). +// collect(Collectors.toList()); +// +// validateDeploymentArtifactsVersion(deploymentArtifacts, heatEnvFilesFromCSAR); +// +// DeploymentArtifactPage.verifyArtifactsExistInTable(filepath, vnfFile); +// return createVendorSoftwareProduct; +// } +// +// public static void validateDeploymentArtifactsVersion(LinkedList<HeatMetaFirstLevelDefinition> deploymentArtifacts, +// List<String> heatEnvFilesFromCSAR) { +// String artifactVersion; +// String artifactName; +// +// for(HeatMetaFirstLevelDefinition deploymentArtifact: deploymentArtifacts) { +// artifactVersion = "1"; +// +// if(deploymentArtifact.getType().equals("HEAT_ENV")) { +// continue; +// } else if(deploymentArtifact.getFileName().contains(".")) { +// artifactName = deploymentArtifact.getFileName().trim().substring(0, deploymentArtifact.getFileName().lastIndexOf(".")); +// } else { +// artifactName = deploymentArtifact.getFileName().trim(); +// } +// +// if (heatEnvFilesFromCSAR.contains(artifactName + ".env")){ +// artifactVersion = "2"; +// } +// ArtifactUIUtils.validateArtifactNameVersionType(artifactName, artifactVersion, deploymentArtifact.getType()); +// } +// } + + + /** + * @return + * The method returns VNF names list from Files directory under sdc-vnfs repository + */ + public static List<String> getVnfNamesFileList() { + String filepath = FileHandling.getVnfRepositoryPath(); + List<String> fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filepath); + fileNamesFromFolder.removeAll(exludeVnfList); + return fileNamesFromFolder; + } + + /** + * @return + * The method returns VNF names list from Files directory under sdc-vnfs repository excluding zip files that known as failed in tosca parser + */ + public static List<String> getVnfNamesFileListExcludeToscaParserFailure() { + List<String> fileNamesFromFolder = getVnfNamesFileList(); + fileNamesFromFolder.removeAll(exludeVnfListForToscaParser); + return fileNamesFromFolder; + } + +} + +
\ No newline at end of file diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/SnmpTypeEnum.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/SnmpTypeEnum.java new file mode 100644 index 0000000000..71038920ae --- /dev/null +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/general/SnmpTypeEnum.java @@ -0,0 +1,88 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.ci.tests.utils.general; + +import static org.testng.AssertJUnit.assertEquals; + +import java.io.File; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.StringWriter; +import java.nio.file.FileSystems; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.UUID; +import java.util.stream.Collectors; + +import org.apache.commons.io.IOUtils; +import org.apache.http.HttpEntity; +import org.apache.http.client.ClientProtocolException; +import org.apache.http.client.methods.CloseableHttpResponse; +import org.apache.http.client.methods.HttpPost; +import org.apache.http.entity.mime.MultipartEntityBuilder; +import org.apache.http.entity.mime.content.FileBody; +import org.apache.http.impl.client.CloseableHttpClient; +import org.apache.http.impl.client.HttpClients; +import org.json.JSONException; +import org.json.JSONObject; +import org.json.simple.JSONArray; +import org.json.simple.JSONValue; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.ci.tests.config.Config; +import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers; + +import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition; + +import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; +import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; +import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; +import org.openecomp.sdc.ci.tests.execute.devCI.ArtifactFromCsar; + + +import org.openecomp.sdc.ci.tests.utils.Utils; +import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; + +import org.testng.Assert; + +import com.aventstack.extentreports.Status; +import com.clearspring.analytics.util.Pair; + +enum SnmpTypeEnum{ + SNMP_POLL ("snmp"), + SNMP_TRAP ("snmp-trap"); + + private String value; + + public String getValue() { + return value; + } + + private SnmpTypeEnum(String value) { + this.value = value; +} + +} + diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java index e08ef6523f..ec8fd4089a 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtils.java @@ -78,7 +78,7 @@ public class ResourceRestUtils extends BaseRestUtils { Gson gson = new Gson(); String userBodyJson = gson.toJson(resourceDetails); - String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson); headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5); HttpRequest http = new HttpRequest(); // System.out.println(url); @@ -490,7 +490,7 @@ public class ResourceRestUtils extends BaseRestUtils { Gson gson = new Gson(); String userBodyJson = gson.toJson(resourceDetails); - String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson); headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5); HttpRequest http = new HttpRequest(); RestResponse updateResourceResponse = http.httpSendPut(url, userBodyJson, headersMap); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java index 10f573cf0e..19d7d728fe 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/ci/tests/utils/rest/ResourceRestUtilsExternalAPI.java @@ -48,7 +48,7 @@ public class ResourceRestUtilsExternalAPI extends BaseRestUtils { Gson gson = new Gson(); String userBodyJson = gson.toJson(resourceDetails); - String calculateMD5 = GeneralUtility.calculateMD5ByString(userBodyJson); + String calculateMD5 = GeneralUtility.calculateMD5Base64EncodedByString(userBodyJson); headersMap.put(HttpHeaderEnum.Content_MD5.getValue(), calculateMD5); headersMap.put(HttpHeaderEnum.AUTHORIZATION.getValue(), authorizationHeader); headersMap.put(HttpHeaderEnum.X_ECOMP_INSTANCE_ID.getValue(), "ci"); diff --git a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java index 61b7ea18d2..9ba6953bb3 100644 --- a/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java +++ b/test-apis-ci/src/main/java/org/openecomp/sdc/externalApis/CRUDExternalAPI.java @@ -3377,7 +3377,7 @@ public class CRUDExternalAPI extends ComponentBaseTest { httppost.addHeader(HttpHeaderEnum.ACCEPT.getValue(), acceptHeaderDate); httppost.addHeader(HttpHeaderEnum.USER_ID.getValue(), sdncUserDetails.getUserId()); if (addMd5Header) { - httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5ByString(jsonBody)); + httppost.addHeader(HttpHeaderEnum.Content_MD5.getValue(), GeneralUtility.calculateMD5Base64EncodedByString(jsonBody)); } StringEntity input = new StringEntity(jsonBody); input.setContentType("application/json"); diff --git a/ui-ci/pom.xml b/ui-ci/pom.xml index 9206348c3b..03b3f155bb 100644 --- a/ui-ci/pom.xml +++ b/ui-ci/pom.xml @@ -135,8 +135,8 @@ </dependency> <dependency> - <groupId>com.thinkaurelius.titan</groupId> - <artifactId>titan-cassandra</artifactId> + <groupId>org.openecomp.sdc.sdc-titan-cassandra</groupId> + <artifactId>sdc-titan-cassandra</artifactId> <version>${titan.version}</version> <scope>compile</scope> </dependency> diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java index 41c1212cc0..06e55bc51f 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/AddComponentInstancesArtifactsInCsar.java @@ -120,7 +120,7 @@ public class AddComponentInstancesArtifactsInCsar extends SetupCDTest { ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen(); ToscaArtifactsPage.downloadCsar(); - File latestFilefromDir = FileHandling.getLastModifiedFileFromDir(); + File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); Map<String, Object> combineHeatArtifacstWithFolderArtifacsToMap = ArtifactFromCsar.getVFCArtifacts(latestFilefromDir.getAbsolutePath()); compareArtifactFromFileStructureToArtifactsFromJavaObject(artifacts, combineHeatArtifacstWithFolderArtifacsToMap); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java index 9ea1b7239c..3fb1529461 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/MIBsArtifactsOnResourceInstance.java @@ -133,7 +133,7 @@ public class MIBsArtifactsOnResourceInstance extends SetupCDTest { @DataProvider(name="mibsArtifacsOnResourceInstanceShouldOnlyHaveDownloadOption") public static Object[][] dataProviderMibsArtifacsOnResourceInstanceShouldOnlyHaveDownloadOption() { return new Object[][] { - {"mibs1vFW_VFC.yml", ResourceTypeEnum.VFC}, +// {"mibs1vFW_VFC.yml", ResourceTypeEnum.VFC}, // TODO: delete comment below when we will have support for VL on canvas // {"mibs1VL.yml", ResourceTypeEnum.VL}, {"mibs1CP.yml", ResourceTypeEnum.CP} @@ -145,9 +145,9 @@ public class MIBsArtifactsOnResourceInstance extends SetupCDTest { @Test(dataProvider="mibsArtifacsOnResourceInstanceShouldOnlyHaveDownloadOption") public void mibsArtifacsOnResourceInstanceShouldOnlyHaveDownloadOption(String fileName, ResourceTypeEnum resourceTypeEnum) throws Exception { - if(resourceTypeEnum.equals(ResourceTypeEnum.CP)){ - throw new SkipException("Open bug 322930"); - } +// if(resourceTypeEnum.equals(ResourceTypeEnum.CP)){ +// throw new SkipException("Open bug 322930"); +// } setLog(fileName); @@ -174,7 +174,7 @@ public class MIBsArtifactsOnResourceInstance extends SetupCDTest { // 4. Create VF. ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); // 5. Click on composition. ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); @@ -212,7 +212,7 @@ public class MIBsArtifactsOnResourceInstance extends SetupCDTest { // 1. Create VF. ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(resourceMetaData, getUser()); + ResourceUIUtils.createVF(resourceMetaData, getUser()); // 2. Upload MIBs artifacts - SNMP_TRAP & SNMP_POLL. ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/NewArtifactTypeGuide.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/NewArtifactTypeGuide.java index 9d460b0b0c..2195af9a90 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/NewArtifactTypeGuide.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/NewArtifactTypeGuide.java @@ -53,7 +53,7 @@ public class NewArtifactTypeGuide extends SetupCDTest { String filePath = FileHandling.getFilePath(folder); ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(resourceMetaData, getUser()); + ResourceUIUtils.createVF(resourceMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen(); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java index 1f85ec21fb..df68a1893a 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/RemoveRestrictionOfDeploymentArtifacts.java @@ -81,7 +81,7 @@ public class RemoveRestrictionOfDeploymentArtifacts extends SetupCDTest { @Test public void createServiceWithInformationalArtifacts() throws Exception { ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(resourceMetaData, getUser()); + ResourceUIUtils.createVF(resourceMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen(); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java index 4e9770cbea..8e669b1fac 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Testing.java @@ -22,6 +22,7 @@ package org.openecomp.sdc.ci.tests.US; import java.io.File; import java.text.SimpleDateFormat; +import java.util.Arrays; import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -35,6 +36,8 @@ import org.openecomp.sdc.ci.tests.utilities.FileHandling; import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils; import org.testng.Assert; +import fj.data.Array; + @@ -195,8 +198,11 @@ public class Testing { // } System.out.println("Finished"); System.out.println("get service start " + new SimpleDateFormat("yyyy/MM/dd HH:mm:ss").format(new Date())); + + + } - + diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java index e7d933491c..64caee87e9 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/VfModule.java @@ -85,7 +85,7 @@ public class VfModule extends SetupCDTest { String vspName = createVendorSoftwareProduct.left; // DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.right.get("vspId")); - File latestFilefromDir = FileHandling.getLastModifiedFileFromDir(); + File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); List<TypeHeatMetaDefinition> listTypeHeatMetaDefinition = CsarParserUtils.getListTypeHeatMetaDefinition(latestFilefromDir); // getExtendTest().log(Status.INFO, String.format("Searching for onboarded %s", vnfFile)); @@ -133,7 +133,7 @@ public class VfModule extends SetupCDTest { GeneralUIUtils.clickOnElementByTestId("breadcrumbs-button-1"); ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen(); GeneralUIUtils.clickOnElementByTestId(ToscaArtifactsScreenEnum.TOSCA_TEMPLATE.getValue()); - latestFilefromDir = FileHandling.getLastModifiedFileFromDir(); + latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); // verification Service service = AtomicOperationUtils.getServiceObjectByNameAndVersion(UserRoleEnum.DESIGNER, serviceMetadata.getName(), serviceMetadata.getVersion()); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Vf_Tests_UI.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Vf_Tests_UI.java index 71c2612a82..677eb8cb10 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Vf_Tests_UI.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/Vf_Tests_UI.java @@ -57,7 +57,7 @@ public class Vf_Tests_UI extends SetupCDTest{ public void uploadHeatEnvVFLevel() throws Exception { ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); } diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java index 291a1dbb2e..6fcede0fce 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/US/extendNode_TemplatePropertiesWithDefaultValues.java @@ -80,7 +80,7 @@ public class extendNode_TemplatePropertiesWithDefaultValues extends SetupCDTest ServiceUIUtils.createService(serviceMetadata, getUser()); } else { ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(resourceMetaData, getUser()); + ResourceUIUtils.createVF(resourceMetaData, getUser()); } ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); @@ -163,7 +163,7 @@ public class extendNode_TemplatePropertiesWithDefaultValues extends SetupCDTest ServiceUIUtils.createService(serviceMetadata, getUser()); } else { ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(resourceMetaData, getUser()); + ResourceUIUtils.createVF(resourceMetaData, getUser()); } ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java index f63be6c8c3..69037500a2 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/dataProvider/OnbordingDataProviders.java @@ -1,17 +1,22 @@ package org.openecomp.sdc.ci.tests.dataProvider; +import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; +import org.openecomp.sdc.ci.tests.execute.sanity.ToscaValidationTest; +import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest; import org.openecomp.sdc.ci.tests.utilities.FileHandling; import org.openecomp.sdc.ci.tests.utilities.OnboardingUtils; import org.testng.annotations.DataProvider; +import org.testng.annotations.Factory; public class OnbordingDataProviders { protected static String filepath = FileHandling.getVnfRepositoryPath(); +// -----------------------dataProviders----------------------------------------- @DataProvider(name = "randomVNF_List", parallel = false) private static final Object[][] randomVnfList() throws Exception { int randomElementNumber = 3; //how many VNFs to onboard randomly @@ -30,6 +35,13 @@ public class OnbordingDataProviders { return provideData(fileNamesFromFolder, filepath); } +// -----------------------factories----------------------------------------- + @Factory(dataProvider = "VNF_List") + public Object[] OnbordingDataProviders(String filepath, String vnfFile){ + return new Object[] { new ToscaValidationTest(filepath, vnfFile)}; + } + + // -----------------------methods----------------------------------------- public static Object[][] provideData(List<String> fileNamesFromFolder, String filepath) { diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java index fd6980fddd..f2e46b2973 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/DataTestIdEnum.java @@ -36,7 +36,8 @@ public final class DataTestIdEnum { IMPORT_VF("importVFbutton"), IMPORT_VFC_FILE("file-importVFCbutton"), IMPORT_VF_FILE("file-importVFbutton"), - BUTTON_ADD_PRODUCT("createProductButton"); + BUTTON_ADD_PRODUCT("createProductButton"), + BUTTON_ADD_PNF("createPNFButton"), ; private String value; diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java new file mode 100644 index 0000000000..fbdb88e712 --- /dev/null +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/datatypes/VendorSoftwareProductObject.java @@ -0,0 +1,102 @@ +package org.openecomp.sdc.ci.tests.datatypes; + +public class VendorSoftwareProductObject { + + private String vendorName; + private String vspId; + private String category; + private String subCategory; + private String componentId; + private String description; + private String attContact; + private String vspName; + + public VendorSoftwareProductObject() { + super(); + // TODO Auto-generated constructor stub + } + + public VendorSoftwareProductObject(String vendorName, String vspId, String category, String subCategory, String componentId, String description, String attContact) { + super(); + this.vendorName = vendorName; + this.vspId = vspId; + this.category = category; + this.subCategory = subCategory; + this.componentId = componentId; + this.description = description; + this.attContact = attContact; + } + + + public String getVspName() { + return vspName; + } + + public void setVspName(String vspName) { + this.vspName = vspName; + } + + public String getVendorName() { + return vendorName; + } + + public void setVendorName(String vendorName) { + this.vendorName = vendorName; + } + + public String getVspId() { + return vspId; + } + + public void setVspId(String vspId) { + this.vspId = vspId; + } + + public String getCategory() { + return category; + } + + public void setCategory(String category) { + this.category = category; + } + + public String getSubCategory() { + return subCategory; + } + + public void setSubCategory(String subCategory) { + this.subCategory = subCategory; + } + + public String getComponentId() { + return componentId; + } + + public void setComponentId(String componentId) { + this.componentId = componentId; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getAttContact() { + return attContact; + } + + public void setAttContact(String attContact) { + this.attContact = attContact; + } + + @Override + public String toString() { + return "VendorSoftwareProductObject [vendorName=" + vendorName + ", vspId=" + vspId + ", category=" + category + ", subCategory=" + subCategory + ", componentId=" + componentId + ", description=" + description + ", attContact=" + + attContact + "]"; + } + + +} diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java index f842136425..0e09059b28 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/AdminUserManagment.java @@ -229,7 +229,7 @@ public class AdminUserManagment extends SetupCDTest { reloginWithNewRole(UserRoleEnum.DESIGNER); ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); ExtentTestActions.log(Status.INFO, "Creating a new VF named " + resourceMetaData.getName()); - ResourceUIUtils.createResource(resourceMetaData, getUser()); + ResourceUIUtils.createVF(resourceMetaData, getUser()); ResourceGeneralPage.clickSubmitForTestingButton(resourceMetaData.getName()); Resource resourceObjectByNameAndVersion = AtomicOperationUtils.getResourceObjectByNameAndVersion(UserRoleEnum.DESIGNER, resourceMetaData.getName(), "0.1"); ExtentTestActions.log(Status.INFO, "Getting the VF to 'In Testing' state."); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java index f0bc6f7505..5533eb38f5 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CatalogLeftPanelTest.java @@ -197,7 +197,7 @@ public class CatalogLeftPanelTest extends SetupCDTest{ public void lastUpdatedResource() throws Exception{ // create resource ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.clickCheckinButton(vfMetaData.getName()); CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG); @@ -210,7 +210,7 @@ public class CatalogLeftPanelTest extends SetupCDTest{ public void fromCatalogCheckout() throws Exception{ // create resource ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.clickCheckinButton(vfMetaData.getName()); CatalogUIUtilitis.clickTopMenuButton(TopMenuButtonsEnum.CATALOG); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java index d2c787e4e5..5d1dfea5c1 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Categories.java @@ -192,7 +192,7 @@ public class Categories extends SetupCDTest { SubCategoryDefinition subCategoryDefinition = categoryDefinition.getSubcategories().get(0); subCategoryDefinition.setName(newSubCategory); - ResourceUIUtils.createResource(resourceMetaData, getUser()); + ResourceUIUtils.createVF(resourceMetaData, getUser()); } diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java index b8b7bd752e..7dd3279644 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/CustomizationUUID.java @@ -307,7 +307,7 @@ public class CustomizationUUID extends SetupCDTest { public ResourceReqDetails createNewResourceWithArtifactSubmitForTesting() throws Exception { ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java index c9dcf2a08e..f32709e219 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/OnboardViaApis.java @@ -24,17 +24,13 @@ import static org.testng.AssertJUnit.assertEquals; import java.awt.AWTException; import java.io.File; -import java.io.FileOutputStream; -import java.nio.charset.StandardCharsets; import java.sql.Timestamp; -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.UUID; -import org.bouncycastle.util.encoders.Base64; import org.openecomp.sdc.be.model.ComponentInstance; import org.openecomp.sdc.be.model.Resource; import org.openecomp.sdc.be.model.Service; @@ -42,21 +38,21 @@ import org.openecomp.sdc.be.model.User; import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders; import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers; import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; +import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject; import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; import org.openecomp.sdc.ci.tests.utilities.FileHandling; +import org.openecomp.sdc.ci.tests.utilities.OnboardingUtillViaApis; import org.openecomp.sdc.ci.tests.utilities.OnboardingUtils; import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; -import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; import org.openecomp.sdc.ci.tests.utils.rest.ResponseParser; import org.slf4j.LoggerFactory; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import com.clearspring.analytics.util.Pair; -import com.google.gson.Gson; import ch.qos.logback.classic.Level; import ch.qos.logback.classic.LoggerContext; @@ -66,11 +62,11 @@ public class OnboardViaApis{ private static final String FULL_PATH = "C://tmp//CSARs//"; - + protected static String filepath = FileHandling.getVnfRepositoryPath(); //------------------------------------------------------------------------------------------------------- User sdncDesignerDetails1 = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); - ResourceReqDetails resourceDetails; +// ResourceReqDetails resourceDetails; Timestamp timestamp = new Timestamp(System.currentTimeMillis()); @@ -80,7 +76,7 @@ public class OnboardViaApis{ lc.getLogger("org.apache").setLevel(Level.OFF); lc.getLogger("org.*").setLevel(Level.OFF); lc.getLogger("org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest").setLevel(Level.OFF); - resourceDetails = ElementFactory.getDefaultResource(); +// resourceDetails = ElementFactory.getDefaultResource(); } @Test(dataProviderClass = OnbordingDataProviders.class, dataProvider = "VNF_List") @@ -95,7 +91,7 @@ public class OnboardViaApis{ timestamp = new Timestamp(System.currentTimeMillis()); System.err.println(timestamp + " Starting download service csar file: " + vnfFile); File file = new File(fullFileName); - downloadToscaCsarToDirectory(service, file); + OnboardingUtillViaApis.downloadToscaCsarToDirectory(service, file); timestamp = new Timestamp(System.currentTimeMillis()); System.err.println(timestamp + " Finished download service csar file: " + vnfFile); System.out.println("end"); @@ -106,8 +102,6 @@ public class OnboardViaApis{ @Test public void onboardingAndParser() throws Exception { Service service = null; - String filepath = getFilePath(); -// Object[] fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filepath); List<String> fileNamesFromFolder = FileHandling.getZipFileNamesFromFolder(filepath); String vnfFile = fileNamesFromFolder.get(7); System.err.println(timestamp + " Starting test with VNF: " + vnfFile); @@ -119,49 +113,19 @@ public class OnboardViaApis{ // convertServiceDistributionStatusToObject. } - public static String getFilePath() { - String filepath = System.getProperty("filepath"); - if (filepath == null && System.getProperty("os.name").contains("Windows")) { - filepath = FileHandling.getResourcesFilesPath() +"VNFs"; - } - - else if(filepath.isEmpty() && !System.getProperty("os.name").contains("Windows")){ - filepath = FileHandling.getBasePath() + File.separator + "Files" + File.separator +"VNFs"; - } - return filepath; - } - public static void downloadToscaCsarToDirectory(Service service, File file) { - try { - Either<String,RestResponse> serviceToscaArtifactPayload = AtomicOperationUtils.getServiceToscaArtifactPayload(service, "assettoscacsar"); - if(serviceToscaArtifactPayload.left().value() != null){ - Gson gson = new Gson(); - @SuppressWarnings("unchecked") - Map<String, String> fromJson = gson.fromJson(serviceToscaArtifactPayload.left().value(), Map.class); - String string = fromJson.get("base64Contents").toString(); - byte[] byteArray = Base64.decode(string.getBytes(StandardCharsets.UTF_8)); - File downloadedFile = new File(file.getAbsolutePath()); - FileOutputStream fos = new FileOutputStream(downloadedFile); - fos.write(byteArray); - fos.flush(); - fos.close(); - } - - } catch (Exception e) { - // TODO Auto-generated catch block - e.printStackTrace(); - } - - } + public Service runOnboardViaApisOnly(String filepath, String vnfFile) throws Exception, AWTException { Timestamp timestamp = new Timestamp(System.currentTimeMillis()); System.err.println(timestamp + " Starting onboard VNF: " + vnfFile); - Pair<String,Map<String,String>> onboardAndValidate = onboardAndValidateViaApi(filepath, vnfFile, sdncDesignerDetails1); - String vspName = onboardAndValidate.left; + Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = OnboardingUtillViaApis.createVspViaApis(filepath, vnfFile, sdncDesignerDetails1); + String vspName = createVendorSoftwareProduct.left; + VendorSoftwareProductObject vendorSoftwareProductObject = createVendorSoftwareProduct.right; timestamp = new Timestamp(System.currentTimeMillis()); System.err.println(timestamp + " Finished onboard VNF: " + vnfFile); - Resource resource = AtomicOperationUtils.getResourceObject(resourceDetails.getUniqueId()); + ResourceReqDetails resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(vendorSoftwareProductObject, vspName); + Resource resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails, vspName); AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true); resource = AtomicOperationUtils.getResourceObject(resource.getUniqueId()); @@ -175,27 +139,9 @@ public class OnboardViaApis{ - public Pair<String, Map<String, String>> onboardAndValidateViaApi(String filepath, String vnfFile, User user) throws Exception { - - AmdocsLicenseMembers amdocsLicenseMembers = createVendorLicense(user); - Pair<String, Map<String, String>> createVendorSoftwareProduct = createVendorSoftwareProduct(vnfFile, filepath, user, amdocsLicenseMembers); - String vspName = createVendorSoftwareProduct.left; - List<String> tags = new ArrayList<>(); - tags.add(vspName); - Map<String, String> map = createVendorSoftwareProduct.right; - - resourceDetails.setCsarUUID(map.get("vspId")); - resourceDetails.setCsarVersion("1.0"); - resourceDetails.setName(vspName); - resourceDetails.setTags(tags); - resourceDetails.setResourceType(map.get("componentType")); - resourceDetails.setVendorName(map.get("vendorName")); - resourceDetails.setVendorRelease("1.0"); - resourceDetails.setResourceType("VF"); - RestResponse createResource = ResourceRestUtils.createResource(resourceDetails, sdncDesignerDetails1); - - return createVendorSoftwareProduct; - } + + + public static Pair<String, Map<String, String>> createVendorSoftwareProduct(String HeatFileName, String filepath, User user, AmdocsLicenseMembers amdocsLicenseMembers) throws Exception { diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java new file mode 100644 index 0000000000..0bb315aefe --- /dev/null +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/PNF.java @@ -0,0 +1,296 @@ +package org.openecomp.sdc.ci.tests.execute.sanity; + +import java.util.List; + +import org.openecomp.sdc.be.dao.api.ActionStatus; +import org.openecomp.sdc.be.datatypes.enums.ResourceTypeEnum; +import org.openecomp.sdc.be.model.LifecycleStateEnum; +import org.openecomp.sdc.ci.tests.datatypes.ArtifactInfo; +import org.openecomp.sdc.ci.tests.datatypes.CanvasElement; +import org.openecomp.sdc.ci.tests.datatypes.CanvasManager; +import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum; +import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; +import org.openecomp.sdc.ci.tests.datatypes.enums.ArtifactTypeEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.NormativeTypesEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; +import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest; +import org.openecomp.sdc.ci.tests.pages.CompositionPage; +import org.openecomp.sdc.ci.tests.pages.GeneralPageElements; +import org.openecomp.sdc.ci.tests.pages.InformationalArtifactPage; +import org.openecomp.sdc.ci.tests.pages.PropertiesPage; +import org.openecomp.sdc.ci.tests.pages.ResourceGeneralPage; +import org.openecomp.sdc.ci.tests.pages.TesterOperationPage; +import org.openecomp.sdc.ci.tests.pages.ToscaArtifactsPage; +import org.openecomp.sdc.ci.tests.utilities.ArtifactUIUtils; +import org.openecomp.sdc.ci.tests.utilities.FileHandling; +import org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils; +import org.openecomp.sdc.ci.tests.utilities.ResourceUIUtils; +import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; +import org.openecomp.sdc.ci.tests.utils.rest.ResourceRestUtils; +import org.openecomp.sdc.ci.tests.utils.validation.ErrorValidationUtils; +import org.openecomp.sdc.ci.tests.verificator.VfVerificator; +import org.openqa.selenium.By; +import org.openqa.selenium.WebElement; +import org.testng.AssertJUnit; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.BeforeMethod; +import org.testng.annotations.Test; + +import com.aventstack.extentreports.Status; + +public class PNF extends SetupCDTest { + + private String filePath; + @BeforeClass + public void beforeClass(){ + filePath = FileHandling.getFilePath(""); + } + + @BeforeMethod + public void beforeTest(){ + System.out.println("File repository is : " + filePath); + getExtendTest().log(Status.INFO, "File repository is : " + filePath); + } + + @Test + public void updatePNF() throws Exception { + + ResourceReqDetails pnfMetaData = createPNFWithGenerateName(); + + // update Resource + ResourceReqDetails updatedResource = new ResourceReqDetails(); + updatedResource.setName("ciUpdatedName"); + updatedResource.setDescription("kuku"); + updatedResource.setVendorName("updatedVendor"); + updatedResource.setVendorRelease("updatedRelease"); + updatedResource.setContactId("ab0001"); + updatedResource.setCategories(pnfMetaData.getCategories()); + updatedResource.setVersion("0.1"); + updatedResource.setResourceType(ResourceTypeEnum.VF.getValue()); + List<String> newTags = pnfMetaData.getTags(); + newTags.remove(pnfMetaData.getName()); + newTags.add(updatedResource.getName()); + updatedResource.setTags(newTags); + ResourceUIUtils.updateResource(updatedResource, getUser()); + + VfVerificator.verifyVFMetadataInUI(updatedResource); + VfVerificator.verifyVFUpdated(updatedResource, getUser()); + } + + @Test + public void addUpdateDeleteInformationalArtifactPNFTest() throws Exception { + ResourceReqDetails pnfMetaData = createPNFWithGenerateName(); + + ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen(); + + ArtifactInfo informationalArtifact = new ArtifactInfo(filePath, "asc_heat 0 2.yaml", "kuku", "artifact1", "OTHER"); + InformationalArtifactPage.clickAddNewArtifact(); + ArtifactUIUtils.fillAndAddNewArtifactParameters(informationalArtifact); + + AssertJUnit.assertTrue("artifact table does not contain artifacts uploaded", InformationalArtifactPage.checkElementsCountInTable(1)); + + String newDescription = "new description"; + InformationalArtifactPage.clickEditArtifact(informationalArtifact.getArtifactLabel()); + InformationalArtifactPage.artifactPopup().insertDescription(newDescription); + InformationalArtifactPage.artifactPopup().clickDoneButton(); + String actualArtifactDescription = InformationalArtifactPage.getArtifactDescription(informationalArtifact.getArtifactLabel()); + AssertJUnit.assertTrue("artifact description is not updated", newDescription.equals(actualArtifactDescription)); + + InformationalArtifactPage.clickDeleteArtifact(informationalArtifact.getArtifactLabel()); + InformationalArtifactPage.clickOK(); + AssertJUnit.assertTrue("artifact "+ informationalArtifact.getArtifactLabel() + "is not deleted", InformationalArtifactPage.checkElementsCountInTable(0)); + } + + @Test + public void addPropertiesToVfcInstanceInPNFTest() throws Exception { + + String fileName = "CP.yml"; + ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser()); + + try{ + ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser()); + ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName()); + + ResourceReqDetails pnfMetaData = createPNFWithGenerateName(); + + ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); + CanvasManager vfCanvasManager = CanvasManager.getCanvasManager(); + CompositionPage.searchForElement(atomicResourceMetaData.getName()); + CanvasElement cpElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName()); + + vfCanvasManager.clickOnCanvaElement(cpElement); + CompositionPage.showPropertiesAndAttributesTab(); + List<WebElement> properties = CompositionPage.getProperties(); + String propertyValue = "abc123"; + for (int i = 0; i < 2; i++) { + WebElement findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-and-attribute-label")); + findElement.click(); + PropertiesPage.getPropertyPopup().insertPropertyDefaultValue(propertyValue); + PropertiesPage.getPropertyPopup().clickSave(); + + findElement = properties.get(i).findElement(By.className("i-sdc-designer-sidebar-section-content-item-property-value")); + AssertJUnit.assertTrue(findElement.getText().equals(propertyValue)); + } + } + finally{ + ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "0.1"); + } + } + + @Test + public void changeInstanceVersionPNFTest() throws Exception{ + + ResourceReqDetails atomicResourceMetaData = null; + ResourceReqDetails pnfMetaData = null; + CanvasManager vfCanvasManager; + CanvasElement cpElement = null; + String fileName = "CP.yml"; + try{ + atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.CP, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser()); + ResourceUIUtils.importVfc(atomicResourceMetaData, filePath, fileName, getUser()); + ResourceGeneralPage.clickSubmitForTestingButton(atomicResourceMetaData.getName()); + + pnfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, getUser()); + ResourceUIUtils.createPNF(pnfMetaData, getUser()); + ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); + vfCanvasManager = CanvasManager.getCanvasManager(); + CompositionPage.searchForElement(atomicResourceMetaData.getName()); + cpElement = vfCanvasManager.createElementOnCanvas(atomicResourceMetaData.getName()); + + + CompositionPage.clickSubmitForTestingButton(pnfMetaData.getName()); + assert(false); + } + catch(Exception e){ + String errorMessage = GeneralUIUtils.getWebElementByClassName("w-sdc-modal-caption").getText(); + String checkUIResponseOnError = ErrorValidationUtils.checkUIResponseOnError(ActionStatus.VALIDATED_RESOURCE_NOT_FOUND.name()); + AssertJUnit.assertTrue(errorMessage.contains(checkUIResponseOnError)); + + + reloginWithNewRole(UserRoleEnum.TESTER); + GeneralUIUtils.findComponentAndClick(atomicResourceMetaData.getName()); + TesterOperationPage.certifyComponent(atomicResourceMetaData.getName()); + + reloginWithNewRole(UserRoleEnum.DESIGNER); + GeneralUIUtils.findComponentAndClick(pnfMetaData.getName()); + ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); + vfCanvasManager = CanvasManager.getCanvasManager(); + CompositionPage.changeComponentVersion(vfCanvasManager, cpElement, "1.0"); + + //verfication + VfVerificator.verifyInstanceVersion(pnfMetaData, getUser(), atomicResourceMetaData.getName(), "1.0"); + } + + finally{ + ResourceRestUtils.deleteResourceByNameAndVersion(atomicResourceMetaData.getName(), "1.0"); + } + + } + + @Test + public void verifyToscaArtifactsExistPNFTest() throws Exception{ + ResourceReqDetails pnfMetaData = createPNFWithGenerateName(); + + final int numOfToscaArtifacts = 2; + ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen(); + AssertJUnit.assertTrue(ToscaArtifactsPage.checkElementsCountInTable(numOfToscaArtifacts)); + + for(int i = 0; i < numOfToscaArtifacts; i++){ + String typeFromScreen = ToscaArtifactsPage.getArtifactType(i); + AssertJUnit.assertTrue(typeFromScreen.equals(ArtifactTypeEnum.TOSCA_CSAR.getType()) || typeFromScreen.equals(ArtifactTypeEnum.TOSCA_TEMPLATE.getType())); + } + + ToscaArtifactsPage.clickSubmitForTestingButton(pnfMetaData.getName()); + VfVerificator.verifyToscaArtifactsInfo(pnfMetaData, getUser()); + } + + @Test + public void pnfCertificationTest() throws Exception{ + ResourceReqDetails pnfMetaData = createPNFWithGenerateName(); + + String vfName = pnfMetaData.getName(); + + ResourceGeneralPage.clickCheckinButton(vfName); + GeneralUIUtils.findComponentAndClick(vfName); + ResourceGeneralPage.clickSubmitForTestingButton(vfName); + + reloginWithNewRole(UserRoleEnum.TESTER); + GeneralUIUtils.findComponentAndClick(vfName); + TesterOperationPage.certifyComponent(vfName); + + pnfMetaData.setVersion("1.0"); + VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.CERTIFIED); + + reloginWithNewRole(UserRoleEnum.DESIGNER); + GeneralUIUtils.findComponentAndClick(vfName); + VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CERTIFIED); + } + + @Test + public void deletePNFCheckedoutTest() throws Exception{ + ResourceReqDetails pnfMetaData = createPNFWithGenerateName(); + + GeneralPageElements.clickTrashButtonAndConfirm(); + + pnfMetaData.setVersion("0.1"); + VfVerificator.verifyVfDeleted(pnfMetaData, getUser()); + } + + @Test + public void revertPNFMetadataTest() throws Exception{ + ResourceReqDetails pnfMetaData = createPNFWithGenerateName(); + + ResourceReqDetails pvfRevertDetails = new ResourceReqDetails(); + pvfRevertDetails.setName("ciUpdatedName"); + pvfRevertDetails.setDescription("kuku"); + pvfRevertDetails.setCategories(pnfMetaData.getCategories()); + pvfRevertDetails.setVendorName("updatedVendor"); + pvfRevertDetails.setVendorRelease("updatedRelease"); + ResourceUIUtils.fillResourceGeneralInformationPage(pvfRevertDetails, getUser(), false); + + GeneralPageElements.clickRevertButton(); + + VfVerificator.verifyVFMetadataInUI(pnfMetaData); + } + + @Test + public void checkoutVfTest() throws Exception{ + ResourceReqDetails pnfMetaData = createPNFWithGenerateName(); + + ResourceGeneralPage.clickCheckinButton(pnfMetaData.getName()); + GeneralUIUtils.findComponentAndClick(pnfMetaData.getName()); + GeneralPageElements.clickCheckoutButton(); + + pnfMetaData.setVersion("0.2"); + VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT); + VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT); + + ResourceGeneralPage.clickSubmitForTestingButton(pnfMetaData.getName()); + + reloginWithNewRole(UserRoleEnum.TESTER); + GeneralUIUtils.findComponentAndClick(pnfMetaData.getName()); + TesterOperationPage.certifyComponent(pnfMetaData.getName()); + + reloginWithNewRole(UserRoleEnum.DESIGNER); + GeneralUIUtils.findComponentAndClick(pnfMetaData.getName()); + ResourceGeneralPage.clickCheckoutButton(); + + pnfMetaData.setVersion("1.1"); + pnfMetaData.setUniqueId(null); + VfVerificator.verifyVFLifecycle(pnfMetaData, getUser(), LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT); + VfVerificator.verifyVfLifecycleInUI(LifeCycleStateEnum.CHECKOUT); + } + + public ResourceReqDetails createPNFWithGenerateName() throws Exception { + ResourceReqDetails pnfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.PNF, getUser()); + ResourceUIUtils.createPNF(pnfMetaData, getUser()); + return pnfMetaData; + } + + @Override + protected UserRoleEnum getRole() { + return UserRoleEnum.DESIGNER; + } + +} diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java index 339f9290e8..54656d8b9b 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Service.java @@ -188,7 +188,7 @@ public class Service extends SetupCDTest { public void submitServiceForTestingWithNonCertifiedAsset() throws Exception{ ResourceReqDetails atomicResourceMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser()); - ResourceUIUtils.createResource(atomicResourceMetaData, getUser()); + ResourceUIUtils.createVF(atomicResourceMetaData, getUser()); ResourceGeneralPage.clickSubmitForTestingButton(atomicResourceMetaData.getName()); ServiceReqDetails serviceMetadata = ElementFactory.getDefaultService(); @@ -496,7 +496,7 @@ public class Service extends SetupCDTest { public CanvasElement createServiceWithRiArtifact(ResourceReqDetails atomicResourceMetaData, ServiceReqDetails serviceMetadata, ArtifactInfo artifact) throws Exception, AWTException { - ResourceUIUtils.createResource(atomicResourceMetaData, getUser()); + ResourceUIUtils.createVF(atomicResourceMetaData, getUser()); ResourceGeneralPage.clickSubmitForTestingButton(atomicResourceMetaData.getName()); ServiceUIUtils.createService(serviceMetadata, getUser()); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidation.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidation.java deleted file mode 100644 index 293547f392..0000000000 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidation.java +++ /dev/null @@ -1,77 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * SDC - * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. - * ================================================================================ - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ============LICENSE_END========================================================= - */ - -package org.openecomp.sdc.ci.tests.execute.sanity; - -import java.util.HashMap; -import java.util.Map; - -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; - -public class ToscaValidation{ - - - @BeforeClass - public void precondition(){ - - Map<String, Map<String, Object>> expected = new HashMap<String, Map<String, Object>>(); - - //import amdocs VNF and download csar - - //parse downloaded csar and add it to expected object - - //create VF base on VNF imported from previous step - declare all inputs - - //certify VF and download csar - - //parse downloaded csar and add it to expected object - - //create service add VF - declare all inputs - - //certify service and download csar - - //parse downloaded csar and add it to expected object - - - } - - @Test - public void validateMetaData(){ - - - - - } - - @Test - public void validatePropertiesInputs(){ - - - - } - - - - - - - -} diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java new file mode 100644 index 0000000000..d70f5e8d5d --- /dev/null +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/ToscaValidationTest.java @@ -0,0 +1,334 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.ci.tests.execute.sanity; + +import java.io.File; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.junit.Rule; +import org.junit.rules.TemporaryFolder; +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.ComponentInstance; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.Service; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders; +import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; +import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; +import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject; +import org.openecomp.sdc.ci.tests.datatypes.enums.LifeCycleStatesEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; +import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; +import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest; +import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition; +import org.openecomp.sdc.ci.tests.tosca.model.ToscaMetadataFieldsPresentationEnum; +import org.openecomp.sdc.ci.tests.utilities.DownloadManager; +import org.openecomp.sdc.ci.tests.utilities.FileHandling; +import org.openecomp.sdc.ci.tests.utilities.OnboardingUtillViaApis; +import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils; +import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; +import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; +import org.openecomp.sdc.ci.tests.verificator.ToscaValidation; +import org.openecomp.sdc.tosca.parser.api.ISdcCsarHelper; +import org.openecomp.sdc.tosca.parser.exceptions.SdcToscaParserException; +import org.openecomp.sdc.tosca.parser.impl.SdcToscaParserFactory; +import org.openecomp.sdc.toscaparser.api.NodeTemplate; +import org.openecomp.sdc.toscaparser.api.elements.Metadata; +import org.testng.Assert; +import org.testng.annotations.BeforeClass; +import org.testng.annotations.Test; + +import com.aventstack.extentreports.Status; +import com.clearspring.analytics.util.Pair; + +import fj.data.Either; + + +public class ToscaValidationTest extends SetupCDTest{ + + ToscaDefinition toscaMainAmdocsDefinition, toscaMainVfDefinition, toscaMainServiceDefinition; + protected String vnfFile; + protected String filepath; + protected File filesFolder; + protected SdcToscaParserFactory factory = SdcToscaParserFactory.getInstance(); + protected ISdcCsarHelper fdntCsarHelper; + protected ResourceReqDetails resourceReqDetails; + protected Resource resource; + protected ServiceReqDetails serviceReqDetails; + protected Service service; + protected ComponentInstance componentInstanceDefinition; + User user = ElementFactory.getDefaultUser(UserRoleEnum.DESIGNER); + File importToscaFilesFolder = new File("C:/Git_work/sdc/catalog-be/src/main/resources/import/tosca/"); + + File dataTypesLocation = new File(importToscaFilesFolder.getPath() + "/data-types/dataTypes.yml"); + + File genericVfFileLocation = new File(importToscaFilesFolder.getPath() + "/heat-types/Generic_VF/Generic_VF.yml"); + File genericVfcFileLocation = new File (importToscaFilesFolder.getPath() + "/heat-types/Generic_VFC/Generic_VFC.yml"); + File genericPnfFileLocation = new File (importToscaFilesFolder.getPath() + "/heat-types/Generic_PNF/Generic_PNF.yml"); + File genericServiceFileLocation = new File (importToscaFilesFolder.getPath() + "/heat-types/Generic_Service/Generic_Service.yml"); + +// Map<String, DataTypeDefinition> parseDataTypesYaml = FileHandling.parseDataTypesYaml(dataTypesLocation.getAbsoluteFile().toString()); + +// toscaMainAmdocsDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + amdocsCsarFileName)); +// toscaMainVfDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + VfCsarFileName)); +// toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + serviceCsarFileName)); +// ToscaTopologyTemplateDefinition topologyTemplate = toscaMainAmdocsDefinition.getTopology_template(); +// ToscaDefinition objectHelper = ToscaParserUtils.parseToscaYamlToJavaObject(genericVfFileLocation); + + + public ToscaValidationTest(String filepath, String vnfFile) { + this.filepath = filepath; + this.vnfFile = vnfFile; + } + + + @BeforeClass + + public void precondition() throws Exception{ +//--------------------------GENERAL-------------------------------- + setLog(vnfFile); + filesFolder = new File(SetupCDTest.getWindowTest().getDownloadDirectory()); +//--------------------------AMDOCS-------------------------------- + Pair<String, VendorSoftwareProductObject> createVendorSoftwareProduct = OnboardingUtillViaApis.createVspViaApis(filepath, vnfFile, user); + VendorSoftwareProductObject vendorSoftwareProductObject = createVendorSoftwareProduct.right; + vendorSoftwareProductObject.setVspName(createVendorSoftwareProduct.left); + DownloadManager.downloadCsarByNameFromVSPRepository(vendorSoftwareProductObject.getVspName(), vendorSoftwareProductObject.getVspId(), false); + File amdocsCsarFileName = FileHandling.getLastModifiedFileNameFromDir(filesFolder.getAbsolutePath()); + toscaMainAmdocsDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(amdocsCsarFileName); + +//TODO--------------------------AMDOCS DOWNLOAD VIA APIS-------------------------------- + +//--------------------------VF-------------------------------- +// create VF base on VNF imported from previous step - have, resourceReqDetails object include part of resource metadata + resourceReqDetails = OnboardingUtillViaApis.prepareOnboardedResourceDetailsBeforeCreate(vendorSoftwareProductObject, vendorSoftwareProductObject.getVspName()); + resource = OnboardingUtillViaApis.createResourceFromVSP(resourceReqDetails, vendorSoftwareProductObject.getVspName()); + resource = (Resource) AtomicOperationUtils.changeComponentState(resource, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft(); + File VfCsarFileName = new File(File.separator + "VfCsar_" + ElementFactory.generateUUIDforSufix() + ".csar"); + OnboardingUtillViaApis.downloadToscaCsarToDirectory(resource, new File(filesFolder.getPath() + VfCsarFileName)); + toscaMainVfDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + VfCsarFileName)); + +//--------------------------SERVICE-------------------------------- + serviceReqDetails = OnboardingUtillViaApis.prepareServiceDetailsBeforeCreate(user); + service = AtomicOperationUtils.createCustomService(serviceReqDetails, UserRoleEnum.DESIGNER, true).left().value(); + + Either<ComponentInstance, RestResponse> addComponentInstanceToComponentContainer = AtomicOperationUtils.addComponentInstanceToComponentContainer(resource, service, UserRoleEnum.DESIGNER, true); + componentInstanceDefinition = addComponentInstanceToComponentContainer.left().value(); +// TODO declare all VFi inputs + add all generic + service = (Service) AtomicOperationUtils.changeComponentState(service, UserRoleEnum.DESIGNER, LifeCycleStatesEnum.CERTIFY, true).getLeft(); + File ServiceCsarFileName = new File(File.separator + "ServiceCsar_" + ElementFactory.generateUUIDforSufix() + ".csar"); + OnboardingUtillViaApis.downloadToscaCsarToDirectory(service, new File(filesFolder.getPath() + ServiceCsarFileName)); + toscaMainServiceDefinition = ToscaParserUtils.parseToscaMainYamlToJavaObjectByCsarLocation(new File(filesFolder.getPath() + ServiceCsarFileName)); + +//--------------------------verification against Pavel Parser-------------------------------- + + SetupCDTest.getExtendTest().log(Status.INFO, "Tosca parser is going to convert service csar file to ISdcCsarHelper object..."); + fdntCsarHelper = factory.getSdcCsarHelper(filesFolder.getPath() + ServiceCsarFileName); + + } + + + //--------------------------Metadata verification-------------------------------- +//--------------------------Resource-------------------------------- + + @Test() + public void validateVfMetadata() throws Exception{ + setLog(vnfFile); + SetupCDTest.getExtendTest().log(Status.INFO, "validateVfMetadata " + vnfFile); + //add resource metadata to expected object + toscaMainAmdocsDefinition = addAndGenerateResourceMetadataToExpectedObject(toscaMainAmdocsDefinition, resourceReqDetails, resource); + Either<Boolean,Map<String,Object>> resourceToscaMetadataValidator = ToscaValidation.resourceToscaMetadataValidator(toscaMainAmdocsDefinition, toscaMainVfDefinition); + Assert.assertFalse(!resourceToscaMetadataValidator.left().value().equals(true), "Found error/s on Vf metadata verification"); + + } + + @Test() + public void validateResourceNodeTemplateMetadata() throws Exception{ + setLog(vnfFile); + SetupCDTest.getExtendTest().log(Status.INFO, "validateResourceNodeTemplateMetadata " + vnfFile); + Map<String, Map<String, String>> generateReosurceNodeTemplateMetadataToExpectedObject = generateResourceNodeTemplateMetadataToExpectedObject(resource); + Boolean resourceToscaMetadataValidator = ToscaValidation.resourceToscaNodeTemplateMetadataValidator(generateReosurceNodeTemplateMetadataToExpectedObject, toscaMainVfDefinition); + Assert.assertFalse(!resourceToscaMetadataValidator.equals(true), "Found error/s on Resource Node Template metadata verification"); + } + +//--------------------------Service-------------------------------- + @Test() + public void validateServiceMetadata() throws Exception{ + setLog(vnfFile); + SetupCDTest.getExtendTest().log(Status.INFO, "validateServiceMetadata " + vnfFile); + Map<String, String> generateServiceMetadataToExpectedObject = generateServiceMetadataToExpectedObject(serviceReqDetails, service); + Either<Boolean,Map<String, Object>> serviceToscaMetadataValidator = ToscaValidation.serviceToscaMetadataValidator(generateServiceMetadataToExpectedObject, toscaMainServiceDefinition); + Assert.assertFalse(!serviceToscaMetadataValidator.left().value().equals(true), "Found error/s on Service metadata verification"); + } + + + @Test() + public void validateServiceNodeTemplateMetadata() throws Exception{ + setLog(vnfFile); + SetupCDTest.getExtendTest().log(Status.INFO, "validateServiceNodeTemplateMetadata " + vnfFile); + Map<String, String> generateServiceNodeTemplateMetadataToExpectedObject = generateServiceNodeTemplateMetadataToExpectedObject(resourceReqDetails, resource, componentInstanceDefinition); + Either<Boolean,Map<String, Object>> serviceToscaMetadataValidator = ToscaValidation.componentToscaNodeTemplateMetadataValidator(generateServiceNodeTemplateMetadataToExpectedObject, toscaMainServiceDefinition, componentInstanceDefinition.getName(), ComponentTypeEnum.SERVICE); + Assert.assertFalse(!serviceToscaMetadataValidator.left().value().equals(true), "Found error/s on Service Node Template metadata verification"); + } + +//--------------------------Service verification against Pavel Parser-------------------------------- + @Test() + public void validateServiceMetadataUsingParser() throws Exception{ + setLog(vnfFile); + SetupCDTest.getExtendTest().log(Status.INFO, "validateServiceMetadataUsingParser " + vnfFile); + Map<String, String> generateServiceMetadataToExpectedObject = generateServiceMetadataToExpectedObject(serviceReqDetails, service); + Metadata serviceMetadata = fdntCsarHelper.getServiceMetadata(); + Either<Boolean,Map<String, Object>> serviceToscaMetadataValidatorAgainstParser = ToscaValidation.serviceToscaMetadataValidatorAgainstParser(generateServiceMetadataToExpectedObject, serviceMetadata); + Assert.assertFalse(!serviceToscaMetadataValidatorAgainstParser.left().value().equals(true), "Found error/s on Service metadata verification"); + } + + @Test() + public void validateServiceNodeTemplateMetadataUsingParser() throws Exception{ + setLog(vnfFile); + SetupCDTest.getExtendTest().log(Status.INFO, "validateServiceMetadataUsingParser " + vnfFile); + Map<String, String> generateServiceNodeTemplateMetadataToExpectedObject = generateServiceNodeTemplateMetadataToExpectedObject(resourceReqDetails, resource, componentInstanceDefinition); + List<NodeTemplate> serviceNodeTemplates = fdntCsarHelper.getServiceNodeTemplates(); + Metadata serviceNodeTemplateMetadata = serviceNodeTemplates.get(0).getMetaData(); + Either<Boolean,Map<String, Object>> serviceNodeTemplateToscaMetadataValidatorAgainstParser = ToscaValidation.serviceToscaMetadataValidatorAgainstParser(generateServiceNodeTemplateMetadataToExpectedObject, serviceNodeTemplateMetadata); + Assert.assertFalse(!serviceNodeTemplateToscaMetadataValidatorAgainstParser.left().value().equals(true), "Found error/s on Service metadata verification"); + } + + + + //--------------------------Input verification-------------------------------- + + //--------------------------Resource-------------------------------- + + + //--------------------------Service-------------------------------- + + + //--------------------------Service verification against Pavel Parser-------------------------------- + + + + + + + + + + @Override + protected UserRoleEnum getRole() { + return UserRoleEnum.DESIGNER; + } + + + + + public static ToscaDefinition addAndGenerateResourceMetadataToExpectedObject(ToscaDefinition toscaDefinition, ResourceReqDetails resourceReqDetails, Component component) { + + Map<String, String> metadata = convertResourceMetadataToMap(resourceReqDetails, component); + toscaDefinition.setMetadata(metadata); + return toscaDefinition; + } + + + public static Map<String, String> convertResourceMetadataToMap(ResourceReqDetails resourceReqDetails, Component component) { + Map<String, String> metadata = new HashMap<>(); + + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CATEGORY.value, resourceReqDetails.getCategories().get(0).getName()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.DESCRIPTION.value, resourceReqDetails.getDescription()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.INVARIANT_UUID.value, component.getInvariantUUID()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.TYPE.value, "VF"); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.UUID.value, component.getUUID()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAME.value, component.getName()); + + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_NAME.value, resourceReqDetails.getVendorName()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_MODEL_NUMBER.value, resourceReqDetails.getResourceVendorModelNumber()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_RELEASE.value, resourceReqDetails.getVendorRelease()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SUBCATEGORY.value, resourceReqDetails.getCategories().get(0).getSubcategories().get(0).getName()); + return metadata; + } + + public static Map<String, String> convertResourceNodeTemplateMetadataToMap(ComponentInstance componentInstance) throws Exception{ + + Resource resource = AtomicOperationUtils.getResourceObject(componentInstance.getComponentUid()); + Map<String, String> metadata = new HashMap<>(); + + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CATEGORY.value, resource.getCategories().get(0).getName()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.DESCRIPTION.value, resource.getDescription()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.INVARIANT_UUID.value, resource.getInvariantUUID()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.TYPE.value, resource.getResourceType().toString()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.UUID.value, resource.getUUID()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAME.value, resource.getName()); + + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_NAME.value, resource.getVendorName()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_MODEL_NUMBER.value, resource.getResourceVendorModelNumber()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.RESOURCE_VENDOR_RELEASE.value, resource.getVendorRelease()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SUBCATEGORY.value, resource.getCategories().get(0).getSubcategories().get(0).getName()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CUSTOMIZATION_UUID.value, componentInstance.getCustomizationUUID()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.VERSION.value, componentInstance.getComponentVersion()); + + return metadata; + + } + public static Map<String, String> generateServiceNodeTemplateMetadataToExpectedObject(ResourceReqDetails resourceReqDetails, Component component, ComponentInstance componentInstanceDefinition) { + + Map<String, String> metadata = convertResourceMetadataToMap(resourceReqDetails, component); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CUSTOMIZATION_UUID.value, componentInstanceDefinition.getCustomizationUUID()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.VERSION.value, componentInstanceDefinition.getComponentVersion()); + + return metadata; + } + + public static Map<String, Map<String, String>> generateResourceNodeTemplateMetadataToExpectedObject(Component component) throws Exception { + + Map<String, Map<String, String>> resourcesNodeTemplateMetadataMap = new HashMap<>(); + if(component.getComponentInstances() != null && component.getComponentInstances().size() != 0){ + for (ComponentInstance componentInstance:component.getComponentInstances()){ + Map<String, String> metadata = convertResourceNodeTemplateMetadataToMap(componentInstance); + resourcesNodeTemplateMetadataMap.put(componentInstance.getName(), metadata); + } + } + return resourcesNodeTemplateMetadataMap; + } + + public static Map<String, String> generateServiceMetadataToExpectedObject(ServiceReqDetails serviceReqDetails, Component component) { + + Map<String, String> metadata = new HashMap<>(); + + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.CATEGORY.value, serviceReqDetails.getCategories().get(0).getName()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.DESCRIPTION.value, serviceReqDetails.getDescription()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.INVARIANT_UUID.value, component.getInvariantUUID()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.TYPE.value, "Service"); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.UUID.value, component.getUUID()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAME.value, component.getName()); + + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SERVICE_TYPE.value, serviceReqDetails.getServiceType()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SERVICE_ROLE.value, serviceReqDetails.getServiceRole()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.NAMING_POLICY.value, serviceReqDetails.getNamingPolicy()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.ECOMP_GENERATED_NAMING.value, serviceReqDetails.getEcompGeneratedNaming().toString()); + metadata.put(ToscaMetadataFieldsPresentationEnum.ToscaMetadataFieldsEnum.SERVICE_ECOMP_NAMING.value, serviceReqDetails.getEcompGeneratedNaming().toString());//equals to ECOMP_GENERATED_NAMING + + return metadata; + } + + + +} diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java index 8763d677dd..730cc1ce56 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/Vf.java @@ -107,7 +107,7 @@ public class Vf extends SetupCDTest { // create Resource ResourceReqDetails resourceMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(resourceMetaData, getUser()); + ResourceUIUtils.createVF(resourceMetaData, getUser()); // update Resource ResourceReqDetails updatedResource = new ResourceReqDetails(); @@ -144,7 +144,7 @@ public class Vf extends SetupCDTest { reloginWithNewRole(UserRoleEnum.DESIGNER); ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen(); CanvasManager canvasManager = CanvasManager.getCanvasManager(); @@ -168,7 +168,7 @@ public class Vf extends SetupCDTest { @Test public void addUpdateDeleteDeploymentArtifactToVfTest() throws Exception { ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); @@ -199,7 +199,7 @@ public class Vf extends SetupCDTest { @Test public void addUpdateDeleteInformationalArtifact() throws Exception { ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen(); @@ -233,7 +233,7 @@ public class Vf extends SetupCDTest { ResourceGeneralPage.clickCheckinButton(atomicResourceMetaData.getName()); ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); CanvasManager vfCanvasManager = CanvasManager.getCanvasManager(); @@ -274,7 +274,7 @@ public class Vf extends SetupCDTest { ResourceGeneralPage.clickSubmitForTestingButton(atomicResourceMetaData.getName()); vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); vfCanvasManager = CanvasManager.getCanvasManager(); CompositionPage.searchForElement(atomicResourceMetaData.getName()); @@ -314,7 +314,7 @@ public class Vf extends SetupCDTest { @Test(enabled = false) public void addUpdateDeleteSimplePropertiesToVfTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToPropertiesScreen(); List<PropertyTypeEnum> propertyList = Arrays.asList(PropertyTypeEnum.STRING, PropertyTypeEnum.INTEGER); @@ -340,7 +340,7 @@ public class Vf extends SetupCDTest { @Test(enabled = false) public void vfcInstancesInputScreenTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); CanvasManager vfCanvasManager = CanvasManager.getCanvasManager(); @@ -380,7 +380,7 @@ public class Vf extends SetupCDTest { public void addAllInformationalArtifactPlaceholdersInVfTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByTypeNormTypeAndCatregory(ResourceTypeEnum.VF, NormativeTypesEnum.ROOT, ResourceCategoryEnum.NETWORK_L2_3_ROUTERS, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToInformationalArtifactScreen(); @@ -394,7 +394,7 @@ public class Vf extends SetupCDTest { @Test public void verifyToscaArtifactsExist() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); final int numOfToscaArtifacts = 2; ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen(); @@ -429,7 +429,7 @@ public class Vf extends SetupCDTest { @Test public void vfCertificationTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); String vfName = vfMetaData.getName(); @@ -452,7 +452,7 @@ public class Vf extends SetupCDTest { @Test public void deleteVfCheckedoutTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); GeneralPageElements.clickTrashButtonAndConfirm(); @@ -463,7 +463,7 @@ public class Vf extends SetupCDTest { @Test public void revertVfMetadataTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceReqDetails vfRevertDetails = new ResourceReqDetails(); vfRevertDetails.setName("ciUpdatedName"); @@ -482,7 +482,7 @@ public class Vf extends SetupCDTest { @Test public void addDeploymentArtifactInCompositionScreenTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); @@ -499,7 +499,7 @@ public class Vf extends SetupCDTest { @Test(enabled = false) public void addPropertyInCompositionScreenTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); @@ -515,7 +515,7 @@ public class Vf extends SetupCDTest { @Test public void addDeploymentArtifactAndVerifyInCompositionScreen() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToDeploymentArtifactScreen(); @@ -537,7 +537,7 @@ public class Vf extends SetupCDTest { @Test public void checkoutVfTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.clickCheckinButton(vfMetaData.getName()); GeneralUIUtils.findComponentAndClick(vfMetaData.getName()); @@ -566,7 +566,7 @@ public class Vf extends SetupCDTest { @Test public void deleteInstanceFromVfCanvas() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); CanvasManager vfCanvasManager = CanvasManager.getCanvasManager(); @@ -582,7 +582,7 @@ public class Vf extends SetupCDTest { @Test public void changeInstanceNameInVfTest() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.getLeftMenu().moveToCompositionScreen(); CanvasManager vfCanvasManager = CanvasManager.getCanvasManager(); @@ -605,7 +605,7 @@ public class Vf extends SetupCDTest { ResourceGeneralPage.clickSubmitForTestingButton(atomicResourceMetaData.getName()); ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); DeploymentArtifactPage.getLeftMenu().moveToCompositionScreen(); CanvasManager canvasManager = CanvasManager.getCanvasManager(); CompositionPage.searchForElement(atomicResourceMetaData.getName()); @@ -628,7 +628,7 @@ public class Vf extends SetupCDTest { @Test public void isDisabledAndReadOnlyInCheckin() throws Exception{ ResourceReqDetails vfMetaData = ElementFactory.getDefaultResourceByType(ResourceTypeEnum.VF, getUser()); - ResourceUIUtils.createResource(vfMetaData, getUser()); + ResourceUIUtils.createVF(vfMetaData, getUser()); ResourceGeneralPage.clickCheckinButton(vfMetaData.getName()); GeneralUIUtils.findComponentAndClick(vfMetaData.getName()); @@ -660,7 +660,7 @@ public class Vf extends SetupCDTest { OnboardingUtils.onboardAndValidate(FileHandling.getVnfRepositoryPath(), vnfFile, getUser()); ResourceGeneralPage.getLeftMenu().moveToToscaArtifactsScreen(); GeneralUIUtils.clickOnElementByTestId(ToscaArtifactsScreenEnum.TOSCA_MODEL.getValue()); - File latestFilefromDir = FileHandling.getLastModifiedFileFromDir(); + File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); ToscaDefinition toscaDefinition = VfModuleVerificator.getToscaTemplate(latestFilefromDir.getAbsolutePath()); VfModuleVerificator.validateSpecificModulePropertiesFromFile(toscaDefinition); } diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java index 86e81df0bb..2faeedc15b 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/sanity/VfArtifacts.java @@ -194,7 +194,7 @@ public class VfArtifacts extends SetupCDTest{ if (DeploymentArtifactPage.getArtifactType(deploymentArtifcatsList.get(i)).equalsIgnoreCase(ArtifactTypeEnum.HEAT.getType())) { DeploymentArtifactPage.clickDownloadEnvArtifact(deploymentArtifcatsList.get(i)); GeneralUIUtils.ultimateWait(); - File latestFilefromDir = FileHandling.getLastModifiedFileFromDir(downloadDirPath); + File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(downloadDirPath); ArtifactUIUtils.compareYamlFilesByPattern(latestFilefromDir, currentZipEnvfiles.get(deploymentArtifcatsList.get(i)), PARAMETERS); } } @@ -218,7 +218,7 @@ public class VfArtifacts extends SetupCDTest{ if (DeploymentArtifactPage.getArtifactType(deploymentArtifcatsList.get(i)).equalsIgnoreCase(ArtifactTypeEnum.HEAT.getType())) { DeploymentArtifactPage.clickDownloadEnvArtifact(deploymentArtifcatsList.get(i)); GeneralUIUtils.ultimateWait(); - File latestFilefromDir = FileHandling.getLastModifiedFileFromDir(downloadDirPath); + File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(downloadDirPath); ArtifactUIUtils.compareYamlFilesByPattern(latestFilefromDir,currentZipEnvfiles.get(deploymentArtifcatsList.get(i)), PARAMETERS); } } @@ -243,7 +243,7 @@ public class VfArtifacts extends SetupCDTest{ if (GeneralUIUtils.isElementVisibleByTestId(GeneralUIUtils.getDataTestIdAttributeValue(deploymentArtifcatsList.get(i)))) { CompositionPage.clickDownloadEnvArtifactComposition(fileName).click(); GeneralUIUtils.ultimateWait(); - File latestFilefromDir = FileHandling.getLastModifiedFileFromDir(downloadDirPath); + File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(downloadDirPath); ArtifactUIUtils.compareYamlFilesByPattern(latestFilefromDir,currentZipEnvfiles.get(fileName), PARAMETERS); } } @@ -290,7 +290,7 @@ public class VfArtifacts extends SetupCDTest{ for (HeatParameterDataDefinition param : heatEnvUpdatedParameters.get(i).getHeatParameterDefinition()) { mapExpectedProperties.put(param.getName(), ArtifactUIUtils.getValue(param)); } - ArtifactUIUtils.compareYamlParametersByPattern(mapExpectedProperties, FileHandling.getLastModifiedFileFromDir(downloadDirPath), PARAMETERS); + ArtifactUIUtils.compareYamlParametersByPattern(mapExpectedProperties, FileHandling.getLastModifiedFileNameFromDir(downloadDirPath), PARAMETERS); } } } @@ -306,7 +306,7 @@ public class VfArtifacts extends SetupCDTest{ GeneralUIUtils.moveToStep(StepsEnum.DEPLOYMENT_ARTIFACT); for(Entry<String, File> envFileEntry : generatedEnvFileList.entrySet()){ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue()+envFileEntry.getKey()); - ArtifactUIUtils.compareYamlFilesByPattern(envFileEntry.getValue(), FileHandling.getLastModifiedFileFromDir(), PARAMETERS); + ArtifactUIUtils.compareYamlFilesByPattern(envFileEntry.getValue(), FileHandling.getLastModifiedFileNameFromDir(), PARAMETERS); if(true){ throw new SkipException("Test skipped, new artifact version design should be developed"); } @@ -331,7 +331,7 @@ public class VfArtifacts extends SetupCDTest{ for(Entry<String, File> envFileEntry : generatedUpdatedEnvFileList.entrySet()){ // TODO test will pass on case all objects on deployment view are visible GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue()+envFileEntry.getKey()); - ArtifactUIUtils.compareYamlFilesByPattern(envFileEntry.getValue(), FileHandling.getLastModifiedFileFromDir(), PARAMETERS); + ArtifactUIUtils.compareYamlFilesByPattern(envFileEntry.getValue(), FileHandling.getLastModifiedFileNameFromDir(), PARAMETERS); if(true){ throw new SkipException("Test skipped, new artifact version design should be developed"); } @@ -357,7 +357,7 @@ public class VfArtifacts extends SetupCDTest{ GeneralUIUtils.moveToStep(StepsEnum.DEPLOYMENT_ARTIFACT); for(Entry<String, File> envFileEntry : generatedUpdatedSecondTimeEnvFileList.entrySet()){ GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue()+envFileEntry.getKey()); - ArtifactUIUtils.compareYamlFilesByPattern(envFileEntry.getValue(), FileHandling.getLastModifiedFileFromDir(), PARAMETERS); + ArtifactUIUtils.compareYamlFilesByPattern(envFileEntry.getValue(), FileHandling.getLastModifiedFileNameFromDir(), PARAMETERS); if(true){ throw new SkipException("Test skipped, new artifact version design should be developed"); } diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java index 10ae6cba7a..21aa5720a0 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/execute/setup/SetupCDTest.java @@ -159,7 +159,8 @@ public abstract class SetupCDTest extends DriverFactory { public void setBrowserBeforeTest(java.lang.reflect.Method method, ITestContext context) throws Exception { boolean emptyDataProvider = method.getAnnotation(Test.class).dataProvider().isEmpty(); - if (emptyDataProvider) { + String className = method.getDeclaringClass().getName(); + if (emptyDataProvider && !className.contains("ToscaValidationTest") ) { System.out.println("ExtentReport instance started from BeforeMethod..."); String suiteName = ExtentManager.getSuiteName(context); if (suiteName.equals(suiteNameXml.TESTNG_FAILED_XML_NAME.getValue())) { diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java index 9caeee8f9f..ae86923396 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/pages/HomePage.java @@ -104,7 +104,7 @@ public class HomePage extends GeneralPageElements { public static File downloadVspCsarToDefaultDirectory(String vspName) throws Exception { GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.MainMenuButtonsFromInsideFrame.HOME_BUTTON.getValue()).click(); DownloadManager.downloadCsarByNameFromVSPRepository(vspName, ""); - File latestFilefromDir = FileHandling.getLastModifiedFileFromDir(); + File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); return latestFilefromDir; } diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java index c06a51ce91..1abae858e3 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ArtifactUIUtils.java @@ -478,7 +478,7 @@ public final class ArtifactUIUtils { String heatDisplayName = pairToUpdate.getHeatArtifactDisplayName(); GeneralUIUtils.clickOnElementByTestId(DataTestIdEnum.ArtifactPageEnum.DOWNLOAD_ARTIFACT_ENV.getValue()+heatDisplayName); - File latestFilefromDir = FileHandling.getLastModifiedFileFromDir(); + File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); String pattern = PARAMETERS; Map<String, Object> mapUpdetedEnvFile = FileHandling.parseYamlFileToMapByPattern(updateEnvFile, pattern); diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java index ceada39b04..f4264ffdea 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/DownloadManager.java @@ -68,8 +68,11 @@ public class DownloadManager { * @param vspName * @throws Exception */ - public static void downloadCsarByNameFromVSPRepository(String vspName, String vspId) throws Exception{ - FileHandling.cleanCurrentDownloadDir(); + public static void downloadCsarByNameFromVSPRepository(String vspName, String vspId, Boolean isDelete) throws Exception{ + + if(isDelete){ + FileHandling.cleanCurrentDownloadDir(); + } HomePage.showVspRepository(); boolean vspFound = HomePage.searchForVSP(vspName); if (vspFound){ @@ -88,6 +91,10 @@ public class DownloadManager { } } + public static void downloadCsarByNameFromVSPRepository(String vspName, String vspId) throws Exception{ + downloadCsarByNameFromVSPRepository(vspName, vspId, true); + } + // AttFtpClient instance = AttFtpClient.getInstance(); // // String server = "localhost"; diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java index 4fe1938af8..8c2556d00a 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/FileHandling.java @@ -264,11 +264,19 @@ public class FileHandling { } - public static synchronized File getLastModifiedFileFromDir() throws Exception{ - return getLastModifiedFileFromDir(SetupCDTest.getWindowTest().getDownloadDirectory()); + /** + * @return last modified file name from default directory + * @throws Exception + */ + public static synchronized File getLastModifiedFileNameFromDir() throws Exception{ + return getLastModifiedFileNameFromDir(SetupCDTest.getWindowTest().getDownloadDirectory()); } - public static synchronized File getLastModifiedFileFromDir(String dirPath){ + /** + * @param dirPath + * @return last modified file name from dirPath directory + */ + public static synchronized File getLastModifiedFileNameFromDir(String dirPath){ File dir = new File(dirPath); File[] files = dir.listFiles(); if (files == null) { @@ -397,7 +405,7 @@ public class FileHandling { public static String getMD5OfFile(File file) throws IOException { String content = FileUtils.readFileToString(file); - String md5 = GeneralUtility.calculateMD5ByString(content); + String md5 = GeneralUtility.calculateMD5Base64EncodedByString(content); return md5; } diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUtillViaApis.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUtillViaApis.java new file mode 100644 index 0000000000..6abce99acb --- /dev/null +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUtillViaApis.java @@ -0,0 +1,298 @@ +/*- + * ============LICENSE_START======================================================= + * SDC + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.openecomp.sdc.ci.tests.utilities; + +import static org.testng.AssertJUnit.assertTrue; + +import java.io.BufferedInputStream; +import java.io.BufferedOutputStream; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.bouncycastle.util.encoders.Base64; +import org.openecomp.sdc.be.model.Component; +import org.openecomp.sdc.be.model.Resource; +import org.openecomp.sdc.be.model.User; +import org.openecomp.sdc.ci.tests.api.Urls; +import org.openecomp.sdc.ci.tests.config.Config; +import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers; +import org.openecomp.sdc.ci.tests.datatypes.ResourceReqDetails; +import org.openecomp.sdc.ci.tests.datatypes.ServiceReqDetails; +import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject; +import org.openecomp.sdc.ci.tests.datatypes.enums.ResourceCategoryEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.ServiceCategoriesEnum; +import org.openecomp.sdc.ci.tests.datatypes.enums.UserRoleEnum; +import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; +import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; +import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; +import org.openecomp.sdc.ci.tests.utils.Utils; +import org.openecomp.sdc.ci.tests.utils.general.AtomicOperationUtils; +import org.openecomp.sdc.ci.tests.utils.general.ElementFactory; +import org.openecomp.sdc.ci.tests.utils.rest.BaseRestUtils; + +import com.clearspring.analytics.util.Pair; +import com.google.gson.Gson; + +import fj.data.Either; + +public class OnboardingUtillViaApis { + + protected static Map<String, String> prepareHeadersMap(String userId) { + Map<String, String> headersMap = new HashMap<String, String>(); + headersMap.put(HttpHeaderEnum.CONTENT_TYPE.getValue(), "application/json"); + headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "application/json"); + headersMap.put(HttpHeaderEnum.USER_ID.getValue(), userId); + return headersMap; + } + + public static Pair<String, VendorSoftwareProductObject> createVspViaApis(String filepath, String vnfFile, User user) throws Exception { + + VendorSoftwareProductObject vendorSoftwareProductObject = new VendorSoftwareProductObject(); + + AmdocsLicenseMembers amdocsLicenseMembers = OnboardingUtils.createVendorLicense(user); + Pair<String, Map<String, String>> createVendorSoftwareProduct = OnboardingUtils.createVendorSoftwareProduct(vnfFile, filepath, user, amdocsLicenseMembers); + Map<String, String> map = createVendorSoftwareProduct.right; + vendorSoftwareProductObject.setAttContact(map.get("attContact")); + vendorSoftwareProductObject.setCategory(map.get("category")); + vendorSoftwareProductObject.setComponentId(map.get("componentId")); + vendorSoftwareProductObject.setDescription(map.get("description")); + vendorSoftwareProductObject.setSubCategory(map.get("subCategory")); + vendorSoftwareProductObject.setVendorName(map.get("vendorName")); + vendorSoftwareProductObject.setVspId(map.get("vspId")); + Pair<String, VendorSoftwareProductObject> pair = new Pair<String, VendorSoftwareProductObject>(createVendorSoftwareProduct.left, vendorSoftwareProductObject); + return pair; + } + +/* public static Resource createResourceFromVSP(Pair<String, Map<String, String>> createVendorSoftwareProduct, String vspName) throws Exception { + List<String> tags = new ArrayList<>(); + tags.add(vspName); + Map<String, String> map = createVendorSoftwareProduct.right; + ResourceReqDetails resourceDetails = new ResourceReqDetails(); + resourceDetails.setCsarUUID(map.get("vspId")); + resourceDetails.setCsarVersion("1.0"); + resourceDetails.setName(vspName); + resourceDetails.setTags(tags); + resourceDetails.setDescription(map.get("description")); + resourceDetails.setResourceType(map.get("componentType")); + resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory()); + resourceDetails.setVendorName(map.get("vendorName")); + resourceDetails.setVendorRelease("1.0"); + resourceDetails.setResourceType("VF"); + resourceDetails.setResourceVendorModelNumber("666"); + resourceDetails.setContactId(map.get("attContact")); + resourceDetails.setIcon("defaulticon"); + Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value(); + + return resource; + }*/ + public static Resource createResourceFromVSP(ResourceReqDetails resourceDetails, String vspName) throws Exception { +// List<String> tags = new ArrayList<>(); +// tags.add(vspName); +// Map<String, String> map = createVendorSoftwareProduct.right; +// ResourceReqDetails resourceDetails = new ResourceReqDetails(); +// resourceDetails.setCsarUUID(map.get("vspId")); +// resourceDetails.setCsarVersion("1.0"); +// resourceDetails.setName(vspName); +// resourceDetails.setTags(tags); +// resourceDetails.setDescription(map.get("description")); +// resourceDetails.setResourceType(map.get("componentType")); +// resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory()); +// resourceDetails.setVendorName(map.get("vendorName")); +// resourceDetails.setVendorRelease("1.0"); +// resourceDetails.setResourceType("VF"); +// resourceDetails.setResourceVendorModelNumber("666"); +// resourceDetails.setContactId(map.get("attContact")); +// resourceDetails.setIcon("defaulticon"); + Resource resource = AtomicOperationUtils.createResourceByResourceDetails(resourceDetails, UserRoleEnum.DESIGNER, true).left().value(); + + return resource; + } + public static void downloadToscaCsarToDirectory(Component component, File file) { + try { + Either<String, RestResponse> componentToscaArtifactPayload = AtomicOperationUtils.getComponenetArtifactPayload(component, "assettoscacsar"); + if(componentToscaArtifactPayload.left().value() != null){ + convertPayloadToFile(componentToscaArtifactPayload.left().value(), file); + } + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + +// public static void convertPayloadToFile(String payload, File file, boolean isBased64, boolean isSdcFormat) throws IOException{ +// +// Gson gson = new Gson(); +// byte[] byteArray = null; +// Map<String, String> fromJson; +// @SuppressWarnings("unchecked") +// String string = null;// = fromJson.get("base64Contents").toString(); +// if(isSdcFormat){ +// fromJson = gson.fromJson(payload, Map.class); +// string = fromJson.get("base64Contents").toString(); +// }else if (isBased64) { +// byteArray = Base64.decode(string.getBytes(StandardCharsets.UTF_8)); +// }else{ +// byteArray = payload.getBytes(StandardCharsets.UTF_8); +// } +// File downloadedFile = new File(file.getAbsolutePath()); +// FileOutputStream fos = new FileOutputStream(downloadedFile); +// fos.write(byteArray); +// fos.flush(); +// fos.close(); +// +// } + + public static void convertPayloadToFile(String payload, File file) throws IOException{ + + Gson gson = new Gson(); + @SuppressWarnings("unchecked") + Map<String, String> fromJson = gson.fromJson(payload, Map.class); + String string = fromJson.get("base64Contents").toString(); + byte[] byteArray = Base64.decode(string.getBytes(StandardCharsets.UTF_8)); + File downloadedFile = new File(file.getAbsolutePath()); + FileOutputStream fos = new FileOutputStream(downloadedFile); + fos.write(byteArray); + fos.flush(); + fos.close(); + } + + + public static void convertPayloadToZipFile(String payload, File file) throws IOException{ + + byte[] byteArray = payload.getBytes(StandardCharsets.ISO_8859_1); + File downloadedFile = new File(file.getAbsolutePath()); + FileOutputStream fos = new FileOutputStream(downloadedFile); + fos.write(byteArray); + fos.flush(); + fos.close(); + + +// ZipOutputStream fos = null; +// +// +// for (Charset charset : Charset.availableCharsets().values()) { +// try{ +// // System.out.println("How to do it???"); +// File downloadedFile = new File(file.getAbsolutePath() + "_" + charset +".csar"); +// fos = new ZipOutputStream(new FileOutputStream(downloadedFile)); +// byte[] byteArray = payload.getBytes(charset); +// fos.write(byteArray); +// fos.flush(); +// +// } +// catch(Exception e){ +// fos.close(); +// } +// } + System.out.println(""); + +// ZipInputStream zipStream = new ZipInputStream(new ByteArrayInputStream(byteArray)); +// ZipEntry entry = null; +// while ((entry = zipStream.getNextEntry()) != null) { +// +// String entryName = entry.getName(); +// +// FileOutputStream out = new FileOutputStream(file+"/"+entryName); +// +// byte[] byteBuff = new byte[4096]; +// int bytesRead = 0; +// while ((bytesRead = zipStream.read(byteBuff)) != -1) +// { +// out.write(byteBuff, 0, bytesRead); +// } +// +// out.close(); +// zipStream.closeEntry(); +// } +// zipStream.close(); +// + + + + BufferedInputStream bis = new BufferedInputStream(new ByteArrayInputStream(payload.getBytes(StandardCharsets.ISO_8859_1))); + String filePath = file.toString(); + BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(new File(filePath))); + int inByte; + while((inByte = bis.read()) != -1) bos.write(inByte); + bis.close(); + bos.close(); + } + + public static Either<String, RestResponse> getVendorSoftwareProduct(String vspId, User user, Boolean validateState) throws Exception { + + Config config = Utils.getConfig(); + String url = String.format(Urls.GET_VENDOR_SOFTWARE_PRODUCT, config.getCatalogBeHost(), config.getCatalogBePort(), vspId); + String userId = user.getUserId(); + Map<String, String> headersMap = prepareHeadersMap(userId); + headersMap.put(HttpHeaderEnum.X_ECOMP_REQUEST_ID_HEADER.getValue(), "123456"); + headersMap.put(HttpHeaderEnum.ACCEPT.getValue(), "*/*"); + headersMap.put("Accept-Encoding", "gzip, deflate, br"); + HttpRequest http = new HttpRequest(); + RestResponse response = http.httpSendGet(url, headersMap); + if (validateState) { + assertTrue("add property to resource failed: " + response.getResponseMessage(), response.getErrorCode() == BaseRestUtils.STATUS_CODE_SUCCESS); + } + if (response.getErrorCode() != BaseRestUtils.STATUS_CODE_SUCCESS && response.getResponse().getBytes() == null && response.getResponse().getBytes().length == 0) { + return Either.right(response); + } + return Either.left(response.getResponse()); + + } + + public static ResourceReqDetails prepareOnboardedResourceDetailsBeforeCreate(VendorSoftwareProductObject vendorSoftwareProductObject, String vspName) { + + List<String> tags = new ArrayList<>(); + tags.add(vspName); + ResourceReqDetails resourceDetails = new ResourceReqDetails(); + resourceDetails.setCsarUUID(vendorSoftwareProductObject.getVspId()); + resourceDetails.setCsarVersion("1.0"); + resourceDetails.setName(vspName); + resourceDetails.setTags(tags); + resourceDetails.setDescription(vendorSoftwareProductObject.getDescription()); + resourceDetails.addCategoryChain(ResourceCategoryEnum.GENERIC_DATABASE.getCategory(), ResourceCategoryEnum.GENERIC_DATABASE.getSubCategory()); + resourceDetails.setVendorName(vendorSoftwareProductObject.getVendorName()); + resourceDetails.setVendorRelease("1.0"); + resourceDetails.setResourceType("VF"); + resourceDetails.setResourceVendorModelNumber("666"); + resourceDetails.setContactId(vendorSoftwareProductObject.getAttContact()); + resourceDetails.setIcon("defaulticon"); + + return resourceDetails; + } + + public static ServiceReqDetails prepareServiceDetailsBeforeCreate(User user) { + + ServiceReqDetails serviceDetails = ElementFactory.getDefaultService(ServiceCategoriesEnum.NETWORK_L4, user); + serviceDetails.setServiceType("MyServiceType"); + serviceDetails.setServiceRole("MyServiceRole"); + serviceDetails.setNamingPolicy("MyServiceNamingPolicy"); + serviceDetails.setEcompGeneratedNaming(false); + + return serviceDetails; + } +} diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUtils.java index 398e1f18db..b4f834a421 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUtils.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/OnboardingUtils.java @@ -56,6 +56,7 @@ import org.openecomp.sdc.ci.tests.datatypes.AmdocsLicenseMembers; import org.openecomp.sdc.ci.tests.datatypes.DataTestIdEnum; import org.openecomp.sdc.ci.tests.datatypes.HeatMetaFirstLevelDefinition; import org.openecomp.sdc.ci.tests.datatypes.LifeCycleStateEnum; +import org.openecomp.sdc.ci.tests.datatypes.VendorSoftwareProductObject; import org.openecomp.sdc.ci.tests.datatypes.http.HttpHeaderEnum; import org.openecomp.sdc.ci.tests.datatypes.http.HttpRequest; import org.openecomp.sdc.ci.tests.datatypes.http.RestResponse; @@ -520,21 +521,6 @@ public class OnboardingUtils { return new Pair<RestResponse, Map<String, String>>(response, vspMetadta); } -/* public static RestResponse getVendorSoftwareProduct(Map vspObject, User user) throws Exception { - Config config = Utils.getConfig(); - String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-software-products/" + vspObject.get("vspId"), - config.getCatalogBeHost(), config.getCatalogBePort()); - - String userId = user.getUserId(); - - Map<String, String> headersMap = prepareHeadersMap(userId); - HttpRequest http = new HttpRequest(); - - RestResponse response = http.httpsSendGet(url, headersMap); - - return response; - }*/ - public static RestResponse validateUpload(String vspid, User user) throws Exception { Config config = Utils.getConfig(); String url = String.format("http://%s:%s/onboarding-api/v1.0/vendor-software-products/%s/versions/0.1/orchestration-template-candidate/process", @@ -748,7 +734,7 @@ public class OnboardingUtils { String vspName = createVendorSoftwareProduct.left; DownloadManager.downloadCsarByNameFromVSPRepository(vspName, createVendorSoftwareProduct.right.get("vspId")); - File latestFilefromDir = FileHandling.getLastModifiedFileFromDir(); + File latestFilefromDir = FileHandling.getLastModifiedFileNameFromDir(); ExtentTestActions.log(Status.INFO, String.format("Searching for onboarded %s", vnfFile)); HomePage.showVspRepository(); @@ -810,19 +796,19 @@ public class OnboardingUtils { } -enum SnmpTypeEnum{ - SNMP_POLL ("snmp"), - SNMP_TRAP ("snmp-trap"); + enum SnmpTypeEnum{ + SNMP_POLL ("snmp"), + SNMP_TRAP ("snmp-trap"); + + private String value; - private String value; - - public String getValue() { - return value; - } - - private SnmpTypeEnum(String value) { - this.value = value; - } + public String getValue() { + return value; + } + private SnmpTypeEnum(String value) { + this.value = value; + } } + diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ResourceUIUtils.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ResourceUIUtils.java index c76bf4b74a..1eaa626e94 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ResourceUIUtils.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/utilities/ResourceUIUtils.java @@ -539,30 +539,41 @@ public final class ResourceUIUtils { return getCreatedResource; } + /** + * @deprecated Use {@link #createVF(ResourceReqDetails,User)} instead + */ public static void createResource(ResourceReqDetails resource, User user) throws Exception { + createVF(resource, user); + } + + public static void createVF(ResourceReqDetails resource, User user) throws Exception { ExtentTestActions.log(Status.INFO, "Going to create a new VF."); + createResource(resource, user, DataTestIdEnum.Dashboard.BUTTON_ADD_VF); + } + + public static void createResource(ResourceReqDetails resource, User user, DataTestIdEnum.Dashboard button) { WebElement addVFButton = null; try { GeneralUIUtils.ultimateWait(); try{ GeneralUIUtils.hoverOnAreaByClassName("w-sdc-dashboard-card-new"); - addVFButton = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_VF.getValue()); + addVFButton = GeneralUIUtils.getWebElementByTestID(button.getValue()); } catch (Exception e){ File imageFilePath = GeneralUIUtils.takeScreenshot(null, SetupCDTest.getScreenshotFolder(), "Warning_" + resource.getName()); final String absolutePath = new File(SetupCDTest.getReportFolder()).toURI().relativize(imageFilePath.toURI()).getPath(); - SetupCDTest.getExtendTest().log(Status.WARNING, "Add VF button is not visible after hover on import area of Home page, moving on ..." + SetupCDTest.getExtendTest().addScreenCaptureFromPath(absolutePath)); + SetupCDTest.getExtendTest().log(Status.WARNING, "Add button is not visible after hover on import area of Home page, moving on ..." + SetupCDTest.getExtendTest().addScreenCaptureFromPath(absolutePath)); showButtonsADD(); - addVFButton = GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_VF.getValue()); + addVFButton = GeneralUIUtils.getWebElementByTestID(button.getValue()); } addVFButton.click(); GeneralUIUtils.ultimateWait(); } catch (Exception e ) { - SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Exeption catched on ADD VF button, retrying ... ")); + SetupCDTest.getExtendTest().log(Status.WARNING, String.format("Exeption catched on ADD button, retrying ... ")); GeneralUIUtils.hoverOnAreaByClassName("w-sdc-dashboard-card-new"); GeneralUIUtils.ultimateWait(); - GeneralUIUtils.getWebElementByTestID(DataTestIdEnum.Dashboard.BUTTON_ADD_VF.getValue()).click(); + GeneralUIUtils.getWebElementByTestID(button.getValue()).click(); GeneralUIUtils.ultimateWait(); } fillResourceGeneralInformationPage(resource, user, true); @@ -1140,4 +1151,9 @@ public final class ResourceUIUtils { SetupCDTest.getExtendTest().log(Status.INFO, String.format("Clicking on %s %s", textToClick, customizationFoLogLocal)); GeneralUIUtils.clickOnElementByText(textToClick); } + + public static void createPNF(ResourceReqDetails resource, User user) throws Exception { + ExtentTestActions.log(Status.INFO, "Going to create a new PNF."); + createResource(resource, user, DataTestIdEnum.Dashboard.BUTTON_ADD_PNF); + } } diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java new file mode 100644 index 0000000000..5afb94fda1 --- /dev/null +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/ToscaValidation.java @@ -0,0 +1,125 @@ +package org.openecomp.sdc.ci.tests.verificator; + +import java.util.HashMap; +import java.util.Map; + +import org.openecomp.sdc.be.datatypes.enums.ComponentTypeEnum; +import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest; +import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition; +import org.openecomp.sdc.toscaparser.api.elements.Metadata; + +import com.aventstack.extentreports.Status; + +import fj.data.Either; + +public class ToscaValidation { + + + /** + * @param expectedToscaDefinition + * @param actualToscaDefinition + * @return true if all validation success else return error map + */ + public static Either<Boolean, Map<String, Object>> resourceToscaMetadataValidator(ToscaDefinition expectedToscaDefinition, ToscaDefinition actualToscaDefinition){ + + SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate resource TOSCA metadata..."); + Map<String, String> expectedMetadata = expectedToscaDefinition.getMetadata(); + Map<String, String> actualMetadata = actualToscaDefinition.getMetadata(); + Either<Boolean, Map<String, Object>> resourceToscaMetadataValidator = compareMapData(expectedMetadata, actualMetadata); + if(resourceToscaMetadataValidator.isLeft()){ + SetupCDTest.getExtendTest().log(Status.INFO, "Resource TOSCA metadata verification success"); + }else{ + SetupCDTest.getExtendTest().log(Status.ERROR, "Resource TOSCA metadata verification failed" + resourceToscaMetadataValidator.right().value()); + } + return resourceToscaMetadataValidator; + } + + public static Boolean resourceToscaNodeTemplateMetadataValidator(Map<String, Map<String, String>> expectedMetadata, ToscaDefinition actualToscaDefinition){ + boolean isTestFailed = true; + for(String nodeTemplateName : expectedMetadata.keySet()){ + Either<Boolean,Map<String,Object>> serviceToscaMetadataValidator = componentToscaNodeTemplateMetadataValidator(expectedMetadata.get(nodeTemplateName), actualToscaDefinition, nodeTemplateName, ComponentTypeEnum.RESOURCE); + if(serviceToscaMetadataValidator.left().value() == false){ + isTestFailed = false; + } + } + return isTestFailed; + } + + public static Either<Boolean, Map<String, Object>> serviceToscaMetadataValidator(Map<String, String> expectedMetadata, ToscaDefinition actualToscaDefinition){ + + SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA metadata..."); + Map<String, String> actualMetadata = actualToscaDefinition.getMetadata(); + Either<Boolean,Map<String,Object>> serviceToscaMetadataValidator = compareMapData(expectedMetadata, actualMetadata); + if(serviceToscaMetadataValidator.isLeft()){ + SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA metadata verification success"); + }else{ + SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA metadata verification failed" + serviceToscaMetadataValidator.right().value().toString()); + } + return serviceToscaMetadataValidator; + } + + public static Either<Boolean, Map<String, Object>> componentToscaNodeTemplateMetadataValidator(Map<String, String> expectedMetadata, ToscaDefinition actualToscaDefinition, String nodeTemplateName, ComponentTypeEnum componentType){ + + SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate "+ componentType.getValue() + " node template TOSCA metadata..."); + Map<String, String> actualMetadata = actualToscaDefinition.getTopology_template().getNode_templates().get(nodeTemplateName).getMetadata(); + Either<Boolean,Map<String,Object>> componentToscaMetadataValidator = compareMapData(expectedMetadata, actualMetadata); + if(componentToscaMetadataValidator.isLeft()){ + SetupCDTest.getExtendTest().log(Status.INFO, componentType.getValue() + " TOSCA node template metadata verification success"); + }else{ + SetupCDTest.getExtendTest().log(Status.ERROR, componentType.getValue() + " TOSCA node template metadata verification failed" + componentToscaMetadataValidator.right().value().toString()); + } + return componentToscaMetadataValidator; + } + + public static Either<Boolean, Map<String, Object>> serviceToscaMetadataValidatorAgainstParser(Map<String, String> expectedMetadata, Metadata actualMetadata){ + + SetupCDTest.getExtendTest().log(Status.INFO, "Going to validate service TOSCA metadata..."); + + Either<Boolean,Map<String,Object>> serviceToscaMetadataValidator = compareMetadataUsingToscaParser(expectedMetadata, actualMetadata); + if(serviceToscaMetadataValidator.isLeft()){ + SetupCDTest.getExtendTest().log(Status.INFO, "Service TOSCA metadata verification vs. tosca parser success"); + }else{ + SetupCDTest.getExtendTest().log(Status.ERROR, "Service TOSCA metadata verification vs. tosca parser failed" + serviceToscaMetadataValidator.right().value().toString()); + } + return serviceToscaMetadataValidator; + } + + + public static Either<Boolean, Map<String, Object>> compareMapData(Map<String, String> expectedMetadata, Map<String, String> actualMetadata) { + Either.left(false); + Map<String, Object> errorMap = new HashMap<>(); + for(String key : expectedMetadata.keySet()){ + boolean isError = compaireValue(expectedMetadata.get(key), actualMetadata.get(key)); + if(!isError){ + errorMap.put("Data key["+key+"]", "expected: " + expectedMetadata.get(key) + ", actual: " + actualMetadata.get(key)); + } + } + if(errorMap != null && !errorMap.isEmpty()){ + return Either.right(errorMap); + } + return Either.left(true); + } + + public static Either<Boolean, Map<String, Object>> compareMetadataUsingToscaParser(Map<String, String> expectedMetadata, Metadata actualMetadata) { + Map<String, Object> errorMap = new HashMap<>(); + for(String key : expectedMetadata.keySet()){ + boolean isError = compaireValue(expectedMetadata.get(key), actualMetadata.getValue(key)); + if(!isError){ + errorMap.put("Data key["+key+"]", "expected: " + expectedMetadata.get(key) + ", actual: " + actualMetadata.getValue(key)); + } + } + if(errorMap != null && !errorMap.isEmpty()){ + return Either.right(errorMap); + } + return Either.left(true); + } + + private static boolean compaireValue(String expected, String actual) { + + return expected.equals(actual) ? true : false; + + } + + + +} diff --git a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java index 7f01b86eaf..9426fc1cde 100644 --- a/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java +++ b/ui-ci/src/main/java/org/openecomp/sdc/ci/tests/verificator/VfModuleVerificator.java @@ -38,7 +38,7 @@ import org.openecomp.sdc.be.model.Service; import org.openecomp.sdc.ci.tests.datatypes.TypeHeatMetaDefinition; import org.openecomp.sdc.ci.tests.execute.setup.SetupCDTest; import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaDefinition; -import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupsMetadataDefinition; +import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaServiceGroupsMetadataDefinition; import org.openecomp.sdc.ci.tests.tosca.datatypes.ToscaGroupsTopologyTemplateDefinition; import org.openecomp.sdc.ci.tests.utils.ToscaParserUtils; @@ -75,7 +75,7 @@ public class VfModuleVerificator { for (Map.Entry<String, ToscaGroupsTopologyTemplateDefinition> groupTopologyTemplateDefinition : groups.entrySet()) { String key = groupTopologyTemplateDefinition.getKey(); GroupInstance groupInstanceObject = getGroupInstanceByKey(key, service); - ToscaGroupsMetadataDefinition metadata = groupTopologyTemplateDefinition.getValue().getMetadata(); + ToscaServiceGroupsMetadataDefinition metadata = groupTopologyTemplateDefinition.getValue().getMetadata(); assertNotNull("groupInstanceObject is null", groupInstanceObject); assertTrue("expected vfModuleModelName " + groupInstanceObject.getGroupName() + ", actual " + metadata.getVfModuleModelName(), groupInstanceObject.getGroupName().equals(metadata.getVfModuleModelName())); assertTrue("expected vfModuleModelInvariantUUID " + groupInstanceObject.getInvariantUUID() + ", actual " + metadata.getVfModuleModelInvariantUUID(), groupInstanceObject.getInvariantUUID().equals(metadata.getVfModuleModelInvariantUUID())); diff --git a/ui-ci/src/main/resources/ci/testSuites/toscaValidationSuite.xml b/ui-ci/src/main/resources/ci/testSuites/toscaValidationSuite.xml new file mode 100644 index 0000000000..6114517c8f --- /dev/null +++ b/ui-ci/src/main/resources/ci/testSuites/toscaValidationSuite.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd"> +<suite name="uitests" configfailurepolicy="continue" parallel="instances" thread-count="2" data-provider-thread-count="2"> + <parameter name="makeDistribution" value="false"/> + + <test name="OnbordingDataProviders"> + <classes> + + <class name="org.openecomp.sdc.ci.tests.dataProvider.OnbordingDataProviders"> + <methods> + <include name="OnbordingDataProviders"/> + <!-- <exclude name="onboardVNFShotFlow"/> + <exclude name="onboardRandomVNFsTest"/> --> + </methods> + </class> + <!-- <class name="org.openecomp.sdc.ci.tests.execute.sanity.Onboard"> + <methods> + <include name="onboardRandomVNFsTest"/> + </methods> + </class> --> + + </classes> + </test> <!-- uitests --> +</suite> <!-- uisuite -->
\ No newline at end of file |