aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKrupaNagabhushan <krupa.nagabhushan@est.tech>2022-05-16 16:05:35 +0100
committerMichael Morris <michael.morris@est.tech>2022-05-18 10:40:40 +0000
commitb804b97e06e50e134633a9c3be58f3fb7228756a (patch)
tree8875b59c961a2b4719e90d002d29a27f1959c567
parentf9498e6ee979e33fcd42b3d54551b19e4ab84a8f (diff)
Onboarded ASD csar included in VF csar
Issue-ID: SDC-4003 Signed-off-by: KrupaNagabhushan <krupa.nagabhushan@est.tech> Change-Id: Ia85f36c8efca2c3a10ce92347fea5cc97dbd972b
-rw-r--r--catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb11
-rw-r--r--common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java1
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java11
3 files changed, 18 insertions, 5 deletions
diff --git a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
index aa4c8c4f6a..b0cb7ddec5 100644
--- a/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
+++ b/catalog-be/src/main/docker/backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb
@@ -613,6 +613,17 @@ artifacts:
acceptedTypes:
- csar
- zip
+ - type: ASD_PACKAGE
+ categories:
+ - DEPLOYMENT
+ componentTypes:
+ - RESOURCE
+ resourceTypes:
+ - VF
+ - PNF
+ acceptedTypes:
+ - csar
+ - zip
- type: HEAT_ENV
categories:
- DEPLOYMENT
diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java b/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java
index 6be6c7f048..6cb17e8116 100644
--- a/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java
+++ b/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java
@@ -58,6 +58,7 @@ public enum ArtifactTypeEnum {
DCAE_TOSCA("DCAE_TOSCA"),
DG_XML("DG_XML"),
ETSI_PACKAGE("ETSI_PACKAGE"),
+ ASD_PACKAGE("ASD_PACKAGE"),
GUIDE("GUIDE"),
HEAT_ARTIFACT("HEAT_ARTIFACT"),
HEAT_ENV("HEAT_ENV"),
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java
index 817d212fc7..846612e4d0 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/orchestration/process/OrchestrationTemplateProcessCsarHandler.java
@@ -60,7 +60,8 @@ import java.util.Optional;
public class OrchestrationTemplateProcessCsarHandler implements OrchestrationTemplateProcessHandler {
private static final Logger LOGGER = LoggerFactory.getLogger(OrchestrationTemplateProcessCsarHandler.class);
- private static final String SDC_ONBOARDED_PACKAGE_DIR = "Deployment/" + ArtifactTypeEnum.ETSI_PACKAGE.getType() + "/";
+ private static final String SDC_ONBOARDED_PACKAGE_DIR_ETSI = "Deployment/" + ArtifactTypeEnum.ETSI_PACKAGE.getType() + "/";
+ private static final String SDC_ONBOARDED_PACKAGE_DIR_ASD = "Deployment/" + ArtifactTypeEnum.ASD_PACKAGE.getType() + "/";
private static final String EXT_SEPARATOR = ".";
private final CandidateService candidateService = CandidateServiceFactory.getInstance().createInterface();
private final ToscaTreeManager toscaTreeManager = new ToscaTreeManager();
@@ -152,11 +153,11 @@ public class OrchestrationTemplateProcessCsarHandler implements OrchestrationTem
private void addOriginalOnboardedPackage(final FileContentHandler fileContentHandler, final OrchestrationTemplateCandidateData candidateData) {
if (OnboardingTypesEnum.CSAR.getType().equalsIgnoreCase(candidateData.getFileSuffix())) {
- fileContentHandler
- .addFile(SDC_ONBOARDED_PACKAGE_DIR + candidateData.getOriginalFileName() + EXT_SEPARATOR + candidateData.getOriginalFileSuffix(),
- candidateData.getOriginalFileContentData().array());
+ final String dirPrefix = asdPackageHelper.isAsdPackage(fileContentHandler) ? SDC_ONBOARDED_PACKAGE_DIR_ASD : SDC_ONBOARDED_PACKAGE_DIR_ETSI;
+ fileContentHandler.addFile(dirPrefix + candidateData.getOriginalFileName() + EXT_SEPARATOR + candidateData.getOriginalFileSuffix(),
+ candidateData.getOriginalFileContentData().array());
} else {
- fileContentHandler.addFile(SDC_ONBOARDED_PACKAGE_DIR + candidateData.getFileName() + EXT_SEPARATOR + candidateData.getFileSuffix(),
+ fileContentHandler.addFile(SDC_ONBOARDED_PACKAGE_DIR_ETSI + candidateData.getFileName() + EXT_SEPARATOR + candidateData.getFileSuffix(),
candidateData.getContentData().array());
}
}