diff options
8 files changed, 227 insertions, 120 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy index e5d390e2aa..ba87614937 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/CreateSliceService.groovy @@ -275,8 +275,7 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { execution.setVariable("sliceTaskParams", sliceTaskParams) - String paramJson = sliceTaskParams.convertToJson() - execution.setVariable("CSSOT_paramJson", paramJson) + execution.setVariable("CSSOT_paramJson", objectMapper.writeValueAsString(sliceTaskParams)) logger.debug("Finish createOrchestrationTask") } @@ -372,9 +371,9 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { String taskStatus = execution.getVariable("taskStatus") SliceTaskParamsAdapter sliceTaskParams = execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter - String paramJson = sliceTaskParams.convertToJson() + execution.setVariable("CSSOT_status", taskStatus) - execution.setVariable("CSSOT_paramJson", paramJson) + execution.setVariable("CSSOT_paramJson", objectMapper.writeValueAsString(sliceTaskParams)) execution.setVariable("CSSOT_requestMethod", requestMethod) logger.debug("Finish prepareUpdateOrchestrationTask") } @@ -402,10 +401,8 @@ public class CreateSliceService extends AbstractServiceTaskProcessor { String paramJson = orchestrationTask.getParams() logger.debug("paramJson: " + paramJson) - SliceTaskParamsAdapter sliceTaskParams = - execution.getVariable("sliceTaskParams") as SliceTaskParamsAdapter + SliceTaskParamsAdapter sliceTaskParams = objectMapper.readValue(paramJson, SliceTaskParamsAdapter.class) - sliceTaskParams.convertFromJson(paramJson) execution.setVariable("sliceTaskParams", sliceTaskParams) logger.debug("Finish processUserOptions") } diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy index 276b6f0500..59decb56a4 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy @@ -669,6 +669,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{ NssmfAdapterNBIRequest nbiRequest = new NssmfAdapterNBIRequest() AllocateTnNssi allocateTnNssi = new AllocateTnNssi() + allocateTnNssi.setNssiId(sliceTaskInfo.suggestNssiId) //todo: AllocateTnNssi //todo: endPointId -> set into tn List<TransportSliceNetwork> transportSliceNetworks = new ArrayList<>() diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy index e88b1c747f..a784cbee6e 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSSI.groovy @@ -131,8 +131,7 @@ class DoAllocateNSSI extends AbstractServiceTaskProcessor { sliceTaskInfo.statusDescription = response.getStatusDescription() updateNssiResult(sliceParams, subnetType, sliceTaskInfo) - String paramJson = sliceParams.convertToJson() - execution.setVariable("CSSOT_paramJson", paramJson) + execution.setVariable("CSSOT_paramJson", objectMapper.writeValueAsString(sliceParams)) execution.setVariable("CSSOT_requestMethod", requestMethod) execution.setVariable("sliceTaskParams", sliceParams) diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java index aa1108cbb9..3a7dd5772f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/UserParamsServiceTraversal.java @@ -44,6 +44,7 @@ import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; import java.io.IOException; import java.util.ArrayList; +import java.util.Collections; import java.util.List; import java.util.Map; import static org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionConstants.CREATE_INSTANCE; @@ -59,6 +60,8 @@ public class UserParamsServiceTraversal { private final CatalogDbClient catalogDbClient; private final ExceptionBuilder exceptionBuilder; private boolean foundVfModuleOrVG; + private String vnfCustomizationUUID; + private String vfModuleCustomizationUUID; UserParamsServiceTraversal(CatalogDbClient catalogDbClient, ExceptionBuilder exceptionBuilder) { this.catalogDbClient = catalogDbClient; @@ -68,23 +71,22 @@ public class UserParamsServiceTraversal { protected List<Resource> getResourceListFromUserParams(DelegateExecution execution, List<Map<String, Object>> userParams, String serviceModelVersionId, String requestAction) throws IOException { - List<Resource> resourceList = new ArrayList<>(); if (userParams != null) { for (Map<String, Object> params : userParams) { if (params.containsKey(USER_PARAM_SERVICE)) { ObjectMapper obj = new ObjectMapper(); String input = obj.writeValueAsString(params.get(USER_PARAM_SERVICE)); Service validate = obj.readValue(input, Service.class); - setResourceList(execution, serviceModelVersionId, requestAction, resourceList, validate); - break; + return getResourceList(execution, serviceModelVersionId, requestAction, validate); } } } - return resourceList; + return Collections.emptyList(); } - private void setResourceList(DelegateExecution execution, String serviceModelVersionId, String requestAction, - List<Resource> resourceList, Service validate) { + private List<Resource> getResourceList(DelegateExecution execution, String serviceModelVersionId, + String requestAction, Service validate) { + List<Resource> resourceList = new ArrayList<>(); resourceList.add(new Resource(WorkflowType.SERVICE, validate.getModelInfo().getModelVersionId(), false)); if (validate.getResources().getVnfs() != null) { setResourceListForVnfs(execution, resourceList, validate); @@ -95,11 +97,12 @@ public class UserParamsServiceTraversal { if (validate.getResources().getNetworks() != null) { setResourceListForNetworks(execution, serviceModelVersionId, requestAction, resourceList, validate); } + return resourceList; } private void setResourceListForVnfs(DelegateExecution execution, List<Resource> resourceList, Service validate) { - foundVfModuleOrVG = false; for (Vnfs vnf : validate.getResources().getVnfs()) { + setVnfCustomizationUUID(vnf); resourceList.add(new Resource(WorkflowType.VNF, vnf.getModelInfo().getModelCustomizationId(), false)); setResourceListForVfModules(execution, resourceList, validate, vnf); } @@ -109,10 +112,10 @@ public class UserParamsServiceTraversal { Vnfs vnf) { if (vnf.getVfModules() != null) { for (VfModules vfModule : vnf.getVfModules()) { + setVfModuleCustomizationUUID(vfModule); VfModuleCustomization vfModuleCustomization = - catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID( - vfModule.getModelInfo().getModelCustomizationUuid()); - if (vfModuleCustomization != null) { + catalogDbClient.getVfModuleCustomizationByModelCuztomizationUUID(vfModuleCustomizationUUID); + if (vfModuleCustomization != null && vfModuleCustomization.getVfModule() != null) { setVolumeGroupWorkFlowTypeToResourceList(resourceList, vfModuleCustomization); setVfModuleAndConfigurationWorkFlowTypeToResourceList(resourceList, validate, vnf, vfModule, vfModuleCustomization); @@ -127,8 +130,7 @@ public class UserParamsServiceTraversal { private void setVolumeGroupWorkFlowTypeToResourceList(List<Resource> resourceList, VfModuleCustomization vfModuleCustomization) { - if (vfModuleCustomization.getVfModule() != null - && vfModuleCustomization.getVfModule().getVolumeHeatTemplate() != null + if (vfModuleCustomization.getVfModule().getVolumeHeatTemplate() != null && vfModuleCustomization.getVolumeHeatEnv() != null) { foundVfModuleOrVG = true; resourceList.add( @@ -138,11 +140,9 @@ public class UserParamsServiceTraversal { private void setVfModuleAndConfigurationWorkFlowTypeToResourceList(List<Resource> resourceList, Service validate, Vnfs vnf, VfModules vfModule, VfModuleCustomization vfModuleCustomization) { - if ((vfModuleCustomization.getVfModule() != null) - && ((vfModuleCustomization.getVfModule().getModuleHeatTemplate() != null - && vfModuleCustomization.getHeatEnvironment() != null)) - || (vfModuleCustomization.getVfModule() != null - && vfModuleCustomization.getVfModule().getModelName() != null + if ((vfModuleCustomization.getVfModule().getModuleHeatTemplate() != null + && vfModuleCustomization.getHeatEnvironment() != null) + || (vfModuleCustomization.getVfModule().getModelName() != null && vfModuleCustomization.getVfModule().getModelName().contains("helm"))) { foundVfModuleOrVG = true; Resource resource = setVfModuleWorkFlowTypeToResourceList(resourceList, vfModuleCustomization); @@ -162,11 +162,9 @@ public class UserParamsServiceTraversal { private void setConfigurationWorkFlowTypeToResourceList(List<Resource> resourceList, Service validate, Vnfs vnf, VfModules vfModule, Resource resource) { - String vfModuleCustomizationUUID = getVfModuleCustomizationUUID(vfModule); - String vnfCustomizationUUID = getVnfCustomizationUUID(vnf); if (!vnfCustomizationUUID.isEmpty() && !vfModuleCustomizationUUID.isEmpty()) { - List<CvnfcConfigurationCustomization> configs = traverseCatalogDbForConfiguration( - validate.getModelInfo().getModelVersionId(), vnfCustomizationUUID, vfModuleCustomizationUUID); + List<CvnfcConfigurationCustomization> configs = + traverseCatalogDbForConfiguration(validate.getModelInfo().getModelVersionId()); for (CvnfcConfigurationCustomization config : configs) { Resource configResource = new Resource(WorkflowType.CONFIGURATION, config.getConfigurationResource().getModelUUID(), false); @@ -177,24 +175,20 @@ public class UserParamsServiceTraversal { } } - private String getVfModuleCustomizationUUID(VfModules vfModule) { - String vfModuleCustomizationUUID; + private void setVfModuleCustomizationUUID(VfModules vfModule) { if (vfModule.getModelInfo() != null && vfModule.getModelInfo().getModelCustomizationUuid() != null) { vfModuleCustomizationUUID = vfModule.getModelInfo().getModelCustomizationUuid(); } else { vfModuleCustomizationUUID = ""; } - return vfModuleCustomizationUUID; } - private String getVnfCustomizationUUID(Vnfs vnf) { - String vnfCustomizationUUID; + private void setVnfCustomizationUUID(Vnfs vnf) { if (vnf.getModelInfo() != null && vnf.getModelInfo().getModelCustomizationUuid() != null) { vnfCustomizationUUID = vnf.getModelInfo().getModelCustomizationUuid(); } else { vnfCustomizationUUID = ""; } - return vnfCustomizationUUID; } private void setResourceListForPnfs(List<Resource> resourceList, Service validate) { @@ -218,25 +212,29 @@ public class UserParamsServiceTraversal { } - private List<CvnfcConfigurationCustomization> traverseCatalogDbForConfiguration(String serviceModelUUID, - String vnfCustomizationUUID, String vfModuleCustomizationUUID) { - List<CvnfcConfigurationCustomization> configurations = new ArrayList<>(); + private List<CvnfcConfigurationCustomization> traverseCatalogDbForConfiguration(String serviceModelUUID) { try { List<CvnfcCustomization> cvnfcCustomizations = catalogDbClient.getCvnfcCustomization(serviceModelUUID, vnfCustomizationUUID, vfModuleCustomizationUUID); - for (CvnfcCustomization cvnfc : cvnfcCustomizations) { - for (CvnfcConfigurationCustomization customization : cvnfc.getCvnfcConfigurationCustomization()) { - if (customization.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) { - configurations.add(customization); - } - } - } - logger.debug("found {} fabric configuration(s)", configurations.size()); - return configurations; + return getCvnfcConfigurationCustomizations(cvnfcCustomizations); } catch (Exception ex) { logger.error("Error in finding configurations", ex); - return configurations; + return Collections.emptyList(); + } + } + + private List<CvnfcConfigurationCustomization> getCvnfcConfigurationCustomizations( + List<CvnfcCustomization> cvnfcCustomizations) { + List<CvnfcConfigurationCustomization> configurations = new ArrayList<>(); + for (CvnfcCustomization cvnfc : cvnfcCustomizations) { + for (CvnfcConfigurationCustomization customization : cvnfc.getCvnfcConfigurationCustomization()) { + if (customization.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) { + configurations.add(customization); + } + } } + logger.debug("found {} fabric configuration(s)", configurations.size()); + return configurations; } private String queryCatalogDbForNetworkCollection(DelegateExecution execution, String serviceModelVersionId) { @@ -261,9 +259,7 @@ public class UserParamsServiceTraversal { count++; } } - if (count == 0) { - return null; - } else if (count > 1) { + if (count > 1) { buildAndThrowException(execution, "Found multiple Network Collections in the Service model, only one per Service is supported."); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java index 7db93e7979..210d5195e5 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/ebb/loader/VnfEBBLoader.java @@ -28,7 +28,6 @@ package org.onap.so.bpmn.infrastructure.workflow.tasks.ebb.loader; import org.camunda.bpm.engine.delegate.DelegateExecution; import org.javatuples.Pair; -import org.onap.aai.domain.yang.ServiceInstance; import org.onap.aaiclient.client.aai.AAICommonObjectMapperProvider; import org.onap.aaiclient.client.aai.entities.AAIResultWrapper; import org.onap.aaiclient.client.aai.entities.Relationships; @@ -36,7 +35,10 @@ import org.onap.so.bpmn.infrastructure.workflow.tasks.Resource; import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowActionExtractResourcesAAI; import org.onap.so.bpmn.infrastructure.workflow.tasks.WorkflowType; import org.onap.so.bpmn.servicedecomposition.bbobjects.Configuration; +import org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf; +import org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance; import org.onap.so.bpmn.servicedecomposition.bbobjects.VfModule; +import org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetup; import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils; import org.onap.so.client.exception.ExceptionBuilder; @@ -69,35 +71,12 @@ public class VnfEBBLoader { public void traverseAAIVnf(DelegateExecution execution, List<Resource> resourceList, String serviceId, String vnfId, List<Pair<WorkflowType, String>> aaiResourceIds) { try { - ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(serviceId); - org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO = - bbInputSetup.getExistingServiceInstance(serviceInstanceAAI); + org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI = + bbInputSetupUtils.getAAIServiceInstanceById(serviceId); + ServiceInstance serviceInstanceMSO = bbInputSetup.getExistingServiceInstance(serviceInstanceAAI); resourceList.add(new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false)); if (serviceInstanceMSO.getVnfs() != null) { - for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) { - if (vnf.getVnfId().equals(vnfId)) { - aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId())); - resourceList.add(new Resource(WorkflowType.VNF, vnf.getVnfId(), false)); - if (vnf.getVfModules() != null) { - for (VfModule vfModule : vnf.getVfModules()) { - aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId())); - resourceList.add(new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false)); - findConfigurationsInsideVfModule(execution, vnf.getVnfId(), vfModule.getVfModuleId(), - resourceList, aaiResourceIds); - } - } - if (vnf.getVolumeGroups() != null) { - for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf - .getVolumeGroups()) { - aaiResourceIds - .add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId())); - resourceList.add( - new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false)); - } - } - break; - } - } + findVnfWithGivenId(serviceInstanceMSO, vnfId, aaiResourceIds, resourceList, execution); } } catch (Exception ex) { logger.error("Exception in traverseAAIVnf", ex); @@ -109,39 +88,13 @@ public class VnfEBBLoader { public void customTraverseAAIVnf(DelegateExecution execution, List<Resource> resourceList, String serviceId, String vnfId, List<Pair<WorkflowType, String>> aaiResourceIds) { try { - ServiceInstance serviceInstanceAAI = bbInputSetupUtils.getAAIServiceInstanceById(serviceId); - org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO = - bbInputSetup.getExistingServiceInstance(serviceInstanceAAI); + org.onap.aai.domain.yang.ServiceInstance serviceInstanceAAI = + bbInputSetupUtils.getAAIServiceInstanceById(serviceId); + ServiceInstance serviceInstanceMSO = bbInputSetup.getExistingServiceInstance(serviceInstanceAAI); resourceList.add(new Resource(WorkflowType.SERVICE, serviceInstanceMSO.getServiceInstanceId(), false)); if (serviceInstanceMSO.getVnfs() != null) { - for (org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf : serviceInstanceMSO.getVnfs()) { - if (vnf.getVnfId().equals(vnfId)) { - aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId())); - - String vnfCustomizationUUID = - bbInputSetupUtils.getAAIGenericVnf(vnfId).getModelCustomizationId(); - resourceList.add(new Resource(WorkflowType.VNF, vnfCustomizationUUID, false)); - - if (vnf.getVfModules() != null) { - for (VfModule vfModule : vnf.getVfModules()) { - aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId())); - resourceList.add(new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false)); - findConfigurationsInsideVfModule(execution, vnf.getVnfId(), vfModule.getVfModuleId(), - resourceList, aaiResourceIds); - } - } - if (vnf.getVolumeGroups() != null) { - for (org.onap.so.bpmn.servicedecomposition.bbobjects.VolumeGroup volumeGroup : vnf - .getVolumeGroups()) { - aaiResourceIds - .add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId())); - resourceList.add( - new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false)); - } - } - break; - } - } + findVnfWithGivenIdAndAddCustomizationUUID(serviceInstanceMSO, vnfId, aaiResourceIds, resourceList, + execution); } } catch (Exception ex) { logger.error("Exception in customTraverseAAIVnf", ex); @@ -151,6 +104,33 @@ public class VnfEBBLoader { } + private void findVnfWithGivenId(ServiceInstance serviceInstanceMSO, String vnfId, + List<Pair<WorkflowType, String>> aaiResourceIds, List<Resource> resourceList, DelegateExecution execution) { + for (GenericVnf vnf : serviceInstanceMSO.getVnfs()) { + if (vnf.getVnfId().equals(vnfId)) { + aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId())); + resourceList.add(new Resource(WorkflowType.VNF, vnf.getVnfId(), false)); + processVfModules(vnf, aaiResourceIds, resourceList, execution); + processVolumeGroups(vnf, aaiResourceIds, resourceList); + break; + } + } + } + + private void findVnfWithGivenIdAndAddCustomizationUUID(ServiceInstance serviceInstanceMSO, String vnfId, + List<Pair<WorkflowType, String>> aaiResourceIds, List<Resource> resourceList, DelegateExecution execution) { + for (GenericVnf vnf : serviceInstanceMSO.getVnfs()) { + if (vnf.getVnfId().equals(vnfId)) { + aaiResourceIds.add(new Pair<>(WorkflowType.VNF, vnf.getVnfId())); + resourceList.add(new Resource(WorkflowType.VNF, + bbInputSetupUtils.getAAIGenericVnf(vnfId).getModelCustomizationId(), false)); + processVfModules(vnf, aaiResourceIds, resourceList, execution); + processVolumeGroups(vnf, aaiResourceIds, resourceList); + break; + } + } + } + private void findConfigurationsInsideVfModule(DelegateExecution execution, String vnfId, String vfModuleId, List<Resource> resourceList, List<Pair<WorkflowType, String>> aaiResourceIds) { try { @@ -161,15 +141,7 @@ public class VnfEBBLoader { relationshipsOp = vfModuleWrapper.getRelationships(); if (relationshipsOp.isPresent()) { relationshipsOp = workflowActionUtils.extractRelationshipsVnfc(relationshipsOp.get()); - if (relationshipsOp.isPresent()) { - Optional<Configuration> config = - workflowActionUtils.extractRelationshipsConfiguration(relationshipsOp.get()); - if (config.isPresent()) { - aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, config.get().getConfigurationId())); - resourceList.add( - new Resource(WorkflowType.CONFIGURATION, config.get().getConfigurationId(), false)); - } - } + addConfigToResources(relationshipsOp, resourceList, aaiResourceIds); } } catch (Exception ex) { logger.error("Exception in findConfigurationsInsideVfModule", ex); @@ -177,6 +149,40 @@ public class VnfEBBLoader { } } + private void processVfModules(GenericVnf vnf, List<Pair<WorkflowType, String>> aaiResourceIds, + List<Resource> resourceList, DelegateExecution execution) { + if (vnf.getVfModules() != null) { + for (VfModule vfModule : vnf.getVfModules()) { + aaiResourceIds.add(new Pair<>(WorkflowType.VFMODULE, vfModule.getVfModuleId())); + resourceList.add(new Resource(WorkflowType.VFMODULE, vfModule.getVfModuleId(), false)); + findConfigurationsInsideVfModule(execution, vnf.getVnfId(), vfModule.getVfModuleId(), resourceList, + aaiResourceIds); + } + } + } + + private void processVolumeGroups(GenericVnf vnf, List<Pair<WorkflowType, String>> aaiResourceIds, + List<Resource> resourceList) { + if (vnf.getVolumeGroups() != null) { + for (VolumeGroup volumeGroup : vnf.getVolumeGroups()) { + aaiResourceIds.add(new Pair<>(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId())); + resourceList.add(new Resource(WorkflowType.VOLUMEGROUP, volumeGroup.getVolumeGroupId(), false)); + } + } + } + + private void addConfigToResources(Optional<Relationships> relationshipsOp, List<Resource> resourceList, + List<Pair<WorkflowType, String>> aaiResourceIds) { + if (relationshipsOp.isPresent()) { + Optional<Configuration> config = + workflowActionUtils.extractRelationshipsConfiguration(relationshipsOp.get()); + if (config.isPresent()) { + aaiResourceIds.add(new Pair<>(WorkflowType.CONFIGURATION, config.get().getConfigurationId())); + resourceList.add(new Resource(WorkflowType.CONFIGURATION, config.get().getConfigurationId(), false)); + } + } + } + private void buildAndThrowException(DelegateExecution execution, String msg) { logger.error(msg); execution.setVariable(WORKFLOW_ACTION_ERROR_MESSAGE, msg); diff --git a/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java b/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java index 1b0986ca0d..3d25ef1d45 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java @@ -39,4 +39,6 @@ public class AllocateTnNssi implements Serializable { private NsiInfo nsiInfo; private String scriptName; + + private String nssiId; } diff --git a/common/src/main/java/org/onap/so/beans/nsmf/TnSliceProfile.java b/common/src/main/java/org/onap/so/beans/nsmf/TnSliceProfile.java index f904e1c466..50f0e3d8ce 100644 --- a/common/src/main/java/org/onap/so/beans/nsmf/TnSliceProfile.java +++ b/common/src/main/java/org/onap/so/beans/nsmf/TnSliceProfile.java @@ -48,4 +48,7 @@ public class TnSliceProfile implements Serializable { @JsonProperty(value = "jitter") private int jitter; + + @JsonProperty(value = "resourceSharingLevel") + private ResourceSharingLevel resourceSharingLevel; } diff --git a/docs/api/apis/serviceInstances-api.rst b/docs/api/apis/serviceInstances-api.rst index a46af713dc..8eafe05a2e 100644 --- a/docs/api/apis/serviceInstances-api.rst +++ b/docs/api/apis/serviceInstances-api.rst @@ -43,6 +43,14 @@ Create service instance |Content-Type |application/json | +--------------------+--------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + Request Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ @@ -238,6 +246,14 @@ Delete service instance |Content-Type |application/json | +--------------------+--------------------------------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + Request Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ @@ -294,6 +310,14 @@ Create Volume Group |Content-Type |application/json | +--------------------+------------------------------------------------------------------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + Request Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ @@ -427,6 +451,14 @@ Delete Volume Group |Content-Type |application/json | +--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + Request Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ @@ -490,6 +522,14 @@ Create VF Module |Content-Type |application/json | +--------------------+---------------------------------------------------------------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + Request Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ @@ -587,6 +627,14 @@ Delete VF Module |Content-Type |application/json | +--------------------+-------------------------------------------------------------------------------------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + Request Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ @@ -659,6 +707,14 @@ Create VNF |Content-Type |application/json | +--------------------+-------------------------------------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + Request Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ @@ -808,6 +864,14 @@ Delete VNF |Content-Type |application/json | +--------------------+-----------------------------------------------------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + Request Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ @@ -891,6 +955,14 @@ GET Orchestration Request |Content-Type |application/json | +--------------------+-------------------------------------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + Response Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ @@ -1045,6 +1117,37 @@ GET Orchestration Requests |Content-Type |application/json | +--------------------+--------------------------------------------------------------+ +Request Headers: + ++-------------------+---------+-----------------------------------------------------------------------------------------+ +|Header Name |Required |Description | ++===================+=========+=========================================================================================+ +|Authorization |Y |Base64 encoded username:password | ++-------------------+---------+-----------------------------------------------------------------------------------------+ + +Query Parameters: + ++-------------------+---------+-----------+-------+-----------------------------------------------------------------------------------------------------+ +|Attribute |Required |Cardinality|Content|Description | ++===================+=========+===========+=======+=====================================================================================================+ +|filter |Y |1 |String | Orchestration filter (scheme KeyTypes:Option:Value) | +| | | | | | +| | | | | KeyTypes: | +| | | | | serviceInstanceId, serviceInstanceName, vnfInstanceId, pnfName, vnfInstanceName, | +| | | | | vfModuleInstanceId, vfModuleInstanceName, volumeGroupInstanceId, volumeGroupInstanceName, | +| | | | | networkInstanceId, networkInstanceName, configurationInstanceId, configurationInstanceName, | +| | | | | lcpCloudRegionId, tenantId, modelType, requestorId, requestExecutionDate, startTime, requestScope | +| | | | | | +| | | | | Option: | +| | | | | EQUALS (or any not null string), DOES_NOT_EQUAL [e.g. modelType:EQUALS:VNF, modelType:qwe:VNF] | +| | | | | for KeyTypes equals startTime or requestExecutionDate: DOES_NOT_EQUAL, BETWEEN_DATES | +| | | | | [e.g. startTime:BETWEEN_DATES:30-5-2000:30-5-2030] | ++-------------------+---------+-----------+-------+-----------------------------------------------------------------------------------------------------+ +|includeCloudRequest|N |1 |Boolean| Enable or disable cloud data request | ++-------------------+---------+-----------+-------+-----------------------------------------------------------------------------------------------------+ +|format |N |1 |String | Orchestration request format [DETAIL, STATUSDETAIL, SIMPLE, SIMPLENOTASKINFO] | ++-------------------+---------+-----------+-------+-----------------------------------------------------------------------------------------------------+ + Response Body: +----------------+---------+-----------+--------------------------+-------------------------------------------+ |