diff options
50 files changed, 2531 insertions, 1903 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java index e821d806dd..2a17656f1d 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/cloudify/utils/MsoCloudifyUtils.java @@ -478,12 +478,14 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin { boolean timedOut = false; int cancelTimeout = timeout; // TODO: For now, just use same timeout - String status = cancelExecution.getStatus(); - + String status = null; + if (cancelExecution != null) { + status = cancelExecution.getStatus(); + } // Poll for completion. Create a reusable cloudify query request GetExecution queryExecution = cloudify.executions().byId(executionId); - while (!timedOut && !status.equals(CANCELLED)) { + while (!timedOut && !CANCELLED.equals(status)) { // workflow is still running; check for timeout if (cancelTimeout <= 0) { logger.debug("Cancel timeout for workflow {} on deployment {}", workflowId, deploymentId); @@ -497,11 +499,13 @@ public class MsoCloudifyUtils extends MsoCommonUtils implements VduPlugin { logger.debug("pollTimeout remaining: {}", cancelTimeout); execution = queryExecution.execute(); - status = execution.getStatus(); + if (execution != null) { + status = execution.getStatus(); + } } // Broke the loop. Check again for a terminal state - if (status.equals(CANCELLED)) { + if (CANCELLED.equals(status)) { // Finished cancelling. Return the original exception logger.debug("Cancel workflow {} completed on deployment {}", workflowId, deploymentId); throw new MsoCloudifyException(-1, "", "", savedException); diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java index 6565db7ebc..b5a97f7559 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java @@ -327,20 +327,24 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin { Integer.parseInt(this.environment.getProperty(pollingMultiplierProp, POLLING_MULTIPLIER_DEFAULT)); int numberOfPollingAttempts = Math.floorDiv((timeoutMinutes * pollingMultiplier), pollingFrequency); Heat heatClient = getHeatClient(cloudSiteId, tenantId); - Stack latestStack = null; while (true) { - latestStack = queryHeatStack(heatClient, stack.getStackName() + "/" + stack.getId()); - statusHandler.updateStackStatus(latestStack); - logger.debug("Polling: {} ({})", latestStack.getStackStatus(), latestStack.getStackName()); - if (stackStatus.equals(latestStack.getStackStatus())) { - if (numberOfPollingAttempts <= 0) { - logger.error("Polling of stack timed out with Status: {}", latestStack.getStackStatus()); + Stack latestStack = queryHeatStack(heatClient, stack.getStackName() + "/" + stack.getId()); + if (latestStack != null) { + statusHandler.updateStackStatus(latestStack); + logger.debug("Polling: {} ({})", latestStack.getStackStatus(), latestStack.getStackName()); + if (stackStatus.equals(latestStack.getStackStatus())) { + if (numberOfPollingAttempts <= 0) { + logger.error("Polling of stack timed out with Status: {}", latestStack.getStackStatus()); + return latestStack; + } + sleep(pollingFrequency * 1000L); + numberOfPollingAttempts -= 1; + } else { return latestStack; } - sleep(pollingFrequency * 1000L); - numberOfPollingAttempts -= 1; } else { - return latestStack; + logger.error("latestStack is null"); + return null; } } } diff --git a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.5.1__Correct_Default_NeutronNetwork.sql b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.5.1__Correct_Default_NeutronNetwork.sql index 5d940fb9ea..8e52fbeeaf 100644 --- a/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.5.1__Correct_Default_NeutronNetwork.sql +++ b/adapters/mso-catalog-db-adapter/src/main/resources/db/migration/V5.5.1__Correct_Default_NeutronNetwork.sql @@ -30,3 +30,8 @@ resources: INSERT INTO `temp_network_heat_template_lookup` (`NETWORK_RESOURCE_MODEL_NAME`, `HEAT_TEMPLATE_ARTIFACT_UUID`,`AIC_VERSION_MIN` , `AIC_VERSION_MAX` ) VALUES ('Generic NeutronNet','efee1d84-b8ec-11e7-abc4-cec278b6b50a','2.0','3.0'); +INSERT INTO `heat_template_params` (`HEAT_TEMPLATE_ARTIFACT_UUID`, `PARAM_NAME`, `IS_REQUIRED`, `PARAM_TYPE`, `PARAM_ALIAS`) +VALUES ('efee1d84-b8ec-11e7-abc4-cec278b6b50a', 'network_name', 0, 'String', NULL); + +INSERT INTO `heat_template_params` (`HEAT_TEMPLATE_ARTIFACT_UUID`, `PARAM_NAME`, `IS_REQUIRED`, `PARAM_TYPE`, `PARAM_ALIAS`) +VALUES ('efee1d84-b8ec-11e7-abc4-cec278b6b50a', 'shared', 0, 'Boolean', NULL); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java index 153de2fb12..afc227faf0 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/network/MsoNetworkAdapterImpl.java @@ -462,13 +462,13 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { } } } + networkRollback.setNeutronNetworkId((String) outputs.get(NETWORK_ID)); } subnetIdMap.value = sMap; rollback.value = networkRollback; // Populate remaining rollback info and response parameters. networkRollback.setNetworkStackId(heatStack.getCanonicalName()); - networkRollback.setNeutronNetworkId((String) heatStack.getOutputs().get(NETWORK_ID)); networkRollback.setNetworkCreated(true); networkRollback.setNetworkType(networkType); @@ -915,7 +915,7 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Use MsoNeutronUtils for all NEUTRON commands String mode; - String neutronId; + String neutronId = null; // Try Heat first, since networks may be named the same as the Heat stack StackInfo heatStack = null; long queryStackStarttime = System.currentTimeMillis(); @@ -931,12 +931,12 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { // Populate the outputs based on the returned Stack information if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND) { // Found it. Get the neutronNetworkId for further query + Map<String, String> sMap = new HashMap<>(); Map<String, Object> outputs = heatStack.getOutputs(); - neutronId = (String) outputs.get(NETWORK_ID); mode = "HEAT"; - - Map<String, String> sMap = new HashMap<>(); if (outputs != null) { + neutronId = (String) outputs.get(NETWORK_ID); + for (String key : outputs.keySet()) { if (key != null && key.startsWith("subnet_id_")) // multiples subnet_%aaid% outputs { @@ -1521,23 +1521,28 @@ public class MsoNetworkAdapterImpl implements MsoNetworkAdapter { logger.debug("Subnet_Ipam Output JSON String:{} {}", obj.getClass(), jStr); JsonNode rootNode = mapper.readTree(jStr); - for (JsonNode sNode : rootNode.path("ipam_subnets")) { - logger.debug("Output Subnet Node {}", sNode.toString()); - String name = sNode.path("subnet_name").textValue(); - String uuid = sNode.path("subnet_uuid").textValue(); - String aaiId = name; // default - // try to find aaiId for name in input subnetList - if (subnets != null) { - for (Subnet subnet : subnets) { - if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName())) { - if (subnet.getSubnetName().equals(name)) { - aaiId = subnet.getSubnetId(); - break; + if (rootNode != null) { + for (JsonNode sNode : rootNode.path("ipam_subnets")) { + logger.debug("Output Subnet Node {}", sNode.toString()); + String name = sNode.path("subnet_name").textValue(); + String uuid = sNode.path("subnet_uuid").textValue(); + String aaiId = name; // default + // try to find aaiId for name in input subnetList + if (subnets != null) { + for (Subnet subnet : subnets) { + if (subnet != null && !commonUtils.isNullOrEmpty(subnet.getSubnetName())) { + if (subnet.getSubnetName().equals(name)) { + aaiId = subnet.getSubnetId(); + break; + } } } } + sMap.put(aaiId, uuid); // bpmn needs aaid to uuid map } - sMap.put(aaiId, uuid); // bpmn needs aaid to uuid map + } else { + logger.error("{} {} null rootNode - cannot get subnet-uuids", MessageEnum.RA_MARSHING_ERROR, + ErrorCode.DataError.getValue()); } } catch (Exception e) { logger.error("{} {} Exception getting subnet-uuids ", MessageEnum.RA_MARSHING_ERROR, diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java index 073412133c..90116ad4f5 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/client/ASDCController.java @@ -742,8 +742,7 @@ public class ASDCController { logger.info("Processing Resource Type: {}, Model UUID: {}", resourceType, resource.getResourceUUID()); - if ("VF".equals(resourceType) && resource.getArtifacts() != null - && !resource.getArtifacts().isEmpty()) { + if ("VF".equals(resourceType)) { resourceStructure = new VfResourceStructure(iNotif, resource); } else if ("PNF".equals(resourceType)) { resourceStructure = new PnfResourceStructure(iNotif, resource); @@ -761,8 +760,8 @@ public class ASDCController { logger.debug("Processing Resource Type: " + resourceType + " and Model UUID: " + resourceStructure.getResourceInstance().getResourceUUID()); - if ("VF".equals(resourceType) && resource.getArtifacts() != null - && !resource.getArtifacts().isEmpty()) { + + if ("VF".equals(resourceType)) { hasVFResource = true; for (IArtifactInfo artifact : resource.getArtifacts()) { IDistributionClientDownloadResult resultArtifact = diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java index bcb81ba87c..08aee1ab4e 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/installer/heat/ToscaResourceInstaller.java @@ -434,12 +434,20 @@ public class ToscaResourceInstaller { Service service = toscaResourceStruct.getCatalogService(); List<NodeTemplate> vfNodeTemplatesList = toscaResourceStruct.getSdcCsarHelper().getServiceVfList(); - for (NodeTemplate nodeTemplate : vfNodeTemplatesList) { - Metadata metadata = nodeTemplate.getMetaData(); - String vfCustomizationCategory = toscaResourceStruct.getSdcCsarHelper() - .getMetadataPropertyValue(metadata, SdcPropertyNames.PROPERTY_NAME_CATEGORY); - processVfModules(toscaResourceStruct, vfResourceStructure, service, nodeTemplate, metadata, - vfCustomizationCategory); + List<IEntityDetails> vfEntityList = getEntityDetails(toscaResourceStruct, + EntityQuery.newBuilder(SdcTypes.VF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false); + + for (IEntityDetails vfEntityDetails : vfEntityList) { + + Metadata metadata = vfEntityDetails.getMetadata(); + String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY); + + if (ALLOTTED_RESOURCE.equalsIgnoreCase(category)) { + continue; + } + + processVfModules(vfEntityDetails, vfNodeTemplatesList.get(0), toscaResourceStruct, vfResourceStructure, + service, metadata); } processResourceSequence(toscaResourceStruct, service); @@ -631,7 +639,8 @@ public class ToscaResourceInstaller { protected void processNetworks(ToscaResourceStructure toscaResourceStruct, Service service) throws ArtifactInstallerException { - List<IEntityDetails> vlEntityList = getEntityDetails(toscaResourceStruct, SdcTypes.VL, SdcTypes.SERVICE, false); + List<IEntityDetails> vlEntityList = getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder(SdcTypes.VL), + TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false); if (vlEntityList != null) { for (IEntityDetails vlEntity : vlEntityList) { @@ -655,6 +664,8 @@ public class ToscaResourceInstaller { } else { NetworkResourceCustomization networkCustomization = createNetwork(vlEntity, toscaResourceStruct, null, null, null, service); + networkCustomization.setResourceInput( + getResourceInput(toscaResourceStruct, networkCustomization.getModelCustomizationUUID())); service.getNetworkCustomizations().add(networkCustomization); logger.debug("No NetworkResourceName found in TempNetworkHeatTemplateLookup for " + networkResourceModelName); @@ -665,11 +676,14 @@ public class ToscaResourceInstaller { } protected void processAllottedResources(ToscaResourceStructure toscaResourceStruct, Service service, - List<NodeTemplate> allottedResourceList) { + List<NodeTemplate> allottedResourceList) throws ArtifactInstallerException { if (allottedResourceList != null) { for (NodeTemplate allottedNode : allottedResourceList) { - service.getAllottedCustomizations() - .add(createAllottedResource(allottedNode, toscaResourceStruct, service)); + AllottedResourceCustomization allottedResource = + createAllottedResource(allottedNode, toscaResourceStruct, service); + allottedResource.setResourceInput( + getResourceInput(toscaResourceStruct, allottedResource.getModelCustomizationUUID())); + service.getAllottedCustomizations().add(allottedResource); } } } @@ -954,17 +968,21 @@ public class ToscaResourceInstaller { return String.valueOf(value); } - protected void processVfModules(ToscaResourceStructure toscaResourceStruct, VfResourceStructure vfResourceStructure, - Service service, NodeTemplate nodeTemplate, Metadata metadata, String vfCustomizationCategory) - throws Exception { + protected void processVfModules(IEntityDetails vfEntityDetails, NodeTemplate nodeTemplate, + ToscaResourceStructure toscaResourceStruct, VfResourceStructure vfResourceStructure, Service service, + Metadata metadata) throws Exception { + + String vfCustomizationCategory = + vfEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY); logger.debug("VF Category is : " + vfCustomizationCategory); if (vfResourceStructure.getVfModuleStructure() != null && !vfResourceStructure.getVfModuleStructure().isEmpty()) { - String vfCustomizationUUID = toscaResourceStruct.getSdcCsarHelper().getMetadataPropertyValue(metadata, - SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + String vfCustomizationUUID = + vfEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + logger.debug("VFCustomizationUUID=" + vfCustomizationUUID); IResourceInstance vfNotificationResource = vfResourceStructure.getResourceInstance(); @@ -980,7 +998,7 @@ public class ToscaResourceInstaller { logger.debug("vfCustomizationUUID: " + vfCustomizationUUID + " matches vfNotificationResource CustomizationUUID"); - VnfResourceCustomization vnfResource = createVnfResource(nodeTemplate, toscaResourceStruct, service); + VnfResourceCustomization vnfResource = createVnfResource(vfEntityDetails, toscaResourceStruct, service); Set<CvnfcCustomization> existingCvnfcSet = new HashSet<>(); Set<VnfcCustomization> existingVnfcSet = new HashSet<>(); @@ -989,14 +1007,19 @@ public class ToscaResourceInstaller { for (VfModuleStructure vfModuleStructure : vfResourceStructure.getVfModuleStructure()) { logger.debug("vfModuleStructure:" + vfModuleStructure.toString()); - List<org.onap.sdc.toscaparser.api.Group> vfGroups = - toscaResourceStruct.getSdcCsarHelper().getVfModulesByVf(vfCustomizationUUID); + + List<IEntityDetails> vfModuleEntityList = + getEntityDetails(toscaResourceStruct, + EntityQuery.newBuilder("org.openecomp.groups.VfModule"), TopologyTemplateQuery + .newBuilder(SdcTypes.SERVICE).customizationUUID(vfCustomizationUUID), + false); + IVfModuleData vfMetadata = vfModuleStructure.getVfModuleMetadata(); logger.debug("Comparing Vf_Modules_Metadata CustomizationUUID : " + vfMetadata.getVfModuleModelCustomizationUUID()); - Optional<org.onap.sdc.toscaparser.api.Group> matchingObject = vfGroups.stream() + Optional<IEntityDetails> matchingObject = vfModuleEntityList.stream() .peek(group -> logger.debug("To Csar Group VFModuleModelCustomizationUUID " + group.getMetadata().getValue("vfModuleModelCustomizationUUID"))) .filter(group -> group.getMetadata().getValue("vfModuleModelCustomizationUUID") @@ -1004,7 +1027,7 @@ public class ToscaResourceInstaller { .findFirst(); if (matchingObject.isPresent()) { VfModuleCustomization vfModuleCustomization = createVFModuleResource(matchingObject.get(), - nodeTemplate, toscaResourceStruct, vfResourceStructure, vfMetadata, vnfResource, + toscaResourceStruct, vfResourceStructure, vfMetadata, vnfResource, service, existingCvnfcSet, existingVnfcSet, existingCvnfcConfigurationCustom); vfModuleCustomization.getVfModule().setVnfResources(vnfResource.getVnfResources()); } else @@ -1017,7 +1040,7 @@ public class ToscaResourceInstaller { // Check for VNFC Instance Group info and add it if there is List<IEntityDetails> vfcEntityList = getEntityDetails(toscaResourceStruct, - "org.openecomp.groups.VfcInstanceGroup", + EntityQuery.newBuilder("org.openecomp.groups.VfcInstanceGroup"), TopologyTemplateQuery.newBuilder(SdcTypes.VF).customizationUUID(vfCustomizationUUID), false); @@ -1349,7 +1372,14 @@ public class ToscaResourceInstaller { Metadata serviceMetadata = toscaResourceStructure.getServiceMetadata(); - Service service = new Service(); + List<Service> services = + serviceRepo.findByModelUUID(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); + Service service; + if (!services.isEmpty() && services.size() > 0) { + service = services.get(0); + } else { + service = new Service(); + } if (serviceMetadata != null) { @@ -1461,7 +1491,14 @@ public class ToscaResourceInstaller { } protected void createToscaCsar(ToscaResourceStructure toscaResourceStructure) { - ToscaCsar toscaCsar = new ToscaCsar(); + Optional<ToscaCsar> toscaCsarOpt = + toscaCsarRepo.findById(toscaResourceStructure.getToscaArtifact().getArtifactUUID()); + ToscaCsar toscaCsar; + if (toscaCsarOpt.isPresent()) { + toscaCsar = toscaCsarOpt.get(); + } else { + toscaCsar = new ToscaCsar(); + } if (toscaResourceStructure.getToscaArtifact().getArtifactChecksum() != null) { toscaCsar.setArtifactChecksum(toscaResourceStructure.getToscaArtifact().getArtifactChecksum()); } else { @@ -1891,9 +1928,10 @@ public class ToscaResourceInstaller { } - List<IEntityDetails> serviceEntityList = - getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.VF).customizationUUID( - vnfResourceCustomization.getModelCustomizationUUID()), SdcTypes.SERVICE, false); + List<IEntityDetails> serviceEntityList = getEntityDetails(toscaResourceStructure, + EntityQuery.newBuilder(SdcTypes.VF) + .customizationUUID(vnfResourceCustomization.getModelCustomizationUUID()), + TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false); if (serviceEntityList != null && !serviceEntityList.isEmpty()) { vfcInstanceGroupCustom.setFunction(getLeafPropertyValue(serviceEntityList.get(0), getInputName)); @@ -1966,22 +2004,26 @@ public class ToscaResourceInstaller { return jsonStr; } - protected VfModuleCustomization createVFModuleResource(Group group, NodeTemplate vfTemplate, + protected VfModuleCustomization createVFModuleResource(IEntityDetails vfModuleEntityDetails, ToscaResourceStructure toscaResourceStructure, VfResourceStructure vfResourceStructure, - IVfModuleData vfModuleData, VnfResourceCustomization vnfResource, Set<CvnfcCustomization> existingCvnfcSet, - Set<VnfcCustomization> existingVnfcSet, + IVfModuleData vfModuleData, VnfResourceCustomization vnfResource, Service service, + Set<CvnfcCustomization> existingCvnfcSet, Set<VnfcCustomization> existingVnfcSet, List<CvnfcConfigurationCustomization> existingCvnfcConfigurationCustom) { VfModuleCustomization vfModuleCustomization = findExistingVfModuleCustomization(vnfResource, vfModuleData.getVfModuleModelCustomizationUUID()); + if (vfModuleCustomization == null) { + VfModule vfModule = findExistingVfModule(vnfResource, - vfTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); - Metadata vfMetadata = group.getMetadata(); + vfModuleEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); + + Metadata vfMetadata = vfModuleEntityDetails.getMetadata(); if (vfModule == null) - vfModule = createVfModule(group, toscaResourceStructure, vfModuleData, vfMetadata); + vfModule = createVfModule(vfModuleEntityDetails, toscaResourceStructure, vfModuleData, vfMetadata); - vfModuleCustomization = createVfModuleCustomization(group, toscaResourceStructure, vfModule, vfModuleData); + vfModuleCustomization = + createVfModuleCustomization(vfModuleEntityDetails, toscaResourceStructure, vfModule, vfModuleData); vfModuleCustomization.setVnfCustomization(vnfResource); setHeatInformationForVfModule(toscaResourceStructure, vfResourceStructure, vfModule, vfModuleCustomization, vfMetadata); @@ -2001,38 +2043,48 @@ public class ToscaResourceInstaller { Set<VnfcCustomization> vnfcCustomizations = new HashSet<>(); // Only set the CVNFC if this vfModule group is a member of it. - List<NodeTemplate> groupMembers = - toscaResourceStructure.getSdcCsarHelper().getMembersOfVfModule(vfTemplate, group); - String vfModuleMemberName = null; - for (NodeTemplate node : groupMembers) { - vfModuleMemberName = node.getName(); - } + List<IEntityDetails> groupMembers = getEntityDetails(toscaResourceStructure, + EntityQuery.newBuilder("org.openecomp.groups.VfModule") + .uUID(vfModuleCustomization.getVfModule().getModelUUID()), + TopologyTemplateQuery.newBuilder(SdcTypes.VF), false); + + String vfModuleMemberName = null; // Extract CVFC lists - List<IEntityDetails> cvnfcEntityList = - getEntityDetails(toscaResourceStructure, SdcTypes.CVFC, SdcTypes.VF, false); + List<IEntityDetails> cvnfcEntityList = getEntityDetails(toscaResourceStructure, + EntityQuery.newBuilder(SdcTypes.CVFC), TopologyTemplateQuery.newBuilder(SdcTypes.VF), false); + for (IEntityDetails cvfcEntity : cvnfcEntityList) { boolean cvnfcVfModuleNameMatch = false; - for (NodeTemplate node : groupMembers) { - vfModuleMemberName = node.getName(); + for (IEntityDetails entity : groupMembers) { + + List<IEntityDetails> groupMembersNodes = entity.getMemberNodes(); + for (IEntityDetails groupMember : groupMembersNodes) { + + vfModuleMemberName = groupMember.getName(); + + if (vfModuleMemberName.equalsIgnoreCase(cvfcEntity.getName())) { + cvnfcVfModuleNameMatch = true; + break; + } - if (vfModuleMemberName.equalsIgnoreCase(cvfcEntity.getName())) { - cvnfcVfModuleNameMatch = true; - break; } } + if (vfModuleMemberName != null && cvnfcVfModuleNameMatch) { // Extract associated VFC - Should always be just one - List<IEntityDetails> vfcEntityList = getEntityDetails(toscaResourceStructure, SdcTypes.VFC, + List<IEntityDetails> vfcEntityList = getEntityDetails(toscaResourceStructure, + EntityQuery.newBuilder(SdcTypes.VFC), TopologyTemplateQuery.newBuilder(SdcTypes.CVFC).customizationUUID( cvfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)), false); + for (IEntityDetails vfcEntity : vfcEntityList) { VnfcCustomization vnfcCustomization = new VnfcCustomization(); @@ -2107,7 +2159,9 @@ public class ToscaResourceInstaller { // ***************************************************************************************************************************************** List<IEntityDetails> fabricEntityList = - getEntityDetails(toscaResourceStructure, SdcTypes.CONFIGURATION, SdcTypes.VF, false); + getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.CONFIGURATION), + TopologyTemplateQuery.newBuilder(SdcTypes.VF), false); + for (IEntityDetails fabricEntity : fabricEntityList) { @@ -2128,7 +2182,7 @@ public class ToscaResourceInstaller { CvnfcConfigurationCustomization cvnfcConfigurationCustomization = createCvnfcConfigurationCustomization(fabricEntity, toscaResourceStructure, vnfResource, vfModuleCustomization, cvnfcCustomization, fabricConfig, - vfTemplate, vfModuleMemberName); + vfModuleMemberName); cvnfcConfigurationCustomizations.add(cvnfcConfigurationCustomization); @@ -2153,7 +2207,7 @@ public class ToscaResourceInstaller { protected CvnfcConfigurationCustomization createCvnfcConfigurationCustomization(IEntityDetails fabricEntity, ToscaResourceStructure toscaResourceStruct, VnfResourceCustomization vnfResource, VfModuleCustomization vfModuleCustomization, CvnfcCustomization cvnfcCustomization, - ConfigurationResource configResource, NodeTemplate vfTemplate, String vfModuleMemberName) { + ConfigurationResource configResource, String vfModuleMemberName) { Metadata fabricMetadata = fabricEntity.getMetadata(); @@ -2168,7 +2222,9 @@ public class ToscaResourceInstaller { cvnfcConfigurationCustomization.setModelInstanceName(fabricEntity.getName()); List<IEntityDetails> policyList = - getEntityDetails(toscaResourceStruct, "org.openecomp.policies.External", SdcTypes.VF, true); + getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder("org.openecomp.policies.External"), + TopologyTemplateQuery.newBuilder(SdcTypes.VF), true); + if (policyList != null) { for (IEntityDetails policyEntity : policyList) { @@ -2245,7 +2301,7 @@ public class ToscaResourceInstaller { return vfModule; } - protected VfModuleCustomization createVfModuleCustomization(Group group, + protected VfModuleCustomization createVfModuleCustomization(IEntityDetails vfModuleEntityDetails, ToscaResourceStructure toscaResourceStructure, VfModule vfModule, IVfModuleData vfModuleData) { VfModuleCustomization vfModuleCustomization = new VfModuleCustomization(); @@ -2253,62 +2309,64 @@ public class ToscaResourceInstaller { vfModuleCustomization.setVfModule(vfModule); - String initialCount = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group, - SdcPropertyNames.PROPERTY_NAME_INITIALCOUNT); + String initialCount = getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_INITIALCOUNT); + + if (initialCount != null && initialCount.length() > 0) { vfModuleCustomization.setInitialCount(Integer.valueOf(initialCount)); } - vfModuleCustomization.setInitialCount(Integer.valueOf(toscaResourceStructure.getSdcCsarHelper() - .getGroupPropertyLeafValue(group, SdcPropertyNames.PROPERTY_NAME_INITIALCOUNT))); + String availabilityZoneCount = + getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT); - String availabilityZoneCount = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group, - SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT); if (availabilityZoneCount != null && availabilityZoneCount.length() > 0) { vfModuleCustomization.setAvailabilityZoneCount(Integer.valueOf(availabilityZoneCount)); } - vfModuleCustomization.setLabel(toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group, - SdcPropertyNames.PROPERTY_NAME_VFMODULELABEL)); + vfModuleCustomization + .setLabel(getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_VFMODULELABEL)); + + String maxInstances = + getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_MAXVFMODULEINSTANCES); - String maxInstances = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group, - SdcPropertyNames.PROPERTY_NAME_MAXVFMODULEINSTANCES); if (maxInstances != null && maxInstances.length() > 0) { vfModuleCustomization.setMaxInstances(Integer.valueOf(maxInstances)); } - String minInstances = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group, - SdcPropertyNames.PROPERTY_NAME_MINVFMODULEINSTANCES); + String minInstances = + getLeafPropertyValue(vfModuleEntityDetails, SdcPropertyNames.PROPERTY_NAME_MINVFMODULEINSTANCES); + if (minInstances != null && minInstances.length() > 0) { vfModuleCustomization.setMinInstances(Integer.valueOf(minInstances)); } return vfModuleCustomization; } - protected VfModule createVfModule(Group group, ToscaResourceStructure toscaResourceStructure, + protected VfModule createVfModule(IEntityDetails groupEntityDetails, ToscaResourceStructure toscaResourceStructure, IVfModuleData vfModuleData, Metadata vfMetadata) { VfModule vfModule = new VfModule(); String vfModuleModelUUID = vfModuleData.getVfModuleModelUUID(); if (vfModuleModelUUID == null) { - vfModuleModelUUID = testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, - SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); + + vfModuleModelUUID = testNull( + groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)); + } else if (vfModuleModelUUID.indexOf('.') > -1) { vfModuleModelUUID = vfModuleModelUUID.substring(0, vfModuleModelUUID.indexOf('.')); } - vfModule.setModelInvariantUUID(testNull(toscaResourceStructure.getSdcCsarHelper() - .getMetadataPropertyValue(vfMetadata, SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID))); - vfModule.setModelName(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, - SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELNAME))); + vfModule.setModelInvariantUUID( + groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)); + vfModule.setModelName( + groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELNAME)); vfModule.setModelUUID(vfModuleModelUUID); - vfModule.setModelVersion(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, - SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION))); - vfModule.setDescription(testNull(toscaResourceStructure.getSdcCsarHelper().getMetadataPropertyValue(vfMetadata, - SdcPropertyNames.PROPERTY_NAME_DESCRIPTION))); + vfModule.setModelVersion( + groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)); + vfModule.setDescription(groupEntityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)); + + String vfModuleType = getLeafPropertyValue(groupEntityDetails, SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE); - String vfModuleType = toscaResourceStructure.getSdcCsarHelper().getGroupPropertyLeafValue(group, - SdcPropertyNames.PROPERTY_NAME_VFMODULETYPE); if (vfModuleType != null && "Base".equalsIgnoreCase(vfModuleType)) { vfModule.setIsBase(true); } else { @@ -2413,19 +2471,20 @@ public class ToscaResourceInstaller { } } - protected VnfResourceCustomization createVnfResource(NodeTemplate vfNodeTemplate, + protected VnfResourceCustomization createVnfResource(IEntityDetails entityDetails, ToscaResourceStructure toscaResourceStructure, Service service) throws ArtifactInstallerException { VnfResourceCustomization vnfResourceCustomization = null; if (vnfResourceCustomization == null) { + VnfResource vnfResource = findExistingVnfResource(service, - vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); + entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)); if (vnfResource == null) { - vnfResource = createVnfResource(vfNodeTemplate); + vnfResource = createVnfResource(entityDetails); } vnfResourceCustomization = - createVnfResourceCustomization(vfNodeTemplate, toscaResourceStructure, vnfResource); + createVnfResourceCustomization(entityDetails, toscaResourceStructure, vnfResource); vnfResourceCustomization.setVnfResources(vnfResource); vnfResourceCustomization.setService(service); @@ -2452,61 +2511,56 @@ public class ToscaResourceInstaller { return vnfResource; } - protected VnfResourceCustomization createVnfResourceCustomization(NodeTemplate vfNodeTemplate, + protected VnfResourceCustomization createVnfResourceCustomization(IEntityDetails entityDetails, ToscaResourceStructure toscaResourceStructure, VnfResource vnfResource) { VnfResourceCustomization vnfResourceCustomization = new VnfResourceCustomization(); vnfResourceCustomization.setModelCustomizationUUID( - testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID))); - vnfResourceCustomization.setModelInstanceName(vfNodeTemplate.getName()); + entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)); - vnfResourceCustomization.setNfFunction(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION))); - vnfResourceCustomization.setNfNamingCode(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, "nf_naming_code"))); - vnfResourceCustomization.setNfRole(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFROLE))); - vnfResourceCustomization.setNfType(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_NFTYPE))); + vnfResourceCustomization.setModelInstanceName(entityDetails.getName()); + vnfResourceCustomization + .setNfFunction(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION)); + vnfResourceCustomization.setNfNamingCode(getLeafPropertyValue(entityDetails, "nf_naming_code")); + vnfResourceCustomization.setNfRole(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFROLE)); + vnfResourceCustomization.setNfType(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_NFTYPE)); - vnfResourceCustomization.setMultiStageDesign(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, MULTI_STAGE_DESIGN)); + vnfResourceCustomization.setMultiStageDesign(getLeafPropertyValue(entityDetails, MULTI_STAGE_DESIGN)); + vnfResourceCustomization.setBlueprintName(getLeafPropertyValue(entityDetails, SDNC_MODEL_NAME)); + vnfResourceCustomization.setBlueprintVersion(getLeafPropertyValue(entityDetails, SDNC_MODEL_VERSION)); - vnfResourceCustomization.setBlueprintName(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SDNC_MODEL_NAME))); + String skipPostInstConfText = getLeafPropertyValue(entityDetails, SKIP_POST_INST_CONF); - vnfResourceCustomization.setBlueprintVersion(testNull(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SDNC_MODEL_VERSION))); - - String skipPostInstConfText = toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SKIP_POST_INST_CONF); if (skipPostInstConfText != null) { - vnfResourceCustomization.setSkipPostInstConf(Boolean.parseBoolean(skipPostInstConfText)); + vnfResourceCustomization.setSkipPostInstConf( + Boolean.parseBoolean(getLeafPropertyValue(entityDetails, SKIP_POST_INST_CONF))); } + vnfResourceCustomization.setVnfResources(vnfResource); vnfResourceCustomization.setAvailabilityZoneMaxCount(Integer.getInteger( - vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT))); + entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_AVAILABILITYZONECOUNT))); + + entityDetails.getCapabilities().get(SCALABLE); - CapabilityAssignments vnfCustomizationCapability = - toscaResourceStructure.getSdcCsarHelper().getCapabilitiesOf(vfNodeTemplate); - if (vnfCustomizationCapability != null) { - CapabilityAssignment capAssign = vnfCustomizationCapability.getCapabilityByName(SCALABLE); + if (entityDetails.getCapabilities() != null) { + + CapabilityAssignment capAssign = entityDetails.getCapabilities().get(SCALABLE); if (capAssign != null) { - vnfResourceCustomization.setMinInstances(Integer.getInteger(toscaResourceStructure.getSdcCsarHelper() - .getCapabilityPropertyLeafValue(capAssign, SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); - vnfResourceCustomization.setMaxInstances(Integer.getInteger(toscaResourceStructure.getSdcCsarHelper() - .getCapabilityPropertyLeafValue(capAssign, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); + vnfResourceCustomization.setMinInstances(Integer + .getInteger(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); + vnfResourceCustomization.setMaxInstances(Integer + .getInteger(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); } } if (vnfResourceCustomization.getMinInstances() == null && vnfResourceCustomization.getMaxInstances() == null) { - vnfResourceCustomization.setMinInstances(Integer.getInteger(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); - vnfResourceCustomization.setMaxInstances(Integer.getInteger(toscaResourceStructure.getSdcCsarHelper() - .getNodeTemplatePropertyLeafValue(vfNodeTemplate, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); + vnfResourceCustomization.setMinInstances(Integer + .getInteger(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); + vnfResourceCustomization.setMaxInstances(Integer + .getInteger(getLeafPropertyValue(entityDetails, SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); } toscaResourceStructure.setCatalogVnfResourceCustomization(vnfResourceCustomization); @@ -2514,25 +2568,25 @@ public class ToscaResourceInstaller { return vnfResourceCustomization; } - protected VnfResource createVnfResource(NodeTemplate vfNodeTemplate) { + protected VnfResource createVnfResource(IEntityDetails entityDetails) { VnfResource vnfResource = new VnfResource(); vnfResource.setModelInvariantUUID( - testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID))); - vnfResource.setModelName(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_NAME))); - vnfResource.setModelUUID(testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_UUID))); + testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID))); + vnfResource.setModelName(testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME))); + vnfResource.setModelUUID(testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID))); vnfResource.setModelVersion( - testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION))); + testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION))); vnfResource.setDescription( - testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION))); + testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION))); vnfResource.setOrchestrationMode(HEAT); - vnfResource.setToscaNodeType(testNull(vfNodeTemplate.getType())); + vnfResource.setToscaNodeType(testNull(entityDetails.getToscaType())); vnfResource.setAicVersionMax( - testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); + testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES))); vnfResource.setAicVersionMin( - testNull(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); - vnfResource.setCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)); - vnfResource.setSubCategory(vfNodeTemplate.getMetaData().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)); + testNull(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES))); + vnfResource.setCategory(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)); + vnfResource.setSubCategory(entityDetails.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)); return vnfResource; } @@ -2707,59 +2761,11 @@ public class ToscaResourceInstaller { + vfModuleStructure.getVfModuleMetadata().getVfModuleModelName(); } - protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, SdcTypes entityType, - SdcTypes topologyTemplate, boolean nestedSearch) { - - EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build(); - TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(topologyTemplate).build(); - List<IEntityDetails> entityDetails = - toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch); - - return entityDetails; - - } - - protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, String entityType, - SdcTypes topologyTemplate, boolean nestedSearch) { - - EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build(); - TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(topologyTemplate).build(); - List<IEntityDetails> entityDetails = - toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch); - - return entityDetails; - - } - - protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, String entityType, - TopologyTemplateQueryBuilder topologyTemplateBuilder, boolean nestedSearch) { - - EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build(); - TopologyTemplateQuery topologyTemplateQuery = topologyTemplateBuilder.build(); - List<IEntityDetails> entityDetails = - toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch); - - return entityDetails; - - } - - protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, SdcTypes entityType, - TopologyTemplateQueryBuilder topologyTemplateBuilder, boolean nestedSearch) { - - EntityQuery entityQuery = EntityQuery.newBuilder(entityType).build(); - TopologyTemplateQuery topologyTemplateQuery = topologyTemplateBuilder.build(); - List<IEntityDetails> entityDetails = - toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch); - - return entityDetails; - - } - protected List<IEntityDetails> getEntityDetails(ToscaResourceStructure toscaResourceStruct, - EntityQueryBuilder entityType, SdcTypes topologyTemplate, boolean nestedSearch) { + EntityQueryBuilder entityType, TopologyTemplateQueryBuilder topologyTemplateBuilder, boolean nestedSearch) { EntityQuery entityQuery = entityType.build(); - TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(topologyTemplate).build(); + TopologyTemplateQuery topologyTemplateQuery = topologyTemplateBuilder.build(); List<IEntityDetails> entityDetails = toscaResourceStruct.getSdcCsarHelper().getEntity(entityQuery, topologyTemplateQuery, nestedSearch); @@ -2799,8 +2805,10 @@ public class ToscaResourceInstaller { if (!services.isEmpty()) { // service exist in db Service existingService = services.get(0); - List<VnfResourceCustomization> vnfCustomizations = existingService.getVnfCustomizations(); - vnfCustomizations.forEach(e -> service.getVnfCustomizations().add(e)); + List<VnfResourceCustomization> existingVnfCustomizations = existingService.getVnfCustomizations(); + if (existingService != null) { + service.getVnfCustomizations().addAll(existingVnfCustomizations); + } } service.getVnfCustomizations().add(vnfResourceCustomization); } diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java index 2c520a3bba..cfcf5ac599 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/client/test/rest/ASDCRestInterfaceTest.java @@ -144,6 +144,7 @@ public class ASDCRestInterfaceTest extends BaseTest { AllottedResourceCustomization arCustomization = new AllottedResourceCustomization(); arCustomization.setModelCustomizationUUID("f62bb612-c5d4-4406-865c-0abec30631ba"); arCustomization.setModelInstanceName("rege1802pnf 0"); + arCustomization.setResourceInput("{}"); arCustomizationSet.add(arCustomization); arCustomization.setAllottedResource(expectedService); @@ -164,7 +165,7 @@ public class ASDCRestInterfaceTest extends BaseTest { @Test @Transactional - public void test_VFW_Distrobution() throws Exception { + public void test_VFW_Distribution() throws Exception { wireMockServer.stubFor(post(urlPathMatching("/aai/.*")) .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json"))); @@ -290,6 +291,30 @@ public class ASDCRestInterfaceTest extends BaseTest { assertEquals("Generic NeutronNet", networkResource.get().getModelName()); } + @Test + public void test_CCVPN_Distribution() throws Exception { + wireMockServer.stubFor(post(urlPathMatching("/aai/.*")) + .willReturn(aResponse().withStatus(200).withHeader("Content-Type", "application/json"))); + + wireMockServer.stubFor(post(urlPathMatching("/v1.0/activity-spec")) + .willReturn(aResponse().withHeader("Content-Type", "application/json") + .withStatus(org.springframework.http.HttpStatus.ACCEPTED.value()))); + + String resourceLocation = "src/test/resources/resource-examples/ccvpn/"; + ObjectMapper mapper = new ObjectMapper(); + NotificationDataImpl request = mapper.readValue(new File(resourceLocation + "demo-ccvpn-notification.json"), + NotificationDataImpl.class); + headers.add("resource-location", resourceLocation); + HttpEntity<NotificationDataImpl> entity = new HttpEntity<NotificationDataImpl>(request, headers); + ResponseEntity<String> response = restTemplate.exchange(createURLWithPort("test/treatNotification/v1"), + HttpMethod.POST, entity, String.class); + assertEquals(Response.Status.OK.getStatusCode(), response.getStatusCode().value()); + + Optional<Service> service = serviceRepo.findById("5c4d4793-67fb-4155-b7d8-60ec011138c9"); + assertTrue(service.isPresent()); + assertEquals("SDWAN", service.get().getModelName()); + } + protected String createURLWithPort(String uri) { return "http://localhost:" + port + uri; } diff --git a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java index 7534ea645a..ffad137ad7 100644 --- a/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java +++ b/asdc-controller/src/test/java/org/onap/so/asdc/installer/heat/ToscaResourceInstallerTest.java @@ -25,16 +25,19 @@ import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertTrue; +import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.doReturn; import static org.mockito.Mockito.doThrow; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; import java.lang.reflect.Method; import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; import java.util.List; +import java.util.Map; import java.util.Optional; import org.hibernate.exception.LockAcquisitionException; import org.junit.Before; @@ -54,26 +57,38 @@ import org.onap.sdc.toscaparser.api.Group; import org.onap.sdc.toscaparser.api.NodeTemplate; import org.onap.sdc.toscaparser.api.RequirementAssignment; import org.onap.sdc.toscaparser.api.RequirementAssignments; +import org.onap.sdc.toscaparser.api.SubstitutionMappings; import org.onap.sdc.toscaparser.api.elements.Metadata; import org.onap.sdc.toscaparser.api.elements.StatefulEntityType; +import org.onap.sdc.toscaparser.api.parameters.Input; import org.onap.sdc.utils.DistributionStatusEnum; import org.onap.so.asdc.BaseTest; +import org.onap.so.asdc.client.ResourceInstance; import org.onap.so.asdc.client.exceptions.ArtifactInstallerException; import org.onap.so.asdc.client.test.emulators.ArtifactInfoImpl; import org.onap.so.asdc.client.test.emulators.JsonStatusData; import org.onap.so.asdc.client.test.emulators.NotificationDataImpl; +import org.onap.so.asdc.installer.IVfModuleData; import org.onap.so.asdc.installer.ResourceStructure; import org.onap.so.asdc.installer.ToscaResourceStructure; +import org.onap.so.asdc.installer.VfModuleStructure; +import org.onap.so.asdc.installer.VfResourceStructure; +import org.onap.so.asdc.installer.bpmn.WorkflowResource; import org.onap.so.db.catalog.beans.ConfigurationResource; import org.onap.so.db.catalog.beans.ConfigurationResourceCustomization; import org.onap.so.db.catalog.beans.Service; import org.onap.so.db.catalog.beans.ServiceProxyResourceCustomization; import org.onap.so.db.catalog.beans.ToscaCsar; +import org.onap.so.db.catalog.beans.VnfcInstanceGroupCustomization; import org.onap.so.db.catalog.data.repository.AllottedResourceCustomizationRepository; import org.onap.so.db.catalog.data.repository.AllottedResourceRepository; import org.onap.so.db.catalog.data.repository.ConfigurationResourceCustomizationRepository; +import org.onap.so.db.catalog.data.repository.InstanceGroupRepository; import org.onap.so.db.catalog.data.repository.ServiceRepository; import org.onap.so.db.catalog.data.repository.ToscaCsarRepository; +import org.onap.so.db.catalog.data.repository.VFModuleRepository; +import org.onap.so.db.catalog.data.repository.VnfResourceRepository; +import org.onap.so.db.catalog.data.repository.VnfcInstanceGroupCustomizationRepository; import org.onap.so.db.request.beans.WatchdogComponentDistributionStatus; import org.onap.so.db.request.data.repository.WatchdogComponentDistributionStatusRepository; import org.springframework.beans.factory.annotation.Autowired; @@ -111,6 +126,8 @@ public class ToscaResourceInstallerTest extends BaseTest { @Mock private ToscaResourceStructure toscaResourceStructure; @Mock + private VfResourceStructure vfResourceStruct; + @Mock private ServiceProxyResourceCustomization spResourceCustomization; @Mock private ISdcCsarHelper csarHelper; @@ -258,6 +275,206 @@ public class ToscaResourceInstallerTest extends BaseTest { } @Test + public void installTheResourceWithGroupAndVFModulesTest() throws Exception { + ToscaResourceInstaller toscaInstaller = new ToscaResourceInstaller(); + ToscaResourceStructure toscaResourceStructObj = prepareToscaResourceStructure(true, toscaInstaller); + + toscaInstaller.installTheResource(toscaResourceStructObj, vfResourceStruct); + assertEquals(true, toscaResourceStructObj.isDeployedSuccessfully()); + } + + @Test + public void installTheResourceGroupWithoutVFModulesTest() throws Exception { + ToscaResourceInstaller toscaInstaller = new ToscaResourceInstaller(); + ToscaResourceStructure toscaResourceStructObj = prepareToscaResourceStructure(false, toscaInstaller); + + toscaInstaller.installTheResource(toscaResourceStructObj, vfResourceStruct); + assertEquals(true, toscaResourceStructObj.isDeployedSuccessfully()); + } + + private ToscaResourceStructure prepareToscaResourceStructure(boolean prepareVFModuleStructures, + ToscaResourceInstaller toscaInstaller) throws ArtifactInstallerException { + + Metadata metadata = mock(Metadata.class); + IResourceInstance resourceInstance = mock(ResourceInstance.class); + NodeTemplate nodeTemplate = mock(NodeTemplate.class); + ISdcCsarHelper csarHelper = mock(SdcCsarHelperImpl.class); + + IArtifactInfo inputCsar = mock(IArtifactInfo.class); + String artifactUuid = "0122c05e-e13a-4c63-b5d2-475ccf23aa74"; + String checkSum = "MGUzNjJjMzk3OTBkYzExYzQ0MDg2ZDc2M2E3ZjZiZmY="; + + doReturn(checkSum).when(inputCsar).getArtifactChecksum(); + doReturn(artifactUuid).when(inputCsar).getArtifactUUID(); + doReturn("1.0").when(inputCsar).getArtifactVersion(); + doReturn("TestCsarWithGroupAndVFModule").when(inputCsar).getArtifactName(); + doReturn("Test Csar data with Group and VF module inputs").when(inputCsar).getArtifactDescription(); + doReturn("http://localhost/dummy/url/test.csar").when(inputCsar).getArtifactURL(); + + ToscaResourceStructure toscaResourceStructObj = new ToscaResourceStructure(); + toscaResourceStructObj.setToscaArtifact(inputCsar); + + ToscaCsarRepository toscaCsarRepo = spy(ToscaCsarRepository.class); + + + ToscaCsar toscaCsar = mock(ToscaCsar.class); + Optional<ToscaCsar> returnValue = Optional.of(toscaCsar); + doReturn(artifactUuid).when(toscaCsar).getArtifactUUID(); + doReturn(checkSum).when(toscaCsar).getArtifactChecksum(); + doReturn(returnValue).when(toscaCsarRepo).findById(artifactUuid); + + ReflectionTestUtils.setField(toscaInstaller, "toscaCsarRepo", toscaCsarRepo); + + NotificationDataImpl notificationData = new NotificationDataImpl(); + notificationData.setDistributionID("testStatusSuccessfulTosca"); + notificationData.setServiceVersion("1234567"); + notificationData.setServiceUUID("serviceUUID1"); + notificationData.setWorkloadContext("workloadContext1"); + + + + String serviceType = "test-type1"; + String serviceRole = "test-role1"; + String category = "Network L3+"; + String description = "Customer Orderable service description"; + String name = "Customer_Orderable_Service"; + String uuid = "72db5868-4575-4804-b546-0b0d3c3b5ac6"; + String invariantUUID = "6f30bbe3-4590-4185-a7e0-4f9610926c6f"; + String namingPolicy = "naming Policy1"; + String ecompGeneratedNaming = "true"; + String environmentContext = "General_Revenue-Bearing1"; + String resourceCustomizationUUID = "0177ba22-5547-4e4e-bcf8-178f7f71de3a"; + + doReturn(serviceType).when(metadata).getValue("serviceType"); + doReturn(serviceRole).when(metadata).getValue("serviceRole"); + + doReturn(category).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY); + doReturn(description).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION); + doReturn("1.0").when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_VERSION); + doReturn(name).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_NAME); + + doReturn(uuid).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_UUID); + + doReturn(environmentContext).when(metadata).getValue(metadata.getValue("environmentContext")); + doReturn(invariantUUID).when(metadata).getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID); + doReturn(namingPolicy).when(metadata).getValue("namingPolicy"); + doReturn(ecompGeneratedNaming).when(metadata).getValue("ecompGeneratedNaming"); + doReturn(resourceCustomizationUUID).when(metadata).getValue("vfModuleModelCustomizationUUID"); + + ServiceRepository serviceRepo = spy(ServiceRepository.class); + + VnfResourceRepository vnfRepo = spy(VnfResourceRepository.class); + doReturn(null).when(vnfRepo).findResourceByModelUUID(uuid); + + VFModuleRepository vfModuleRepo = spy(VFModuleRepository.class); + InstanceGroupRepository instanceGroupRepo = spy(InstanceGroupRepository.class); + + WorkflowResource workflowResource = spy(WorkflowResource.class); + + ReflectionTestUtils.setField(toscaInstaller, "serviceRepo", serviceRepo); + ReflectionTestUtils.setField(toscaInstaller, "vnfRepo", vnfRepo); + ReflectionTestUtils.setField(toscaInstaller, "vfModuleRepo", vfModuleRepo); + ReflectionTestUtils.setField(toscaInstaller, "instanceGroupRepo", instanceGroupRepo); + ReflectionTestUtils.setField(toscaInstaller, "workflowResource", workflowResource); + + // doReturn(csarHelper).when(toscaResourceStructure).getSdcCsarHelper(); + toscaResourceStructObj.setSdcCsarHelper(csarHelper); + doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate, + SdcPropertyNames.PROPERTY_NAME_NFFUNCTION); + doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate, + SdcPropertyNames.PROPERTY_NAME_NFROLE); + doReturn(null).when(csarHelper).getNodeTemplatePropertyLeafValue(nodeTemplate, + SdcPropertyNames.PROPERTY_NAME_NFTYPE); + doReturn(resourceCustomizationUUID).when(csarHelper).getMetadataPropertyValue(metadata, + SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID); + doReturn(uuid).when(csarHelper).getMetadataPropertyValue(metadata, + SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID); + + + // vnfc instance group list + List<Group> vnfcInstanceGroupList = new ArrayList<>(); + Group vnfcG1 = mock(Group.class); + Map<String, Object> metaProperties = new HashMap<>(); + metaProperties.put(SdcPropertyNames.PROPERTY_NAME_UUID, "vnfc_group1_uuid"); + metaProperties.put(SdcPropertyNames.PROPERTY_NAME_NAME, "vnfc_group1_uuid"); + metaProperties.put(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID, "vnfc_group1_invariantid"); + metaProperties.put(SdcPropertyNames.PROPERTY_NAME_VERSION, "1.0"); + Metadata vnfcmetadata = new Metadata(metaProperties); + + doReturn(vnfcmetadata).when(vnfcG1).getMetadata(); + ArrayList<NodeTemplate> memberList = new ArrayList(); + doReturn(memberList).when(vnfcG1).getMemberNodes(); + vnfcInstanceGroupList.add(vnfcG1); + SubstitutionMappings submappings = mock(SubstitutionMappings.class); + doReturn(new ArrayList<Input>()).when(submappings).getInputs(); + doReturn(submappings).when(nodeTemplate).getSubMappingToscaTemplate(); + + doReturn(vnfcInstanceGroupList).when(csarHelper).getGroupsOfOriginOfNodeTemplateByToscaGroupType(nodeTemplate, + "org.openecomp.groups.VfcInstanceGroup"); + + + doReturn(notificationData).when(vfResourceStruct).getNotification(); + doReturn(resourceInstance).when(vfResourceStruct).getResourceInstance(); + + if (prepareVFModuleStructures) { + + // VfModule list + List<Group> vfModuleGroups = new ArrayList<>(); + Group g1 = mock(Group.class); + doReturn(metadata).when(g1).getMetadata(); + vfModuleGroups.add(g1); + + doReturn(vfModuleGroups).when(csarHelper).getVfModulesByVf(resourceCustomizationUUID); + doReturn("1").when(csarHelper).getGroupPropertyLeafValue(g1, SdcPropertyNames.PROPERTY_NAME_INITIALCOUNT); + + doReturn(metadata).when(nodeTemplate).getMetaData(); + List<NodeTemplate> nodeList = new ArrayList<>(); + nodeList.add(nodeTemplate); + doReturn(nodeList).when(csarHelper).getServiceVfList(); + + IVfModuleData moduleMetadata = mock(IVfModuleData.class); + doReturn(name).when(moduleMetadata).getVfModuleModelName(); + doReturn(invariantUUID).when(moduleMetadata).getVfModuleModelInvariantUUID(); + doReturn(Collections.<String>emptyList()).when(moduleMetadata).getArtifacts(); + doReturn(resourceCustomizationUUID).when(moduleMetadata).getVfModuleModelCustomizationUUID(); + doReturn(uuid).when(moduleMetadata).getVfModuleModelUUID(); + doReturn("1.0").when(moduleMetadata).getVfModuleModelVersion(); + + VfModuleStructure moduleStructure = new VfModuleStructure(vfResourceStruct, moduleMetadata); + + List<VfModuleStructure> moduleStructures = new ArrayList<>(); + moduleStructures.add(moduleStructure); + doReturn(moduleStructures).when(vfResourceStruct).getVfModuleStructure(); + } + + toscaResourceStructObj.setServiceMetadata(metadata); + doReturn("resourceInstanceName1").when(resourceInstance).getResourceInstanceName(); + doReturn(resourceCustomizationUUID).when(resourceInstance).getResourceCustomizationUUID(); + doReturn("resourceName1").when(resourceInstance).getResourceName(); + + Service service = toscaInstaller.createService(toscaResourceStructObj, vfResourceStruct); + + assertNotNull(service); + service.setModelVersion("1.0"); + + doReturn(service).when(serviceRepo).save(service); + + WatchdogComponentDistributionStatusRepository watchdogCDStatusRepository = + spy(WatchdogComponentDistributionStatusRepository.class); + ReflectionTestUtils.setField(toscaInstaller, "watchdogCDStatusRepository", watchdogCDStatusRepository); + doReturn(null).when(watchdogCDStatusRepository).save(any(WatchdogComponentDistributionStatus.class)); + + VnfcInstanceGroupCustomizationRepository vnfcInstanceGroupCustomizationRepo = + spy(VnfcInstanceGroupCustomizationRepository.class); + ReflectionTestUtils.setField(toscaInstaller, "vnfcInstanceGroupCustomizationRepo", + vnfcInstanceGroupCustomizationRepo); + doReturn(null).when(vnfcInstanceGroupCustomizationRepo).save(any(VnfcInstanceGroupCustomization.class)); + return toscaResourceStructObj; + } + + + + @Test public void installTheResourceExceptionTest() throws Exception { expectedException.expect(ArtifactInstallerException.class); diff --git a/asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json b/asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json new file mode 100644 index 0000000000..bc7d7d7979 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/ccvpn/demo-ccvpn-notification.json @@ -0,0 +1,57 @@ +{ + "distributionID": "cbc7ab24-7d96-4cb5-949c-f23ada265513", + "serviceName": "SDWAN", + "serviceVersion": "2.0", + "serviceUUID": "5c4d4793-67fb-4155-b7d8-60ec011138c9", + "serviceDescription": "SDWAN Service", + "serviceInvariantUUID": "e830c260-ee21-4830-980c-c802cd9bbb1c", + "resources": [ + { + "resourceInstanceName": "siteVF 0", + "resourceName": "siteVF", + "resourceVersion": "1.0", + "resoucreType": "VF", + "resourceUUID": "2c10d85c-e492-4813-a2d6-d1fab757fe49", + "resourceInvariantUUID": "ed9b1fe5-1e94-4974-a48f-389571837fd6", + "resourceCustomizationUUID": "33de5105-edf3-48cb-bda0-37b2aa2f681f", + "category": "Configuration", + "subcategory": "Configuration", + "artifacts": [] + }, + { + "resourceInstanceName": "vpn 0", + "resourceName": "vpn", + "resourceVersion": "2.0", + "resoucreType": "VF", + "resourceUUID": "235861f1-ea93-4443-94fa-82f29903f54f", + "resourceInvariantUUID": "c4eff5e7-c4fe-4caf-989b-11efc8e42a73", + "resourceCustomizationUUID": "faa89d44-329b-4fcb-a5dc-6e6f84946537", + "category": "Configuration", + "subcategory": "Configuration", + "artifacts": [] + } + ], + "serviceArtifacts": [ + { + "artifactName": "service-Sdwan-template.yml", + "artifactType": "TOSCA_TEMPLATE", + "artifactURL": "/sdc/v1/catalog/services/Sdwan/2.0/artifacts/service-Sdwan-template.yml", + "artifactChecksum": "Zjg4MmJmNzI1MTliYzBiZjA2ZmJjN2EwNzZhZTcxYTQ=", + "artifactDescription": "TOSCA representation of the asset", + "artifactTimeout": 0, + "artifactUUID": "5e7beb91-61f9-4613-8cc5-1d288a624abb", + "artifactVersion": "2" + }, + { + "artifactName": "service-Sdwan-csar.csar", + "artifactType": "TOSCA_CSAR", + "artifactURL": "/service-Sdwan-csar.csar", + "artifactChecksum": "ODA1ZGViMzI0NzIxMmRmNTIzYzE0ZTg5NmExYWFjZTE=", + "artifactDescription": "TOSCA definition package of the asset", + "artifactTimeout": 0, + "artifactUUID": "771ec21a-1d14-4891-a56f-d4e47e2c8c91", + "artifactVersion": "2" + } + ], + "workloadContext": "Production" +}
\ No newline at end of file diff --git a/asdc-controller/src/test/resources/resource-examples/ccvpn/service-Sdwan-csar.csar b/asdc-controller/src/test/resources/resource-examples/ccvpn/service-Sdwan-csar.csar Binary files differnew file mode 100644 index 0000000000..7a508429f8 --- /dev/null +++ b/asdc-controller/src/test/resources/resource-examples/ccvpn/service-Sdwan-csar.csar diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java index 8d02fa3e4f..2c1d36273d 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/common/resource/ResourceRequestBuilder.java @@ -118,7 +118,7 @@ public class ResourceRequestBuilder { logger.info("resource resolved using model uuid"); String uuid = (String) JsonUtils.getJsonValue(eachResource, "resourceUuid"); if ((null != uuid) && uuid.equals(resource.getModelInfo().getModelUuid())) { - logger.info("found resource uuid" + uuid); + logger.info("found resource uuid {}", uuid); String resourceParameters = JsonUtils.getJsonValue(eachResource, "parameters"); locationConstraints = JsonUtils.getJsonValue(resourceParameters, "locationConstraints"); } @@ -133,7 +133,7 @@ public class ResourceRequestBuilder { Map<String, Object> uuiRequestInputs = null; if (JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs") != null) { String uuiRequestInputStr = JsonUtils.getJsonValue(uuiServiceParameters, "requestInputs"); - logger.info("resource input from UUI: " + uuiRequestInputStr); + logger.info("resource input from UUI:{} ", uuiRequestInputStr); if (uuiRequestInputStr == null || uuiRequestInputStr.isEmpty()) { uuiRequestInputStr = "{}"; } @@ -371,7 +371,7 @@ public class ResourceRequestBuilder { int val = Integer.parseInt(inputObj.toString()); return val; } catch (NumberFormatException e) { - logger.warn("Unable to parse to int", e.getMessage()); + logger.warn("Unable to parse to int", e); } } } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java index 433aa0c11a..3cf5a60de7 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java @@ -389,8 +389,11 @@ public class BBInputSetup implements JavaDelegate { String instanceName, ConfigurationResourceKeys configurationResourceKeys, RequestDetails requestDetails) { Configuration configuration = null; for (Configuration configurationTemp : serviceInstance.getConfigurations()) { - if (lookupKeyMap.get(ResourceKey.CONFIGURATION_ID) != null && configurationTemp.getConfigurationId() - .equalsIgnoreCase(lookupKeyMap.get(ResourceKey.CONFIGURATION_ID))) { + if ((bbName.contains("Fabric") && configurationTemp.getConfigurationSubType() != null + && configurationTemp.getConfigurationSubType().equalsIgnoreCase("Fabric Config")) + || (lookupKeyMap.get(ResourceKey.CONFIGURATION_ID) != null && configurationTemp.getConfigurationId() + .equalsIgnoreCase(lookupKeyMap.get(ResourceKey.CONFIGURATION_ID)))) { + lookupKeyMap.put(ResourceKey.CONFIGURATION_ID, configurationTemp.getConfigurationId()); configuration = configurationTemp; org.onap.aai.domain.yang.Configuration aaiConfiguration = bbInputSetupUtils.getAAIConfiguration(configuration.getConfigurationId()); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java index 100887dbbc..729f5c95c4 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/exception/ExceptionBuilder.java @@ -244,9 +244,9 @@ public class ExceptionBuilder { public void processAuditException(DelegateExecutionImpl execution, boolean flowShouldContinue) { logger.debug("Processing Audit Results"); String auditListString = (String) execution.getVariable("auditInventoryResult"); + String processKey = getProcessKey(execution.getDelegateExecution()); if (auditListString != null) { StringBuilder errorMessage = new StringBuilder(); - String processKey = getProcessKey(execution.getDelegateExecution()); try { ExtractPojosForBB extractPojosForBB = getExtractPojosForBB(); VfModule module = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); @@ -302,7 +302,13 @@ public class ExceptionBuilder { } } else { - logger.debug("Unable to process audit results due to auditInventoryResult being null"); + String errorMessage = "Unable to process audit results due to auditInventoryResult being null"; + WorkflowException exception = new WorkflowException(processKey, 400, errorMessage, TargetEntity.SO); + execution.setVariable("WorkflowException", exception); + execution.setVariable("WorkflowExceptionErrorMessage", errorMessage); + logger.info("Outgoing WorkflowException is {}", exception); + logger.info("Throwing MSOWorkflowException"); + throw new BpmnError("AAIInventoryFailure"); } } diff --git a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy index de44caa120..525307a5df 100644 --- a/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy +++ b/bpmn/MSOCommonBPMN/src/test/groovy/org/onap/so/bpmn/common/scripts/MsoGroovyTest.groovy @@ -1,22 +1,22 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * 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========================================================= - */ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * 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.onap.so.bpmn.common.scripts @@ -32,6 +32,7 @@ import org.junit.runner.RunWith import org.mockito.junit.MockitoJUnitRunner import org.onap.aai.domain.yang.GenericVnf import org.onap.so.bpmn.mock.FileUtil +import org.onap.so.client.HttpClient import org.onap.so.client.aai.AAIObjectPlurals import org.onap.so.client.aai.AAIObjectType import org.onap.so.client.aai.AAIResourcesClient @@ -47,54 +48,56 @@ abstract class MsoGroovyTest { @Rule public ExpectedException thrown = ExpectedException.none() - protected ExecutionEntity mockExecution - protected AAIResourcesClient client + protected ExecutionEntity mockExecution + protected AAIResourcesClient client protected AllottedResourceUtils allottedResourceUtils_MOCK - protected final String SEARCH_RESULT_AAI_WITH_RESULTDATA = - FileUtil.readResourceFile("__files/aai/searchResults.json") - protected static final String CLOUD_OWNER = Defaults.CLOUD_OWNER.toString(); - - protected void init(String procName){ - mockExecution = setupMock(procName) - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - client = mock(AAIResourcesClient.class) - } - - protected ExecutionEntity setupMock(String procName) { - ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) - when(mockProcessDefinition.getKey()).thenReturn(procName) - - RepositoryService mockRepositoryService = mock(RepositoryService.class) - when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) - when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn(procName) - when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") - - ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) - when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) - - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) - - return mockExecution - } - - protected ExecutionEntity setupMockWithPrefix(String procName, String prefix) { - ExecutionEntity mockExecution = mock(ExecutionEntity.class) - - when(mockExecution.getVariable("prefix")).thenReturn(prefix) - - ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class) - RepositoryService repositoryService = mock(RepositoryService.class) - ProcessDefinition processDefinition = mock(ProcessDefinition.class) - - when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices) - when(processEngineServices.getRepositoryService()).thenReturn(repositoryService) - when(repositoryService.getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(processDefinition) - when(processDefinition.getKey()).thenReturn(procName) - when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") - return mockExecution - } - + protected final String SEARCH_RESULT_AAI_WITH_RESULTDATA = + FileUtil.readResourceFile("__files/aai/searchResults.json") + protected static final String CLOUD_OWNER = Defaults.CLOUD_OWNER.toString(); + + protected void init(String procName){ + mockExecution = setupMock(procName) + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + client = mock(AAIResourcesClient.class) + } + + protected ExecutionEntity setupMock(String procName) { + ProcessDefinition mockProcessDefinition = mock(ProcessDefinition.class) + when(mockProcessDefinition.getKey()).thenReturn(procName) + + RepositoryService mockRepositoryService = mock(RepositoryService.class) + when(mockRepositoryService.getProcessDefinition()).thenReturn(mockProcessDefinition) + when(mockRepositoryService.getProcessDefinition().getKey()).thenReturn(procName) + when(mockRepositoryService.getProcessDefinition().getId()).thenReturn("100") + + ProcessEngineServices mockProcessEngineServices = mock(ProcessEngineServices.class) + when(mockProcessEngineServices.getRepositoryService()).thenReturn(mockRepositoryService) + + ExecutionEntity mockExecution = mock(ExecutionEntity.class) + when(mockExecution.getProcessEngineServices()).thenReturn(mockProcessEngineServices) + + HttpClient httpClient = mock(HttpClient.class) + + return mockExecution + } + + protected ExecutionEntity setupMockWithPrefix(String procName, String prefix) { + ExecutionEntity mockExecution = mock(ExecutionEntity.class) + + when(mockExecution.getVariable("prefix")).thenReturn(prefix) + + ProcessEngineServices processEngineServices = mock(ProcessEngineServices.class) + RepositoryService repositoryService = mock(RepositoryService.class) + ProcessDefinition processDefinition = mock(ProcessDefinition.class) + + when(mockExecution.getProcessEngineServices()).thenReturn(processEngineServices) + when(processEngineServices.getRepositoryService()).thenReturn(repositoryService) + when(repositoryService.getProcessDefinition(mockExecution.getProcessDefinitionId())).thenReturn(processDefinition) + when(processDefinition.getKey()).thenReturn(procName) + when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true") + return mockExecution + } + protected <T> Optional<T> getAAIObjectFromJson(Class<T> clazz , String file){ String json = FileUtil.readResourceFile(file) AAIResultWrapper resultWrapper = new AAIResultWrapper(json) diff --git a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java index c90ebfb973..7c136cdee9 100644 --- a/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java +++ b/bpmn/MSOCommonBPMN/src/test/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetupTest.java @@ -1294,6 +1294,7 @@ public class BBInputSetupTest { Configuration configuration = new Configuration(); configuration.setConfigurationId("configurationId"); configuration.setConfigurationName("configurationName"); + configuration.setConfigurationSubType("Fabric Config"); serviceInstance.getConfigurations().add(configuration); String resourceId = "configurationId"; String vnfcName = "vnfcName"; diff --git a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java index 7523c378e9..d036ce5f2f 100644 --- a/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java +++ b/bpmn/MSOCoreBPMN/src/main/java/org/onap/so/bpmn/core/domain/NetworkResource.java @@ -22,7 +22,6 @@ package org.onap.so.bpmn.core.domain; import java.util.UUID; import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonRootName; diff --git a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java index 050a2af06a..a4fc6e54b0 100644 --- a/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java +++ b/bpmn/mso-infrastructure-bpmn/src/main/java/org/onap/so/bpmn/infrastructure/MSOInfrastructureApplication.java @@ -99,7 +99,7 @@ public class MSOInfrastructureApplication { DeploymentBuilder deploymentBuilder = processEngine.getRepositoryService().createDeployment(); deployCustomWorkflows(deploymentBuilder); } catch (Exception e) { - logger.warn("Unable to invoke deploymentBuilder: " + e.getMessage()); + logger.warn("Unable to invoke deploymentBuilder ", e); } } @@ -140,7 +140,7 @@ public class MSOInfrastructureApplication { deploymentBuilder.deploy(); } } catch (Exception e) { - logger.warn("Unable to deploy custom workflows, " + e.getMessage()); + logger.warn("Unable to deploy custom workflows ", e); } } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java index 18ba91263b..15f8c5e4ef 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIDeleteTasks.java @@ -80,6 +80,16 @@ public class AAIDeleteTasks { @Autowired private AAIInstanceGroupResources aaiInstanceGroupResources; + /** + * BPMN access method to delete the VfModule from A&AI. + * + * It will extract the genericVnf & VfModule from the BBObject. + * + * Before deleting it set the aaiVfModuleRollback as false & then it will delete the VfModule. + * + * @param execution + * @throws Exception + */ public void deleteVfModule(BuildingBlockExecution execution) throws Exception { GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); VfModule vfModule = extractPojosForBB.extractByKey(execution, ResourceKey.VF_MODULE_ID); @@ -89,10 +99,21 @@ public class AAIDeleteTasks { aaiVfModuleResources.deleteVfModule(vfModule, genericVnf); execution.setVariable("aaiVfModuleRollback", true); } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deleteVfModule process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * BPMN access method to delete the Vnf from A&AI. + * + * It will extract the genericVnf from the BBObject. + * + * Before deleting it set the aaiVnfRollback as false & then it will delete the Vnf. + * + * @param execution + * @throws Exception + */ public void deleteVnf(BuildingBlockExecution execution) throws Exception { GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -101,79 +122,154 @@ public class AAIDeleteTasks { aaiVnfResources.deleteVnf(genericVnf); execution.setVariable("aaiVnfRollback", true); } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deleteVnf process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * BPMN access method to delete the ServiceInstance from A&AI. + * + * It will extract the serviceInstance from the BBObject. + * + * @param execution + * @throws Exception + */ public void deleteServiceInstance(BuildingBlockExecution execution) throws Exception { try { ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); aaiSIResources.deleteServiceInstance(serviceInstance); } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deleteServiceInstance process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * BPMN access method to delete the l3network from A&AI. + * + * It will extract the l3network from the BBObject. + * + * After deleting the l3network it set the isRollbackNeeded as true. + * + * @param execution + * @throws Exception + */ public void deleteNetwork(BuildingBlockExecution execution) throws Exception { try { L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID); aaiNetworkResources.deleteNetwork(l3network); execution.setVariable("isRollbackNeeded", true); } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deleteNetwork process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * BPMN access method to delete the Collection from A&AI. + * + * It will extract the serviceInstance from the BBObject. + * + * Then it will get the collection from serviceinstance. + * + * @param execution + * @throws Exception + */ public void deleteCollection(BuildingBlockExecution execution) throws Exception { try { ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); aaiNetworkResources.deleteCollection(serviceInstance.getCollection()); } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deleteCollection process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * BPMN access method to delete the InstanceGroup from A&AI. + * + * It will extract the serviceInstance from the BBObject. + * + * Then it will get the Instance group from serviceInstance. + * + * @param execution + * @throws Exception + */ public void deleteInstanceGroup(BuildingBlockExecution execution) throws Exception { try { ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); aaiNetworkResources.deleteNetworkInstanceGroup(serviceInstance.getCollection().getInstanceGroup()); } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deleteInstanceGroup process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * BPMN access method to delete the VolumeGroup from A&AI. + * + * It will extract the volumeGroup from the BBObject and cloudRegion from execution object . + * + * Then it will delete from A&AI. + * + * @param execution + * @throws Exception + */ public void deleteVolumeGroup(BuildingBlockExecution execution) { try { VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID); CloudRegion cloudRegion = execution.getGeneralBuildingBlock().getCloudRegion(); aaiVolumeGroupResources.deleteVolumeGroup(volumeGroup, cloudRegion); } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deleteVolumeGroup process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * BPMN access method to delete the Configuration from A&AI. + * + * It will extract the configuration from the BBObject. + * + * Then it will delete from A&AI. + * + * @param execution + */ public void deleteConfiguration(BuildingBlockExecution execution) { try { Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID); aaiConfigurationResources.deleteConfiguration(configuration); } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deleteConfiguration process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * BPMN access method to delete the InstanceGroupVnf from A&AI. + * + * It will extract the instanceGroup from the BBObject. + * + * Then it will delete from A&AI. + * + * @param execution + */ public void deleteInstanceGroupVnf(BuildingBlockExecution execution) { try { InstanceGroup instanceGroup = extractPojosForBB.extractByKey(execution, ResourceKey.INSTANCE_GROUP_ID); aaiInstanceGroupResources.deleteInstanceGroup(instanceGroup); } catch (Exception ex) { + logger.error("Exception occurred in AAIDeleteTasks deleteInstanceGroupVnf process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + public void deleteNetworkPolicies(BuildingBlockExecution execution) { try { String fqdns = execution.getVariable(contrailNetworkPolicyFqdnList); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java index 20f4443291..86645391b4 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasks.java @@ -92,6 +92,7 @@ public class AAIUpdateTasks { OrchestrationStatus.ASSIGNED); execution.setVariable("aaiServiceInstanceRollback", true); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedService", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -108,6 +109,7 @@ public class AAIUpdateTasks { aaiServiceInstanceResources.updateOrchestrationStatusServiceInstance(serviceInstance, OrchestrationStatus.ACTIVE); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActiveService", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -122,6 +124,7 @@ public class AAIUpdateTasks { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.ASSIGNED); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -136,6 +139,7 @@ public class AAIUpdateTasks { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.ACTIVE); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActiveVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -155,6 +159,7 @@ public class AAIUpdateTasks { aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ASSIGNED); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedVolumeGroup", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -174,6 +179,7 @@ public class AAIUpdateTasks { aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.ACTIVE); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActiveVolumeGroup", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -193,6 +199,7 @@ public class AAIUpdateTasks { aaiVolumeGroupResources.updateOrchestrationStatusVolumeGroup(volumeGroup, cloudRegion, OrchestrationStatus.CREATED); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusCreatedVolumeGroup", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -215,6 +222,7 @@ public class AAIUpdateTasks { aaiVolumeGroupResources.updateHeatStackIdVolumeGroup(volumeGroup, cloudRegion); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateHeatStackIdVolumeGroup", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -231,6 +239,7 @@ public class AAIUpdateTasks { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -247,6 +256,7 @@ public class AAIUpdateTasks { aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.PENDING_ACTIVATION); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusPendingActivationVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -273,6 +283,9 @@ public class AAIUpdateTasks { aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED); } } catch (Exception ex) { + logger.error( + "Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignedOrPendingActivationVfModule", + ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -281,7 +294,7 @@ public class AAIUpdateTasks { * BPMN access method to update status of VfModule to Created in AAI * * @param execution - * + * */ public void updateOrchestrationStatusCreatedVfModule(BuildingBlockExecution execution) { try { @@ -289,6 +302,7 @@ public class AAIUpdateTasks { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.CREATED); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusCreatedVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -307,6 +321,7 @@ public class AAIUpdateTasks { aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.CREATED); execution.setVariable("aaiDeactivateVfModuleRollback", true); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusDeactivateVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -346,6 +361,7 @@ public class AAIUpdateTasks { L3Network l3Network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID); updateNetworkAAI(l3Network, status); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateNetwork", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -386,6 +402,7 @@ public class AAIUpdateTasks { aaiCollectionResources.updateCollection(copiedNetworkCollection); execution.setVariable("aaiNetworkCollectionActivateRollback", true); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActiveNetworkCollection", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -403,6 +420,7 @@ public class AAIUpdateTasks { aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ACTIVE); execution.setVariable("aaiActivateVfModuleRollback", true); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActivateVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -423,6 +441,7 @@ public class AAIUpdateTasks { vfModule.setHeatStackId(heatStackId); aaiVfModuleResources.updateHeatStackIdVfModule(vfModule, vnf); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateHeatStackIdVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -466,6 +485,7 @@ public class AAIUpdateTasks { execution.setVariable("aaiNetworkActivateRollback", true); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateNetworkCreated", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -495,6 +515,7 @@ public class AAIUpdateTasks { } } } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateNetworkUpdated", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -509,6 +530,7 @@ public class AAIUpdateTasks { L3Network l3network = extractPojosForBB.extractByKey(execution, ResourceKey.NETWORK_ID); aaiNetworkResources.updateNetwork(l3network); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateObjectNetwork", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -524,6 +546,7 @@ public class AAIUpdateTasks { extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID); aaiServiceInstanceResources.updateServiceInstance(serviceInstance); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateServiceInstance", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -538,6 +561,7 @@ public class AAIUpdateTasks { GenericVnf genericVnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); aaiVnfResources.updateObjectVnf(genericVnf); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateObjectVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -559,6 +583,7 @@ public class AAIUpdateTasks { aaiVfModuleResources.updateOrchestrationStatusVfModule(vfModule, vnf, OrchestrationStatus.ASSIGNED); execution.setVariable("aaiDeleteVfModuleRollback", true); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusDeleteVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -574,6 +599,7 @@ public class AAIUpdateTasks { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); aaiVfModuleResources.changeAssignVfModule(vfModule, vnf); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateModelVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -589,6 +615,7 @@ public class AAIUpdateTasks { aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ASSIGNED); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusAssignFabricConfiguration", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -603,6 +630,8 @@ public class AAIUpdateTasks { Configuration configuration = extractPojosForBB.extractByKey(execution, ResourceKey.CONFIGURATION_ID); aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ACTIVE); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusActivateFabricConfiguration", + ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -618,6 +647,8 @@ public class AAIUpdateTasks { aaiConfigurationResources.updateOrchestrationStatusConfiguration(configuration, OrchestrationStatus.ASSIGNED); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusDeactivateFabricConfiguration", + ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -640,6 +671,7 @@ public class AAIUpdateTasks { aaiVnfResources.updateObjectVnf(copiedGenericVnf); } } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateIpv4OamAddressVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -662,6 +694,7 @@ public class AAIUpdateTasks { aaiVnfResources.updateObjectVnf(copiedGenericVnf); } } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateManagementV6AddressVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -681,6 +714,7 @@ public class AAIUpdateTasks { aaiVfModuleResources.updateContrailServiceInstanceFqdnVfModule(vfModule, vnf); } } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateContrailServiceInstanceFqdnVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -695,6 +729,7 @@ public class AAIUpdateTasks { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGASSIGNED); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusConfigAssignedVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -704,12 +739,13 @@ public class AAIUpdateTasks { * * @param execution */ - public void updateOrchestrationStausConfigDeployConfigureVnf(BuildingBlockExecution execution) { + public void updateOrchestrationStatusConfigDeployConfigureVnf(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGURE); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusConfigDeployConfigureVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } @@ -720,12 +756,13 @@ public class AAIUpdateTasks { * * @param execution */ - public void updateOrchestrationStausConfigDeployConfiguredVnf(BuildingBlockExecution execution) { + public void updateOrchestrationStatusConfigDeployConfiguredVnf(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); aaiVnfResources.updateOrchestrationStatusVnf(vnf, OrchestrationStatus.CONFIGURED); } catch (Exception ex) { + logger.error("Exception occurred in AAIUpdateTasks updateOrchestrationStatusConfigDeployConfiguredVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java index 9396f9dbfc..4285e9aa84 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/adapter/vnf/tasks/VnfAdapterCreateTasks.java @@ -47,6 +47,7 @@ import static org.apache.commons.lang3.StringUtils.*; @Component public class VnfAdapterCreateTasks { + private static final Logger logger = LoggerFactory.getLogger(VnfAdapterCreateTasks.class); public static final String SDNCQUERY_RESPONSE = "SDNCQueryResponse_"; private static final String VNFREST_REQUEST = "VNFREST_Request"; @@ -85,7 +86,9 @@ public class VnfAdapterCreateTasks { + " exists in gBuildingBlock but does not have a selflink value"); } } catch (BBObjectNotFoundException bbException) { - // If there is not a vf module in the general building block (in aLaCarte case), we will not retrieve + logger.error("Exception occurred", bbException); + // If there is not a vf module in the general building block (in aLaCarte case), + // we will not retrieve // the SDNCQueryResponse and proceed as normal without throwing an error } @@ -94,6 +97,7 @@ public class VnfAdapterCreateTasks { genericVnf, volumeGroup, sdncVfModuleQueryResponse); execution.setVariable(VNFREST_REQUEST, createVolumeGroupRequest.toXmlString()); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -117,6 +121,8 @@ public class VnfAdapterCreateTasks { try { volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID); } catch (BBObjectNotFoundException bbException) { + logger.error("Exception occurred if bb objrct not found in VnfAdapterCreateTasks createVfModule ", + bbException); } CloudRegion cloudRegion = gBBInput.getCloudRegion(); RequestContext requestContext = gBBInput.getRequestContext(); @@ -129,9 +135,9 @@ public class VnfAdapterCreateTasks { volumeGroup, sdncVnfQueryResponse, sdncVfModuleQueryResponse); execution.setVariable(VNFREST_REQUEST, createVfModuleRequest.toXmlString()); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } - } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java index cdbe0db57c..6a8058938f 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/ConfigDeployVnf.java @@ -62,7 +62,7 @@ public class ConfigDeployVnf { * @param execution */ public void updateAAIConfigure(BuildingBlockExecution execution) { - aaiUpdateTask.updateOrchestrationStausConfigDeployConfigureVnf(execution); + aaiUpdateTask.updateOrchestrationStatusConfigDeployConfigureVnf(execution); } @@ -129,7 +129,7 @@ public class ConfigDeployVnf { * @param execution */ public void updateAAIConfigured(BuildingBlockExecution execution) { - aaiUpdateTask.updateOrchestrationStausConfigDeployConfiguredVnf(execution); + aaiUpdateTask.updateOrchestrationStatusConfigDeployConfiguredVnf(execution); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignVnf.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignVnf.java index e51774c12c..0afca71b99 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignVnf.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/flowspecific/tasks/UnassignVnf.java @@ -30,12 +30,15 @@ import org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoInstanceGroup; import org.onap.so.bpmn.servicedecomposition.tasks.ExtractPojosForBB; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.client.orchestration.AAIInstanceGroupResources; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; @Component() public class UnassignVnf { + private static final Logger logger = LoggerFactory.getLogger(UnassignVnf.class); @Autowired private ExceptionBuilder exceptionUtil; @Autowired @@ -45,6 +48,17 @@ public class UnassignVnf { @Autowired private AAIObjectInstanceNameGenerator aaiObjectInstanceNameGenerator; + /** + * BPMN access method to deleting instanceGroup in AAI. + * + * It will extract the vnf from BBobject ,It will get the instance group from the vnf and add it into a list. + * + * Then iterate that list and check the ModelInfoInstanceGroup type. + * + * Then it will delete that. + * + * @param execution + */ public void deleteInstanceGroups(BuildingBlockExecution execution) { try { GenericVnf vnf = extractPojosForBB.extractByKey(execution, ResourceKey.GENERIC_VNF_ID); @@ -56,6 +70,7 @@ public class UnassignVnf { } } } catch (Exception ex) { + logger.error("Exception occurred in UnassignVnf deleteInstanceGroups", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java index b85e33144f..f61b40ad23 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCActivateTasks.java @@ -52,6 +52,7 @@ import org.springframework.stereotype.Component; @Component public class SDNCActivateTasks extends AbstractSDNCTask { + private static final Logger logger = LoggerFactory.getLogger(SDNCActivateTasks.class); public static final String SDNC_REQUEST = "SDNCRequest"; @Autowired private SDNCVnfResources sdncVnfResources; @@ -66,6 +67,13 @@ public class SDNCActivateTasks extends AbstractSDNCTask { @Autowired private Environment env; + /** + * This method is used to prepare a SDNC request and set it to the execution Object. + * + * Which is used for activate the vnf. + * + * @param execution + */ public void activateVnf(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -82,13 +90,14 @@ public class SDNCActivateTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VNF); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCActivateTasks activateVnf process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } /** * BPMN access method to perform Assign action on SDNC for L3Network - * + * * @param execution * @throws BBObjectNotFoundException */ @@ -112,6 +121,13 @@ public class SDNCActivateTasks extends AbstractSDNCTask { } } + /** + * This method is used to prepare a SDNC request and set it to the execution Object. + * + * Which is used for activate the activateVfModule. + * + * @param execution + */ public void activateVfModule(BuildingBlockExecution execution) { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); RequestContext requestContext = gBBInput.getRequestContext(); @@ -131,6 +147,7 @@ public class SDNCActivateTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VFMODULE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCActivateTasks activateVfModule process", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java index 1dcdfa912c..b8f5c8629d 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCAssignTasks.java @@ -96,6 +96,7 @@ public class SDNCAssignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.SERVICE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -117,7 +118,6 @@ public class SDNCAssignTasks extends AbstractSDNCTask { Customer customer = gBBInput.getCustomer(); CloudRegion cloudRegion = gBBInput.getCloudRegion(); SDNCRequest sdncRequest = new SDNCRequest(); - GenericResourceApiVnfOperationInformation req = sdncVnfResources.assignVnf(vnf, serviceInstance, customer, cloudRegion, requestContext, Boolean.TRUE.equals(vnf.isCallHoming()), buildCallbackURI(sdncRequest)); @@ -125,10 +125,12 @@ public class SDNCAssignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VNF); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** * BPMN access method to assigning the vfModule in SDNC. * @@ -160,6 +162,7 @@ public class SDNCAssignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VFMODULE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java index 3c42f76d73..96b656ff95 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCDeactivateTasks.java @@ -53,6 +53,7 @@ import org.springframework.stereotype.Component; @Component public class SDNCDeactivateTasks extends AbstractSDNCTask { + private static final Logger logger = LoggerFactory.getLogger(SDNCDeactivateTasks.class); public static final String SDNC_REQUEST = "SDNCRequest"; @Autowired private SDNCNetworkResources sdncNetworkResources; @@ -69,6 +70,12 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask { @Autowired private Environment env; + /** + * This method is used to prepare a SDNC request and set it to the execution Object. Which is used for deactivate + * VfModule. + * + * @param execution + */ public void deactivateVfModule(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -86,13 +93,14 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VFMODULE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCDeactivateTasks deactivateVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } /** * BPMN access method to perform Service Topology Deactivate action on SDNC for Vnf - * + * * @param execution * @throws Exception */ @@ -113,15 +121,16 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VNF); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCDeactivateTasks deactivateVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } /* * BPMN access method to perform Service Topology Deactivate action on SDNC for Service Instance - * + * * @param execution - * + * * @throws Exception */ public void deactivateServiceInstance(BuildingBlockExecution execution) throws Exception { @@ -138,13 +147,14 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.SERVICE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCDeactivateTasks deactivateServiceInstance", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } /** * BPMN access method to invoke deactivate on a L3Network object - * + * * @param execution */ public void deactivateNetwork(BuildingBlockExecution execution) { @@ -163,6 +173,7 @@ public class SDNCDeactivateTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.NETWORK); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCDeactivateTasks deactivateNetwork", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java index 7478479a86..080d6d34b1 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCQueryTasks.java @@ -40,7 +40,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; /** - * This class is used for quering the SDNC + * This class is used for querying the SDNC. */ @Component public class SDNCQueryTasks { @@ -78,16 +78,19 @@ public class SDNCQueryTasks { String response = sdncVnfResources.queryVnf(genericVnf); execution.setVariable(SDNCQUERY_RESPONSE + genericVnf.getVnfId(), response); } catch (BadResponseException ex) { + logger.error("Exception occurred", ex); if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC); } else { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } + /** * BPMN access method to query the SDNC for fetching the VfModule details. * @@ -116,12 +119,14 @@ public class SDNCQueryTasks { + " exists in gBuildingBlock but does not have a selflink value"); } } catch (BadResponseException ex) { + logger.error("Exception occurred for BadResponse ", ex); if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC); } else { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } @@ -144,20 +149,26 @@ public class SDNCQueryTasks { + " exists in gBuildingBlock but does not have a selflink value"); } } catch (BBObjectNotFoundException bbException) { - // If there is not a vf module in the general building block, we will not call SDNC and proceed as normal + logger.error("Error occurred if bb object not found in SDNCQueryTasks queryVfModuleForVolumeGroup ", + bbException); + // If there is not a vf module in the general building block, we will not call + // SDNC and proceed as normal // without throwing an error - // If we see a bb object not found exception for something that is not a vf module id, then we should throw + // If we see a bb object not found exception for something that is not a vf + // module id, then we should throw // the error as normal if (!ResourceKey.VF_MODULE_ID.equals(bbException.getResourceKey())) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, bbException, TargetEntity.SO); } } catch (BadResponseException ex) { + logger.error("Error occurred for BadResponseException in SDNCQueryTasks queryVfModuleForVolumeGroup ", ex); if (!ex.getMessage().equals(NO_RESPONSE_FROM_SDNC)) { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SDNC); } else { exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } catch (Exception ex) { + logger.error("Exception occurred", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex, TargetEntity.SO); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java index e3c9785ab2..4817ba8b61 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/sdnc/tasks/SDNCUnassignTasks.java @@ -53,6 +53,7 @@ import org.springframework.stereotype.Component; @Component public class SDNCUnassignTasks extends AbstractSDNCTask { + private static final Logger logger = LoggerFactory.getLogger(SDNCUnassignTasks.class); public static final String SDNC_REQUEST = "SDNCRequest"; @Autowired private SDNCServiceInstanceResources sdncSIResources; @@ -69,6 +70,13 @@ public class SDNCUnassignTasks extends AbstractSDNCTask { @Autowired private Environment env; + /** + * This method is used to prepare a SDNC request and set it to the execution Object. + * + * Which is used for unassign the ServiceInstance. + * + * @param execution + */ public void unassignServiceInstance(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -83,10 +91,18 @@ public class SDNCUnassignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.SERVICE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCUnassignTasks unassignServiceInstance", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * This method is used to prepare a SDNC request and set it to the execution Object. + * + * Which is used for unassign the VfModule. + * + * @param execution + */ public void unassignVfModule(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -102,10 +118,18 @@ public class SDNCUnassignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VFMODULE); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCUnassignTasks unassignVfModule", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * This method is used to prepare a SDNC request and set it to the execution Object. + * + * Which is used for unassign the Vnf. + * + * @param execution + */ public void unassignVnf(BuildingBlockExecution execution) { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -122,10 +146,18 @@ public class SDNCUnassignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.VNF); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCUnassignTasks unassignVnf", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } + /** + * This method is used to prepare a SDNC request and set it to the execution Object. + * + * Which is used for unassign the Network. + * + * @param execution + */ public void unassignNetwork(BuildingBlockExecution execution) throws Exception { try { GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock(); @@ -144,6 +176,7 @@ public class SDNCUnassignTasks extends AbstractSDNCTask { sdncRequest.setTopology(SDNCTopology.NETWORK); execution.setVariable(SDNC_REQUEST, sdncRequest); } catch (Exception ex) { + logger.error("Exception occurred in SDNCUnassignTasks unassignNetwork", ex); exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java index 7eaf011c75..8822bc39dd 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/OrchestrationStatusValidator.java @@ -55,7 +55,6 @@ public class OrchestrationStatusValidator { private static final String MULTI_STAGE_DESIGN_OFF = "false"; private static final String MULTI_STAGE_DESIGN_ON = "true"; - @Autowired private ExtractPojosForBB extractPojosForBB; @Autowired @@ -63,6 +62,7 @@ public class OrchestrationStatusValidator { @Autowired private CatalogDbClient catalogDbClient; + /** * This method validate's the status of the OrchestrationStatus against the buildingBlockDetail ResourceType * @@ -137,7 +137,8 @@ public class OrchestrationStatusValidator { OrchestrationStatusValidationDirective.VALIDATION_SKIPPED); return; default: - // can't currently get here, so not tested. Added in case enum is expanded without a change to this + // can't currently get here, so not tested. Added in case enum is expanded + // without a change to this // code throw new OrchestrationStatusValidationException( String.format(UNKNOWN_RESOURCE_TYPE, buildingBlockFlowName, @@ -172,6 +173,9 @@ public class OrchestrationStatusValidator { execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT, orchestrationStatusStateTransitionDirective.getFlowDirective()); } catch (BBObjectNotFoundException ex) { + logger.error( + "Error occurred for bb object notfound in OrchestrationStatusValidator validateOrchestrationStatus ", + ex); if (execution.getFlowToBeCalled().contains("Unassign")) { execution.setVariable(ORCHESTRATION_STATUS_VALIDATION_RESULT, OrchestrationStatusValidationDirective.SILENT_SUCCESS); @@ -179,6 +183,7 @@ public class OrchestrationStatusValidator { exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, ex); } } catch (Exception e) { + logger.error("Exception occurred", e); exceptionBuilder.buildAndThrowWorkflowException(execution, 7000, e); } } diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java index e6dd38ee1e..1f07166b60 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowAction.java @@ -93,6 +93,7 @@ public class WorkflowAction { private static final String WORKFLOW_ACTION_ERROR_MESSAGE = "WorkflowActionErrorMessage"; private static final String SERVICE_INSTANCES = "serviceInstances"; + private static final String SERVICE_INSTANCE = "serviceInstance"; private static final String VF_MODULES = "vfModules"; private static final String WORKFLOW_ACTION_WAS_UNABLE_TO_VERIFY_IF_THE_INSTANCE_NAME_ALREADY_EXIST_IN_AAI = "WorkflowAction was unable to verify if the instance name already exist in AAI."; @@ -107,7 +108,7 @@ public class WorkflowAction { private static final String ASSIGNINSTANCE = "assignInstance"; private static final String CREATEINSTANCE = "createInstance"; private static final String USERPARAMSERVICE = "service"; - private static final String supportedTypes = + private static final String SUPPORTEDTYPES = "vnfs|vfModules|networks|networkCollections|volumeGroups|serviceInstances|instanceGroups"; private static final String HOMINGSOLUTION = "Homing_Solution"; private static final String FABRIC_CONFIGURATION = "FabricConfiguration"; @@ -123,6 +124,8 @@ public class WorkflowAction { private static final String NAME_EXISTS_WITH_DIFF_CUSTOMIZATION_ID = "(%s), same parent and different customization id (%s)"; private static final String NAME_EXISTS_WITH_DIFF_PARENT = "(%s) id (%s) and different parent relationship"; + private static final String CREATENETWORKBB = "CreateNetworkBB"; + private static final String ACTIVATENETWORKBB = "ActivateNetworkBB"; @Autowired protected BBInputSetup bbInputSetup; @@ -183,12 +186,14 @@ public class WorkflowAction { try { cloudOwner = requestDetails.getCloudConfiguration().getCloudOwner(); } catch (Exception ex) { + logger.error("Exception in getCloundOwner", ex); cloudOwner = environment.getProperty(defaultCloudOwner); } boolean suppressRollback = false; try { suppressRollback = requestDetails.getRequestInfo().getSuppressRollback(); } catch (Exception ex) { + logger.error("Exception in getSuppressRollback", ex); suppressRollback = false; } execution.setVariable("suppressRollback", suppressRollback); @@ -209,7 +214,7 @@ public class WorkflowAction { } else { resourceId = resource.getResourceId(); } - if ((serviceInstanceId == null || serviceInstanceId.equals("")) && resourceType == WorkflowType.SERVICE) { + if ((serviceInstanceId == null || serviceInstanceId.isEmpty()) && resourceType == WorkflowType.SERVICE) { serviceInstanceId = resourceId; } execution.setVariable("resourceId", resourceId); @@ -300,9 +305,9 @@ public class WorkflowAction { traverseCatalogDbService(execution, sIRequest, resourceCounter, aaiResourceIds); } } else if (resourceType == WorkflowType.SERVICE - && (requestAction.equalsIgnoreCase("activateInstance") - || requestAction.equalsIgnoreCase("unassignInstance") - || requestAction.equalsIgnoreCase("deleteInstance") + && ("activateInstance".equalsIgnoreCase(requestAction) + || "unassignInstance".equalsIgnoreCase(requestAction) + || "deleteInstance".equalsIgnoreCase(requestAction) || requestAction.equalsIgnoreCase("activate" + FABRIC_CONFIGURATION))) { // SERVICE-MACRO-ACTIVATE, SERVICE-MACRO-UNASSIGN, and // SERVICE-MACRO-DELETE @@ -310,10 +315,10 @@ public class WorkflowAction { // to query the SI in AAI to find related instances. traverseAAIService(execution, resourceCounter, resourceId, aaiResourceIds); } else if (resourceType == WorkflowType.SERVICE - && requestAction.equalsIgnoreCase("deactivateInstance")) { + && "deactivateInstance".equalsIgnoreCase(requestAction)) { resourceCounter.add(new Resource(WorkflowType.SERVICE, "", false)); - } else if (resourceType == WorkflowType.VNF && (requestAction.equalsIgnoreCase("replaceInstance") - || (requestAction.equalsIgnoreCase("recreateInstance")))) { + } else if (resourceType == WorkflowType.VNF && ("replaceInstance".equalsIgnoreCase(requestAction) + || ("recreateInstance".equalsIgnoreCase(requestAction)))) { traverseAAIVnf(execution, resourceCounter, workflowResourceIds.getServiceInstanceId(), workflowResourceIds.getVnfId(), aaiResourceIds); } else { @@ -363,7 +368,7 @@ public class WorkflowAction { sIRequest.getRequestDetails().getRequestParameters().getUserParams(); for (Map<String, Object> params : userParams) { if (params.containsKey(HOMINGSOLUTION)) { - if (params.get(HOMINGSOLUTION).equals("none")) { + if ("none".equals(params.get(HOMINGSOLUTION))) { execution.setVariable("homing", false); } else { execution.setVariable("homing", true); @@ -447,7 +452,7 @@ public class WorkflowAction { protected boolean isConfiguration(List<OrchestrationFlow> orchFlows) { for (OrchestrationFlow flow : orchFlows) { - if (flow.getFlowName().contains("Configuration") && !flow.getFlowName().equals("ConfigurationScaleOutBB")) { + if (flow.getFlowName().contains(CONFIGURATION) && !"ConfigurationScaleOutBB".equals(flow.getFlowName())) { return true; } } @@ -715,7 +720,7 @@ public class WorkflowAction { protected boolean vrfConfigurationAlreadyExists(RelatedInstance relatedVpnBinding, Configuration vrfConfiguration, AAIResultWrapper configWrapper) throws VrfBondingServiceException { - if (vrfConfiguration.getConfigurationType().equalsIgnoreCase("VRF-ENTRY")) { + if ("VRF-ENTRY".equalsIgnoreCase(vrfConfiguration.getConfigurationType())) { Optional<Relationships> relationshipsConfigOp = configWrapper.getRelationships(); if (relationshipsConfigOp.isPresent()) { Optional<VpnBinding> relatedInfraVpnBindingOp = @@ -752,7 +757,7 @@ public class WorkflowAction { if (collectionResourceCustomization.getCollectionResource().getInstanceGroup() != null) { String toscaNodeType = collectionResourceCustomization.getCollectionResource() .getInstanceGroup().getToscaNodeType(); - if (toscaNodeType != null && toscaNodeType.contains("NetworkCollection")) { + if (toscaNodeType != null && toscaNodeType.contains(NETWORKCOLLECTION)) { int minNetworks = 0; org.onap.so.db.catalog.beans.InstanceGroup instanceGroup = collectionResourceCustomization.getCollectionResource().getInstanceGroup(); @@ -885,6 +890,7 @@ public class WorkflowAction { } } } catch (Exception ex) { + logger.error("Exception in traverseAAIService", ex); buildAndThrowException(execution, "Could not find existing Service Instance or related Instances to execute the request on."); } @@ -926,6 +932,7 @@ public class WorkflowAction { } } } catch (Exception ex) { + logger.error("Exception in traverseAAIVnf", ex); buildAndThrowException(execution, "Could not find existing Vnf or related Instances to execute the request on."); } @@ -953,6 +960,7 @@ public class WorkflowAction { } } } catch (Exception ex) { + logger.error("Exception in findConfigurationsInsideVfModule", ex); buildAndThrowException(execution, "Failed to find Configuration object from the vfModule."); } } @@ -1015,8 +1023,8 @@ public class WorkflowAction { vfModuleCustomizationUUID = vfModule.getModelInfo().getModelCustomizationUuid(); } - if (!vnfCustomizationUUID.equals("") - && !vfModuleCustomizationUUID.equals("")) { + if (!vnfCustomizationUUID.isEmpty() + && !vfModuleCustomizationUUID.isEmpty()) { List<CvnfcConfigurationCustomization> configs = traverseCatalogDbForConfiguration( validate.getModelInfo().getModelVersionId(), @@ -1110,7 +1118,7 @@ public class WorkflowAction { protected Resource extractResourceIdAndTypeFromUri(String uri) { Pattern patt = Pattern.compile( - "[vV]\\d+.*?(?:(?:/(?<type>" + supportedTypes + ")(?:/(?<id>[^/]+))?)(?:/(?<action>[^/]+))?)?$"); + "[vV]\\d+.*?(?:(?:/(?<type>" + SUPPORTEDTYPES + ")(?:/(?<id>[^/]+))?)(?:/(?<action>[^/]+))?)?$"); Matcher m = patt.matcher(uri); Boolean generated = false; @@ -1123,15 +1131,15 @@ public class WorkflowAction { throw new IllegalArgumentException("Uri could not be parsed. No type found. " + uri); } if (action == null) { - if (type.equals(SERVICE_INSTANCES) && (id == null || id.equals("assign"))) { + if (type.equals(SERVICE_INSTANCES) && (id == null || "assign".equals(id))) { id = UUID.randomUUID().toString(); generated = true; - } else if (type.equals(VF_MODULES) && id.equals("scaleOut")) { + } else if (type.equals(VF_MODULES) && "scaleOut".equals(id)) { id = UUID.randomUUID().toString(); generated = true; } } else { - if (action.matches(supportedTypes)) { + if (action.matches(SUPPORTEDTYPES)) { id = UUID.randomUUID().toString(); generated = true; type = action; @@ -1159,7 +1167,7 @@ public class WorkflowAction { .equalsIgnoreCase(reqDetails.getModelInfo().getModelVersionId())) { return serviceInstanceAAI.get().getServiceInstanceId(); } else { - throw new DuplicateNameException("serviceInstance", + throw new DuplicateNameException(SERVICE_INSTANCE, String.format(NAME_EXISTS_WITH_DIFF_VERSION_ID, instanceName, reqDetails.getModelInfo().getModelVersionId())); } @@ -1170,7 +1178,7 @@ public class WorkflowAction { if (aaiServiceInstances.getServiceInstance() != null && !aaiServiceInstances.getServiceInstance().isEmpty()) { if (aaiServiceInstances.getServiceInstance().size() > 1) { - throw new DuplicateNameException("serviceInstance", + throw new DuplicateNameException(SERVICE_INSTANCE, String.format(NAME_EXISTS_MULTIPLE, instanceName)); } else { ServiceInstance si = @@ -1178,7 +1186,7 @@ public class WorkflowAction { Map<String, String> keys = bbInputSetupUtils.getURIKeysFromServiceInstance(si.getServiceInstanceId()); - throw new DuplicateNameException("serviceInstance", + throw new DuplicateNameException(SERVICE_INSTANCE, String.format(NAME_EXISTS_WITH_DIFF_COMBINATION, instanceName, keys.get("global-customer-id"), keys.get("service-type"), si.getModelVersionId())); @@ -1295,7 +1303,7 @@ public class WorkflowAction { } protected String convertTypeFromPlural(String type) { - if (!type.matches(supportedTypes)) { + if (!type.matches(SUPPORTEDTYPES)) { return type; } else { if (type.equals(SERVICE_INSTANCES)) { @@ -1317,31 +1325,31 @@ public class WorkflowAction { String virtualLinkKey = ebb.getBuildingBlock().getVirtualLinkKey(); sortedOrchFlows.add(ebb); for (ExecuteBuildingBlock ebb2 : orchFlows) { - if (!isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals("CreateNetworkBB") + if (!isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals(CREATENETWORKBB) && ebb2.getBuildingBlock().getKey().equalsIgnoreCase(key)) { sortedOrchFlows.add(ebb2); break; } - if (isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals("CreateNetworkBB") + if (isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals(CREATENETWORKBB) && ebb2.getBuildingBlock().getVirtualLinkKey().equalsIgnoreCase(virtualLinkKey)) { sortedOrchFlows.add(ebb2); break; } } for (ExecuteBuildingBlock ebb2 : orchFlows) { - if (!isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals("ActivateNetworkBB") + if (!isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals(ACTIVATENETWORKBB) && ebb2.getBuildingBlock().getKey().equalsIgnoreCase(key)) { sortedOrchFlows.add(ebb2); break; } - if (isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals("ActivateNetworkBB") + if (isVirtualLink && ebb2.getBuildingBlock().getBpmnFlowName().equals(ACTIVATENETWORKBB) && ebb2.getBuildingBlock().getVirtualLinkKey().equalsIgnoreCase(virtualLinkKey)) { sortedOrchFlows.add(ebb2); break; } } - } else if (ebb.getBuildingBlock().getBpmnFlowName().equals("CreateNetworkBB") - || ebb.getBuildingBlock().getBpmnFlowName().equals("ActivateNetworkBB")) { + } else if (ebb.getBuildingBlock().getBpmnFlowName().equals(CREATENETWORKBB) + || ebb.getBuildingBlock().getBpmnFlowName().equals(ACTIVATENETWORKBB)) { continue; } else if (!ebb.getBuildingBlock().getBpmnFlowName().equals("")) { sortedOrchFlows.add(ebb); @@ -1424,7 +1432,7 @@ public class WorkflowAction { } } else if (orchFlow.getFlowName().contains(VFMODULE)) { List<Resource> vfModuleResourcesSorted = null; - if (requestAction.equals("createInstance") || requestAction.equals("assignInstance") + if (requestAction.equals(CREATEINSTANCE) || requestAction.equals(ASSIGNINSTANCE) || requestAction.equals("activateInstance")) { vfModuleResourcesSorted = sortVfModulesByBaseFirst(resourceCounter.stream() .filter(x -> WorkflowType.VFMODULE == x.getResourceType()).collect(Collectors.toList())); diff --git a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java index 073dead8b3..100f81a0c7 100644 --- a/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java +++ b/bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java @@ -40,7 +40,6 @@ import org.onap.so.bpmn.servicedecomposition.tasks.BBInputSetupUtils; import org.onap.so.client.aai.AAIObjectType; import org.onap.so.client.exception.ExceptionBuilder; import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization; -import org.onap.so.db.catalog.beans.VnfResourceCustomization; import org.onap.so.db.catalog.client.CatalogDbClient; import org.onap.so.db.request.beans.InfraActiveRequests; import org.onap.so.db.request.client.RequestsDbClient; @@ -65,6 +64,9 @@ public class WorkflowActionBBTasks { private static final String FABRIC_CONFIGURATION = "FabricConfiguration"; private static final String ASSIGN_FABRIC_CONFIGURATION_BB = "AssignFabricConfigurationBB"; private static final String ACTIVATE_FABRIC_CONFIGURATION_BB = "ActivateFabricConfigurationBB"; + private static final String COMPLETED = "completed"; + private static final String HANDLINGCODE = "handlingCode"; + private static final String ROLLBACKTOCREATED = "RollbackToCreated"; protected String maxRetries = "mso.rainyDay.maxRetries"; private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBTasks.class); @@ -98,9 +100,9 @@ public class WorkflowActionBBTasks { execution.setVariable("buildingBlock", ebb); currentSequence++; if (currentSequence >= flowsToExecute.size()) { - execution.setVariable("completed", true); + execution.setVariable(COMPLETED, true); } else { - execution.setVariable("completed", false); + execution.setVariable(COMPLETED, false); } execution.setVariable(G_CURRENT_SEQUENCE, currentSequence); } @@ -114,7 +116,8 @@ public class WorkflowActionBBTasks { } } catch (Exception ex) { logger.warn( - "Bpmn Flow Statistics was unable to update Request Db with the new completion percentage. Competion percentage may be invalid."); + "Bpmn Flow Statistics was unable to update Request Db with the new completion percentage. Competion percentage may be invalid.", + ex); } } @@ -236,7 +239,7 @@ public class WorkflowActionBBTasks { } public void checkRetryStatus(DelegateExecution execution) { - String handlingCode = (String) execution.getVariable("handlingCode"); + String handlingCode = (String) execution.getVariable(HANDLINGCODE); String requestId = (String) execution.getVariable(G_REQUEST_ID); String retryDuration = (String) execution.getVariable("RetryDuration"); int retryCount = (int) execution.getVariable(RETRY_COUNT); @@ -244,11 +247,11 @@ public class WorkflowActionBBTasks { try { envMaxRetries = Integer.parseInt(this.environment.getProperty(maxRetries)); } catch (Exception ex) { - logger.error("Could not read maxRetries from config file. Setting max to 5 retries"); + logger.error("Could not read maxRetries from config file. Setting max to 5 retries", ex); envMaxRetries = 5; } int nextCount = retryCount + 1; - if (handlingCode.equals("Retry")) { + if ("Retry".equals(handlingCode)) { workflowActionBBFailure.updateRequestErrorStatusMessage(execution); try { InfraActiveRequests request = requestDbclient.getInfraActiveRequestbyRequestId(requestId); @@ -259,8 +262,8 @@ public class WorkflowActionBBTasks { logger.warn("Failed to update Request Db Infra Active Requests with Retry Status", ex); } if (retryCount < envMaxRetries) { - int currSequence = (int) execution.getVariable("gCurrentSequence"); - execution.setVariable("gCurrentSequence", currSequence - 1); + int currSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); + execution.setVariable(G_CURRENT_SEQUENCE, currSequence - 1); execution.setVariable(RETRY_COUNT, nextCount); } else { workflowAction.buildAndThrowException(execution, @@ -301,15 +304,15 @@ public class WorkflowActionBBTasks { } } - String handlingCode = (String) execution.getVariable("handlingCode"); + String handlingCode = (String) execution.getVariable(HANDLINGCODE); List<ExecuteBuildingBlock> rollbackFlowsFiltered = new ArrayList<>(); rollbackFlowsFiltered.addAll(rollbackFlows); - if (handlingCode.equals("RollbackToAssigned") || handlingCode.equals("RollbackToCreated")) { + if ("RollbackToAssigned".equals(handlingCode) || ROLLBACKTOCREATED.equals(handlingCode)) { for (int i = 0; i < rollbackFlows.size(); i++) { if (rollbackFlows.get(i).getBuildingBlock().getBpmnFlowName().contains("Unassign")) { rollbackFlowsFiltered.remove(rollbackFlows.get(i)); } else if (rollbackFlows.get(i).getBuildingBlock().getBpmnFlowName().contains("Delete") - && handlingCode.equals("RollbackToCreated")) { + && ROLLBACKTOCREATED.equals(handlingCode)) { rollbackFlowsFiltered.remove(rollbackFlows.get(i)); } } @@ -321,9 +324,9 @@ public class WorkflowActionBBTasks { else execution.setVariable("isRollbackNeeded", true); execution.setVariable("flowsToExecute", rollbackFlowsFiltered); - execution.setVariable("handlingCode", "PreformingRollback"); + execution.setVariable(HANDLINGCODE, "PreformingRollback"); execution.setVariable("isRollback", true); - execution.setVariable("gCurrentSequence", 0); + execution.setVariable(G_CURRENT_SEQUENCE, 0); execution.setVariable(RETRY_COUNT, 0); } else { workflowAction.buildAndThrowException(execution, @@ -354,6 +357,7 @@ public class WorkflowActionBBTasks { } requestDbclient.updateInfraActiveRequests(request); } catch (Exception ex) { + logger.error("Exception in updateInstanceId", ex); workflowAction.buildAndThrowException(execution, "Failed to update Request db with instanceId"); } } @@ -361,12 +365,12 @@ public class WorkflowActionBBTasks { public void postProcessingExecuteBB(DelegateExecution execution) { List<ExecuteBuildingBlock> flowsToExecute = (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute"); - String handlingCode = (String) execution.getVariable("handlingCode"); + String handlingCode = (String) execution.getVariable(HANDLINGCODE); final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE); int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE); ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1); String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName(); - if (bbFlowName.equalsIgnoreCase("ActivateVfModuleBB") && aLaCarte && handlingCode.equalsIgnoreCase("Success")) { + if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte && "Success".equalsIgnoreCase(handlingCode)) { postProcessingExecuteBBActivateVfModule(execution, ebb, flowsToExecute); } } @@ -410,16 +414,16 @@ public class WorkflowActionBBTasks { .forEach(executeBB -> logger.info("Flows to Execute After Post Processing: {}", executeBB.getBuildingBlock().getBpmnFlowName())); execution.setVariable("flowsToExecute", flowsToExecute); - execution.setVariable("completed", false); + execution.setVariable(COMPLETED, false); } else { - logger.debug("No cvnfcCustomization found for customizationId: " + modelCustomizationId); + logger.debug("No cvnfcCustomization found for customizationId: {}", modelCustomizationId); } } } catch (EntityNotFoundException e) { - logger.debug(e.getMessage() + " Will not be running Fabric Config Building Blocks"); + logger.debug("Will not be running Fabric Config Building Blocks", e); } catch (Exception e) { String errorMessage = "Error occurred in post processing of Vf Module create"; - execution.setVariable("handlingCode", "RollbackToCreated"); + execution.setVariable(HANDLINGCODE, ROLLBACKTOCREATED); execution.setVariable("WorkflowActionErrorMessage", errorMessage); logger.error(errorMessage, e); } diff --git a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java index 905f244278..c337f7f1b5 100644 --- a/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java +++ b/bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/aai/tasks/AAIUpdateTasksTest.java @@ -733,7 +733,7 @@ public class AAIUpdateTasksTest extends BaseTaskTest { doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CONFIGURE); - aaiUpdateTasks.updateOrchestrationStausConfigDeployConfigureVnf(execution); + aaiUpdateTasks.updateOrchestrationStatusConfigDeployConfigureVnf(execution); } @Test @@ -741,6 +741,6 @@ public class AAIUpdateTasksTest extends BaseTaskTest { doNothing().when(aaiVfModuleResources).updateOrchestrationStatusVfModule(vfModule, genericVnf, OrchestrationStatus.CONFIGURED); - aaiUpdateTasks.updateOrchestrationStausConfigDeployConfiguredVnf(execution); + aaiUpdateTasks.updateOrchestrationStatusConfigDeployConfiguredVnf(execution); } } diff --git a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java index e1992d98ca..ba6a5911b7 100644 --- a/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java +++ b/cloudify-client/src/main/java/org/onap/so/cloudify/connector/http/HttpClientConnector.java @@ -232,8 +232,12 @@ public class HttpClientConnector implements CloudifyClientConnector { } // Get here on an error response (4XX-5XX) - throw new CloudifyResponseException(httpResponse.getStatusLine().getReasonPhrase(), - httpResponse.getStatusLine().getStatusCode(), httpClientResponse); + if (httpResponse != null) { + throw new CloudifyResponseException(httpResponse.getStatusLine().getReasonPhrase(), + httpResponse.getStatusLine().getStatusCode(), httpClientResponse); + } else { + throw new CloudifyResponseException("Null httpResponse", 0, httpClientResponse); + } } } diff --git a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java index f2f99050db..1fe9da984f 100644 --- a/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java +++ b/common/src/main/java/org/onap/so/client/aai/entities/uri/AAISimpleUri.java @@ -21,6 +21,7 @@ package org.onap.so.client.aai.entities.uri; import java.net.URI; +import java.util.regex.Pattern; import javax.ws.rs.core.UriBuilder; import org.onap.so.client.aai.AAIObjectPlurals; import org.onap.so.client.aai.AAIObjectType; @@ -138,4 +139,9 @@ public class AAISimpleUri extends SimpleUri implements AAIResourceUri { public AAISimpleUri format(Format format) { return (AAISimpleUri) super.format(format); } + + @Override + protected Pattern getPrefixPattern() { + return Pattern.compile("/aai/v\\d+"); + } } diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java index ffbb86f023..ad3bb6c311 100644 --- a/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java +++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/DSLQueryBuilder.java @@ -20,6 +20,7 @@ package org.onap.so.client.graphinventory.entities; +import java.lang.reflect.Field; import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -49,8 +50,24 @@ public class DSLQueryBuilder<S, E> implements QueryStep { } public DSLQueryBuilder<S, E> output() { - if (steps.get(steps.size() - 1) instanceof DSLNode) { + Object obj = steps.get(steps.size() - 1); + if (obj instanceof DSLNode) { ((DSLNode) steps.get(steps.size() - 1)).output(); + } else if (obj.getClass().getName().contains("$$Lambda$")) { + // process lambda expressions + for (Field f : obj.getClass().getDeclaredFields()) { + f.setAccessible(true); + Object o; + try { + o = f.get(obj); + if (o instanceof DSLQueryBuilder && ((DSLQueryBuilder) o).steps.get(0) instanceof DSLNode) { + ((DSLNode) ((DSLQueryBuilder) o).steps.get(0)).output(); + } + } catch (IllegalArgumentException | IllegalAccessException e) { + } + f.setAccessible(false); + break; + } } return this; } diff --git a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java index 41ba07ad6c..ffe47c5c51 100644 --- a/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java +++ b/common/src/main/java/org/onap/so/client/graphinventory/entities/uri/SimpleUri.java @@ -29,6 +29,7 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Map; import java.util.Set; +import java.util.regex.Pattern; import javax.ws.rs.core.UriBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.onap.so.client.graphinventory.Format; @@ -61,7 +62,7 @@ public class SimpleUri implements GraphInventoryResourceUri, Serializable { protected SimpleUri(GraphInventoryObjectType type, URI uri) { this.type = type; this.pluralType = null; - this.internalURI = UriBuilder.fromPath(uri.getRawPath().replaceAll("/aai/v\\d+", "")); + this.internalURI = UriBuilder.fromPath(uri.getRawPath().replaceAll(getPrefixPattern().toString(), "")); this.values = new Object[0]; } @@ -174,6 +175,10 @@ public class SimpleUri implements GraphInventoryResourceUri, Serializable { return build(this.values); } + protected Pattern getPrefixPattern() { + return Pattern.compile("/.*?/v\\d+"); + } + protected URI build(Object... values) { // This is a workaround because resteasy does not encode URIs correctly final String[] encoded = new String[values.length]; diff --git a/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java b/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java index 590e83827b..fb45652d53 100644 --- a/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java +++ b/common/src/test/java/org/onap/so/client/aai/DSLQueryBuilderTest.java @@ -24,6 +24,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertTrue; import org.junit.Test; import org.onap.so.client.graphinventory.entities.DSLNode; +import org.onap.so.client.graphinventory.entities.DSLNodeKey; import org.onap.so.client.graphinventory.entities.DSLQueryBuilder; import org.onap.so.client.graphinventory.entities.__; @@ -118,4 +119,30 @@ public class DSLQueryBuilderTest { assertTrue(builder.equals( "cloud-region('cloud-owner', 'owner')('cloud-region-id', 'id') > vlan-tag*('vlan-id-outer', 167)('my-boolean', true)")); } + + @Test + public void outputOnNodeLambdasTest() { + DSLQueryBuilder<DSLNode, DSLNode> builder = + new DSLQueryBuilder<>(new DSLNode(AAIObjectType.L_INTERFACE, new DSLNodeKey("interface-id", "myId"))); + + builder.to(AAIObjectType.VSERVER, __.key("vserver-name", "myName")).output().to(AAIObjectType.P_INTERFACE) + .output(); + assertEquals("l-interface('interface-id', 'myId') > vserver*('vserver-name', 'myName') > p-interface*", + builder.build()); + } + + @Test + public void skipOutputOnUnionTest() { + DSLQueryBuilder<DSLNode, DSLNode> builder = + new DSLQueryBuilder<>(new DSLNode(AAIObjectType.GENERIC_VNF, __.key("vnf-id", "vnfId")).output()); + + builder.union(__.node(AAIObjectType.PSERVER).output().to(__.node(AAIObjectType.COMPLEX).output()), + __.node(AAIObjectType.VSERVER) + .to(__.node(AAIObjectType.PSERVER).output().to(__.node(AAIObjectType.COMPLEX).output()))) + .output(); + + assertEquals( + "generic-vnf*('vnf-id', 'vnfId') > " + "[ pserver* > complex*, " + "vserver > pserver* > complex* ]", + builder.build()); + } } diff --git a/docs/api/apis/SO_Interface.rst b/docs/api/apis/consumed-apis.rst index d1586eb5d0..0ef69c4da1 100644 --- a/docs/api/apis/SO_Interface.rst +++ b/docs/api/apis/consumed-apis.rst @@ -2,1154 +2,11 @@ .. http://creativecommons.org/licenses/by/4.0 .. Copyright 2018 Huawei Technologies Co., Ltd. -SO Interfaces -============= +API consumed by SO +================== .. image:: ../../images/SO_1.png -SO APIs ----------------- - -North Bound APIs ----------------- -Create service instance -+++++++++++++++++++++++ - -+--------------------+------------------------------------------------------------+ -|Interface Definition|Description | -+====================+============================================================+ -|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6 | -+--------------------+------------------------------------------------------------+ -|Operation Type |POST | -+--------------------+------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+------------------------------------------------------------+ - -Request Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+-------------------+--------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+===================+==========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestParameters |requestParameters Object |Content of requestParameters object. | -+-------------------+--------------------------+-------------------------------------------------+ -|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | -+-------------------+--------------------------+-------------------------------------------------+ -|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | -+-------------------+--------------------------+-------------------------------------------------+ -|project |project Object |Content of project object. | -+-------------------+--------------------------+-------------------------------------------------+ -|owningEntity |owningEntity Object |Content of owningEntity object. | -+-------------------+--------------------------+-------------------------------------------------+ -|platform |platform Object |Content of platform object. | -+-------------------+--------------------------+-------------------------------------------------+ -|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | -+-------------------+--------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelInvariantId |String |The Model Invariant Id. | -+-------------------------+------------------+-------------------------------------------------+ -|ModelNameVersionId |String |The modelname Version Id | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelVersion |String |Version of the model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelCustomization Name |String |The Model Customization name | -+-------------------------+------------------+-------------------------------------------------+ -|modelCustomizationUuid |String |The Model Customization UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelVersionId |String |The Model version id | -+-------------------------+------------------+-------------------------------------------------+ -|modelUuid |String |The Model UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInvariantUuid |String |The Model Invariant UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInstanceName |String |The Model Instance name | -+-------------------------+------------------+-------------------------------------------------+ - - -SubscriberInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|GlobalSubscriberId |String |Global customer Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|SubscriberName |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ -|billingAccountNumber |String |billingAccountNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|callbackUrl |String |callbackUrl of the request | -+-------------------------+------------------+-------------------------------------------------+ -|correlator |String |correlator of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderNumber |String |orderNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|productFamilyId |String |productFamilyId of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderVersion |String |orderVersion of the request | -+-------------------------+------------------+-------------------------------------------------+ -|instanceName |String |instanceName of the request | -+-------------------------+------------------+-------------------------------------------------+ -|suppressRollback |String |suppressRollback of the request | -+-------------------------+------------------+-------------------------------------------------+ -|requestorId |String |requestorId of the request | -+-------------------------+------------------+-------------------------------------------------+ - -RequestParameters Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|SubscriptionServiceType |String |The service type of the Subscription | -+-------------------------+------------------+-------------------------------------------------+ -|UserParams |Array |The product family Id. | -+-------------------------+------------------+-------------------------------------------------+ -|aLaCarte |Boolean | aLaCarte | -+-------------------------+------------------+-------------------------------------------------+ -|autoBuildVfModules |Boolean |autoBuildVfModules | -+-------------------------+------------------+-------------------------------------------------+ -|cascadeDelete |Boolean |cascadeDelete | -+-------------------------+------------------+-------------------------------------------------+ -|usePreload |Boolean |usePreload | -+-------------------------+------------------+-------------------------------------------------+ -|rebuildVolumeGroups |Boolean |rebuildVolumeGroups | -+-------------------------+------------------+-------------------------------------------------+ -|payload |String |payload | -+-------------------------+------------------+-------------------------------------------------+ -|controllerType |String |controllerType | -+-------------------------+------------------+-------------------------------------------------+ - -UserParams Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|name |String |Tag name of attribute | -+-------------------------+------------------+-------------------------------------------------+ -|value |String |Value of the tag | -+-------------------------+------------------+-------------------------------------------------+ - -CloudConfiguration Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|tenantId |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ -|aicNodeClli |String |aicNodeClli property | -+-------------------------+------------------+-------------------------------------------------+ - -Project Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|projectName |String |Name of the project | -+-------------------------+------------------+-------------------------------------------------+ - -OwningEntity Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|owningEntityId |String |owningEntityId of the owingEntity | -+-------------------------+------------------+-------------------------------------------------+ -|owningEntityName |String |owningEntityName of the owingEntity | -+-------------------------+------------------+-------------------------------------------------+ - -Platform Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|platformName |String |Platform Name | -+-------------------------+------------------+-------------------------------------------------+ - -LineOfBusiness Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|lineOfBusinessName |String |Line Of Business Name | -+-------------------------+------------------+-------------------------------------------------+ - -Delete service instance -+++++++++++++++++++++++ - -+--------------------+--------------------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+================================================================================+ -|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId} | -+--------------------+--------------------------------------------------------------------------------+ -|Operation Type |DELETE | -+--------------------+--------------------------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+--------------------------------------------------------------------------------+ - -Request Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+-------------------+-------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+===================+=========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+-------------------+-------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+-------------------+-------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelInvariantId |String |The Model Invariant Id. | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelVersion |String |Version of the model | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ - -Create Volume Group -+++++++++++++++++++ - -+--------------------+------------------------------------------------------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+==================================================================================================================+ -|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups | -+--------------------+------------------------------------------------------------------------------------------------------------------+ -|Operation Type |POST | -+--------------------+------------------------------------------------------------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+------------------------------------------------------------------------------------------------------------------+ - -Request Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+-------------------+--------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+===================+==========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestParameters |requestParameters Object |Content of requestParameters object. | -+-------------------+--------------------------+-------------------------------------------------+ -|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | -+-------------------+--------------------------+-------------------------------------------------+ -|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | -+-------------------+--------------------------+-------------------------------------------------+ -|project |project Object |Content of project object. | -+-------------------+--------------------------+-------------------------------------------------+ -|owningEntity |owningEntity Object |Content of owningEntity object. | -+-------------------+--------------------------+-------------------------------------------------+ -|platform |platform Object |Content of platform object. | -+-------------------+--------------------------+-------------------------------------------------+ -|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | -+-------------------+--------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelInvariantId |String |The Model Invariant Id. | -+-------------------------+------------------+-------------------------------------------------+ -|ModelNameVersionId |String |The modelname Version Id | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelVersion |String |Version of the model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelCustomization Name |String |The Model Customization name | -+-------------------------+------------------+-------------------------------------------------+ -|modelCustomizationUuid |String |The Model Customization UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelVersionId |String |The Model version id | -+-------------------------+------------------+-------------------------------------------------+ -|modelUuid |String |The Model UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInvariantUuid |String |The Model Invariant UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInstanceName |String |The Model Instance name | -+-------------------------+------------------+-------------------------------------------------+ - -CloudConfiguration Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|tenantId |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ -|aicNodeClli |String |aicNodeClli property | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ -|billingAccountNumber |String |billingAccountNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|callbackUrl |String |callbackUrl of the request | -+-------------------------+------------------+-------------------------------------------------+ -|correlator |String |correlator of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderNumber |String |orderNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|productFamilyId |String |productFamilyId of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderVersion |String |orderVersion of the request | -+-------------------------+------------------+-------------------------------------------------+ -|instanceName |String |instanceName of the request | -+-------------------------+------------------+-------------------------------------------------+ -|suppressRollback |String |suppressRollback of the request | -+-------------------------+------------------+-------------------------------------------------+ -|requestorId |String |requestorId of the request | -+-------------------------+------------------+-------------------------------------------------+ - -relatedInstance List - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|relatedInstance |Object |relatedInstance Object | -+-------------------------+------------------+-------------------------------------------------+ - -relatedInstance List - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|instanceId |String |instanceId | -+-------------------------+------------------+-------------------------------------------------+ -|modelInfo |Object |Content of modelInfo object. | -+-------------------------+------------------+-------------------------------------------------+ - -Delete Volume Group -+++++++++++++++++++ - -+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+============================================================================================================================================+ -|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volume-groupinstance-id} | -+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -|Operation Type |DELETE | -+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ - -Request Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+---------------------+-------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=====================+=========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+---------------------+-------------------------+-------------------------------------------------+ -|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. | -+---------------------+-------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+---------------------+-------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ - -CloudConfiguration Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|tenantId |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ - -Create VF Module -++++++++++++++++ - -+--------------------+---------------------------------------------------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+===============================================================================================================+ -|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules | -+--------------------+---------------------------------------------------------------------------------------------------------------+ -|Operation Type |POST | -+--------------------+---------------------------------------------------------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+---------------------------------------------------------------------------------------------------------------+ - -Request Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+---------------------+-------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=====================+=========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+---------------------+-------------------------+-------------------------------------------------+ -|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. | -+---------------------+-------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+---------------------+-------------------------+-------------------------------------------------+ -|relatedInstanceList |List |Content of relatedInstanceList. | -+---------------------+-------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelInvariantId |String |The Model Invariant Id. | -+-------------------------+------------------+-------------------------------------------------+ -|ModelNameVersionId |String |The modelname Version Id | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelVersion |String |Version of the model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelCustomization Name |String |The Model Customization name | -+-------------------------+------------------+-------------------------------------------------+ - -CloudConfiguration Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|tenantId |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|InstanceName |String |The instance Name | -+-------------------------+------------------+-------------------------------------------------+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ -|SuppressRollback |Boolean |SuppressRollback | -+-------------------------+------------------+-------------------------------------------------+ - -relatedInstance List - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|relatedInstance |Object |relatedInstance Object | -+-------------------------+------------------+-------------------------------------------------+ - -relatedInstance List - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|instanceId |String |instanceId | -+-------------------------+------------------+-------------------------------------------------+ -|modelInfo |Object |Content of modelInfo object. | -+-------------------------+------------------+-------------------------------------------------+ -|instanceName |String |Name of the instance | -+-------------------------+------------------+-------------------------------------------------+ - -Delete VF Module -++++++++++++++++ - -+--------------------+-------------------------------------------------------------------------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+=====================================================================================================================================+ -|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleinstance-id} | -+--------------------+-------------------------------------------------------------------------------------------------------------------------------------+ -|Operation Type |DELETE | -+--------------------+-------------------------------------------------------------------------------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+-------------------------------------------------------------------------------------------------------------------------------------+ - -Request Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+---------------------+-------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=====================+=========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+---------------------+-------------------------+-------------------------------------------------+ -|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. | -+---------------------+-------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+---------------------+-------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelInvariantId |String |The Model Invariant Id. | -+-------------------------+------------------+-------------------------------------------------+ -|ModelNameVersionId |String |The modelname Version Id | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelVersion |String |Version of the model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelCustomization Name |String |The Model Customization name | -+-------------------------+------------------+-------------------------------------------------+ - -CloudConfiguration Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|tenantId |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ - -Create VNF -++++++++++ - -+--------------------+-------------------------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+=====================================================================================+ -|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs | -+--------------------+-------------------------------------------------------------------------------------+ -|Operation Type |POST | -+--------------------+-------------------------------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+-------------------------------------------------------------------------------------+ - -Request Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+-------------------+--------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+===================+==========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestParameters |requestParameters Object |Content of requestParameters object. | -+-------------------+--------------------------+-------------------------------------------------+ -|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | -+-------------------+--------------------------+-------------------------------------------------+ -|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | -+-------------------+--------------------------+-------------------------------------------------+ -|project |project Object |Content of project object. | -+-------------------+--------------------------+-------------------------------------------------+ -|owningEntity |owningEntity Object |Content of owningEntity object. | -+-------------------+--------------------------+-------------------------------------------------+ -|platform |platform Object |Content of platform object. | -+-------------------+--------------------------+-------------------------------------------------+ -|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | -+-------------------+--------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelInvariantId |String |The Model Invariant Id. | -+-------------------------+------------------+-------------------------------------------------+ -|ModelNameVersionId |String |The modelname Version Id | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelVersion |String |Version of the model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelCustomization Name |String |The Model Customization name | -+-------------------------+------------------+-------------------------------------------------+ -|modelCustomizationUuid |String |The Model Customization UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelVersionId |String |The Model version id | -+-------------------------+------------------+-------------------------------------------------+ -|modelUuid |String |The Model UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInvariantUuid |String |The Model Invariant UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInstanceName |String |The Model Instance name | -+-------------------------+------------------+-------------------------------------------------+ - -CloudConfiguration Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|tenantId |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ -|billingAccountNumber |String |billingAccountNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|callbackUrl |String |callbackUrl of the request | -+-------------------------+------------------+-------------------------------------------------+ -|correlator |String |correlator of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderNumber |String |orderNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|productFamilyId |String |productFamilyId of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderVersion |String |orderVersion of the request | -+-------------------------+------------------+-------------------------------------------------+ -|instanceName |String |instanceName of the request | -+-------------------------+------------------+-------------------------------------------------+ -|suppressRollback |String |suppressRollback of the request | -+-------------------------+------------------+-------------------------------------------------+ -|requestorId |String |requestorId of the request | -+-------------------------+------------------+-------------------------------------------------+ - -relatedInstance List - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|relatedInstance |Object |relatedInstance Object | -+-------------------------+------------------+-------------------------------------------------+ - -relatedInstance List - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|instanceId |String |instanceId | -+-------------------------+------------------+-------------------------------------------------+ -|modelInfo |Object |Content of modelInfo object. | -+-------------------------+------------------+-------------------------------------------------+ - -RequestParameters Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|UserParams |Array |The product family Id. | -+-------------------------+------------------+-------------------------------------------------+ - -UserParams Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|name |String |Tag name of attribute | -+-------------------------+------------------+-------------------------------------------------+ -|value |String |Value of the tag | -+-------------------------+------------------+-------------------------------------------------+ - -Delete VNF -++++++++++ - -+--------------------+-----------------------------------------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+=====================================================================================================+ -|URI |/onap/so/infra/serviceInstantiation/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId} | -+--------------------+-----------------------------------------------------------------------------------------------------+ -|Operation Type |DELETE | -+--------------------+-----------------------------------------------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+-----------------------------------------------------------------------------------------------------+ - -Request Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+---------------------+-------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=====================+=========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+---------------------+-------------------------+-------------------------------------------------+ -|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. | -+---------------------+-------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+---------------------+-------------------------+-------------------------------------------------+ -|requestParameters |requestParameters Object |Content of requestParameters object. | -+---------------------+-------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ - -CloudConfiguration Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|tenantId |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ - -RequestParameters Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|UserParams |Array |The product family Id. | -+-------------------------+------------------+-------------------------------------------------+ - -UserParams Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|name |String |Tag name of attribute | -+-------------------------+------------------+-------------------------------------------------+ -|value |String |Value of the tag | -+-------------------------+------------------+-------------------------------------------------+ - -GET Orchestration Request -+++++++++++++++++++++++++ - -+--------------------+-------------------------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+=====================================================================================+ -|URI |/onap/so/infra/serviceInstantiation/orchestrationRequests/v6/{request-id} | -+--------------------+-------------------------------------------------------------------------------------+ -|Operation Type |GET | -+--------------------+-------------------------------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+-------------------------------------------------------------------------------------+ - -Response Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|request |M |1 |request Object |Content of request object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -Request Object - -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+===================+=========+===========+==========================+===========================================+ -|requestId |M |1 |String |Request Id | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|startTime |M |1 |request Object |Start time. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|requestScope |M |1 |request Object |Scope of the request. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|requestType |M |1 |request Object |Type of the request. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|requestDetails |M |1 |requestDetails Object |Type of the request. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|requestStatus |M |1 |requestStatus Object |Type of the request. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+-------------------+--------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+===================+==========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestParameters |requestParameters Object |Content of requestParameters object. | -+-------------------+--------------------------+-------------------------------------------------+ -|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | -+-------------------+--------------------------+-------------------------------------------------+ -|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | -+-------------------+--------------------------+-------------------------------------------------+ -|project |project Object |Content of project object. | -+-------------------+--------------------------+-------------------------------------------------+ -|owningEntity |owningEntity Object |Content of owningEntity object. | -+-------------------+--------------------------+-------------------------------------------------+ -|platform |platform Object |Content of platform object. | -+-------------------+--------------------------+-------------------------------------------------+ -|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | -+-------------------+--------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelInvariantId |String |The Model Invariant Id. | -+-------------------------+------------------+-------------------------------------------------+ -|ModelNameVersionId |String |The modelname Version Id | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelVersion |String |Version of the model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelCustomization Name |String |The Model Customization name | -+-------------------------+------------------+-------------------------------------------------+ -|modelCustomizationUuid |String |The Model Customization UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelVersionId |String |The Model version id | -+-------------------------+------------------+-------------------------------------------------+ -|modelUuid |String |The Model UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInvariantUuid |String |The Model Invariant UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInstanceName |String |The Model Instance name | -+-------------------------+------------------+-------------------------------------------------+ - -SubscriberInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|GlobalSubscriberId |String |Global customer Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|SubscriberName |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ -|billingAccountNumber |String |billingAccountNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|callbackUrl |String |callbackUrl of the request | -+-------------------------+------------------+-------------------------------------------------+ -|correlator |String |correlator of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderNumber |String |orderNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|productFamilyId |String |productFamilyId of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderVersion |String |orderVersion of the request | -+-------------------------+------------------+-------------------------------------------------+ -|instanceName |String |instanceName of the request | -+-------------------------+------------------+-------------------------------------------------+ -|suppressRollback |String |suppressRollback of the request | -+-------------------------+------------------+-------------------------------------------------+ -|requestorId |String |requestorId of the request | -+-------------------------+------------------+-------------------------------------------------+ - -RequestParameters Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|SubscriptionServiceType |String |The service type of the Subscription | -+-------------------------+------------------+-------------------------------------------------+ - -RequestStatus Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|finishTime |String |Time | -+-------------------------+------------------+-------------------------------------------------+ -|requestState |String |state of the request | -+-------------------------+------------------+-------------------------------------------------+ -|statusMessage |String |statusMessage | -+-------------------------+------------------+-------------------------------------------------+ -|percentProgress |String |percentage of progress | -+-------------------------+------------------+-------------------------------------------------+ - -GET Orchestration Requests -++++++++++++++++++++++++++ - -+--------------------+--------------------------------------------------------------+ -|Interface Definition|Description | -+====================+==============================================================+ -|URI |/onap/so/infra/serviceInstantiation/orchestrationRequests/v6 | -+--------------------+--------------------------------------------------------------+ -|Operation Type |GET | -+--------------------+--------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+--------------------------------------------------------------+ - -Response Body: - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|requestList |M |1 |Array |Content of request List. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestList : - -+----------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+================+=========+===========+==========================+===========================================+ -|request |M |1 |request Object |Content of request object. | -+----------------+---------+-----------+--------------------------+-------------------------------------------+ - -Request Object - -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content |Description | -+===================+=========+===========+==========================+===========================================+ -|requestId |M |1 |String |Request Id. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|startTime |M |1 |request Object |Start time. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|requestScope |M |1 |request Object |Scope of the request. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|requestType |M |1 |request Object |Type of the request. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|requestDetails |M |1 |requestDetails Object |Type of the request. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ -|requestStatus |M |1 |requestStatus Object |Type of the request. | -+-------------------+---------+-----------+--------------------------+-------------------------------------------+ - -RequestDetails Object - -+-------------------+--------------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+===================+==========================+=================================================+ -|modelInfo |modelInfo Object |Content of modelInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestInfo |requestInfo Object |Content of requestInfo object. | -+-------------------+--------------------------+-------------------------------------------------+ -|requestParameters |requestParameters Object |Content of requestParameters object. | -+-------------------+--------------------------+-------------------------------------------------+ -|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | -+-------------------+--------------------------+-------------------------------------------------+ -|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | -+-------------------+--------------------------+-------------------------------------------------+ -|project |project Object |Content of project object. | -+-------------------+--------------------------+-------------------------------------------------+ -|owningEntity |owningEntity Object |Content of owningEntity object. | -+-------------------+--------------------------+-------------------------------------------------+ -|platform |platform Object |Content of platform object. | -+-------------------+--------------------------+-------------------------------------------------+ -|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | -+-------------------+--------------------------+-------------------------------------------------+ - -ModelInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|ModelType |String |Type of model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelInvariantId |String |The Model Invariant Id. | -+-------------------------+------------------+-------------------------------------------------+ -|ModelNameVersionId |String |The modelname Version Id | -+-------------------------+------------------+-------------------------------------------------+ -|ModelName |String |Name of the Model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelVersion |String |Version of the model | -+-------------------------+------------------+-------------------------------------------------+ -|ModelCustomization Name |String |The Model Customization name | -+-------------------------+------------------+-------------------------------------------------+ -|modelCustomizationUuid |String |The Model Customization UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelVersionId |String |The Model version id | -+-------------------------+------------------+-------------------------------------------------+ -|modelUuid |String |The Model UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInvariantUuid |String |The Model Invariant UUid | -+-------------------------+------------------+-------------------------------------------------+ -|modelInstanceName |String |The Model Instance name | -+-------------------------+------------------+-------------------------------------------------+ - -SubscriberInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|GlobalSubscriberId |String |Global customer Id (in A&AI) | -+-------------------------+------------------+-------------------------------------------------+ -|SubscriberName |String |Name of the Subscriber | -+-------------------------+------------------+-------------------------------------------------+ - -RequestInfo Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|Source |String |source of the request | -+-------------------------+------------------+-------------------------------------------------+ -|billingAccountNumber |String |billingAccountNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|callbackUrl |String |callbackUrl of the request | -+-------------------------+------------------+-------------------------------------------------+ -|correlator |String |correlator of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderNumber |String |orderNumber of the request | -+-------------------------+------------------+-------------------------------------------------+ -|productFamilyId |String |productFamilyId of the request | -+-------------------------+------------------+-------------------------------------------------+ -|orderVersion |String |orderVersion of the request | -+-------------------------+------------------+-------------------------------------------------+ -|instanceName |String |instanceName of the request | -+-------------------------+------------------+-------------------------------------------------+ -|suppressRollback |String |suppressRollback of the request | -+-------------------------+------------------+-------------------------------------------------+ -|requestorId |String |requestorId of the request | -+-------------------------+------------------+-------------------------------------------------+ - -RequestParameters Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|SubscriptionServiceType |String |The service type of the Subscription | -+-------------------------+------------------+-------------------------------------------------+ - -RequestStatus Object - -+-------------------------+------------------+-------------------------------------------------+ -|Attribute |Content |Description | -+=========================+==================+=================================================+ -|finishTime |String |Time | -+-------------------------+------------------+-------------------------------------------------+ -|requestState |String |state of the request | -+-------------------------+------------------+-------------------------------------------------+ -|statusMessage |String |statusMessage | -+-------------------------+------------------+-------------------------------------------------+ -|percentProgress |String |percentage of progress | -+-------------------------+------------------+-------------------------------------------------+ SDC Client API -------------- @@ -1371,181 +228,6 @@ Response: |Content-Disposition |M |Specifies the name of file to store the downloaded artifact’s payload ( RFC 2183) . | +--------------------+---------+--------------------------------------------------------------------------------------------------------------------------+ -E2E Service API ---------------- - -Create E2E service instance -+++++++++++++++++++++++++++ - -+--------------------+------------------------------------------------------------+ -|Interface Definition|Description | -+====================+============================================================+ -|URI |/onap/so/infra/serviceInstantiation/e2eServiceInstances/v3 | -+--------------------+------------------------------------------------------------+ -|Operation Type |POST | -+--------------------+------------------------------------------------------------+ -|Content-Type |application/json | -+--------------------+------------------------------------------------------------+ - -Request Body: - -+---------+---------+-----------+--------------------------+-----------------------------+ -|Attribute|Qualifier|Cardinality|Content |Description | -+=========+=========+===========+==========================+=============================+ -|service |M |1 |Service Object |Content of service object. | -+---------+---------+-----------+--------------------------+-----------------------------+ - -Service Object - -+------------------------------+-----------------+------------------------------------+ -|Attribute |Content |Description | -+==============================+=================+====================================+ -|name |String |Service instance name. | -+------------------------------+-----------------+------------------------------------+ -|description |String |Service instance description | -+------------------------------+-----------------+------------------------------------+ -|serviceUuid |String |Model UUID | -+------------------------------+-----------------+------------------------------------+ -|serviceInvariantUuid |String |Model Invariant UUID | -+------------------------------+-----------------+------------------------------------+ -|gloabalSubscriberId |String |Customer Id | -+------------------------------+-----------------+------------------------------------+ -|serviceType |String |service Type | -+------------------------------+-----------------+------------------------------------+ -|parameters |Object |Parameter Object | -+------------------------------+-----------------+------------------------------------+ - -Parameter Object - -+------------------------------+-----------------+------------------------------------+ -|Attribute |Content |Description | -+==============================+=================+====================================+ -|locationConstraints |List of object |location infor for each vnf | -+------------------------------+-----------------+------------------------------------+ -|resource |List of Resource |resource of service/resource | -+------------------------------+-----------------+------------------------------------+ -|requestInputs |key-value map |input of service/resource | -+------------------------------+-----------------+------------------------------------+ - -LocationConstraint Object - -+------------------------------+-----------------+------------------------------------+ -|Attribute |Content |Description | -+==============================+=================+====================================+ -|vnfProfileId |String |Customization id for VNF | -+------------------------------+-----------------+------------------------------------+ -|locationConstraints |Object |DC location info of VNF | -+------------------------------+-----------------+------------------------------------+ - -VnfLocationConstraint Object - -+------------------------------+-----------------+------------------------------------+ -|Attribute |Content |Description | -+==============================+=================+====================================+ -|vimId |String |VIM id from ESR definition | -+------------------------------+-----------------+------------------------------------+ - -Resource Object - -+------------------------------+-----------------+------------------------------------+ -|Attribute |Content |Description | -+==============================+=================+====================================+ -|resourceName |String |The resource name | -+------------------------------+-----------------+------------------------------------+ -|resourceInvariantUuid |String |The resource invariant UUID. | -+------------------------------+-----------------+------------------------------------+ -|resourceUuid |String |The resource UUID. | -+------------------------------+-----------------+------------------------------------+ -|resourceCustomizationUuid |String |The resource customization UUID. | -+------------------------------+-----------------+------------------------------------+ -|parameters |Object |Parameter of resource | -+------------------------------+-----------------+------------------------------------+ - -Response: - -+-------------+---------+-----------+-------+------------------------------------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content|Description | -+-------------+---------+-----------+-------+------------------------------------------------------------------------+ -|serviceId |M |1 |String |Service instance ID. | -+-------------+---------+-----------+-------+------------------------------------------------------------------------+ -|operationId |M |1 |String |Service Operation ID. | -+-------------+---------+-----------+-------+------------------------------------------------------------------------+ - -Delete E2E service instance -+++++++++++++++++++++++++++ - -+--------------------+----------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+======================================================================+ -|URI |/onap/so/infra/serviceInstantiation/e2eServiceInstances/v3/{serviceId}| -+--------------------+----------------------------------------------------------------------+ -|Operation Type |DELETE | -+--------------------+----------------------------------------------------------------------+ - -Request Parameters: - -+-------------------+---------+-----------+-------+----------------------------------------+ -|Attribute |Qualifier|Cardinality|Content|Description | -+===================+=========+===========+=======+========================================+ -|globalSubscriberId |M |1 |String |The subscriber id. It is defined in AAI | -+-------------------+---------+-----------+-------+----------------------------------------+ -|serviceType |M |1 |String |The service type. It is defined in AAI | -+-------------------+---------+-----------+-------+----------------------------------------+ - -Response: - -+-------------+---------+-----------+-------+------------------------------------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content|Description | -+-------------+---------+-----------+-------+------------------------------------------------------------------------+ -|operationId |M |1 |String |The operation id. | -+-------------+---------+-----------+-------+------------------------------------------------------------------------+ - -Query E2E service operation result -++++++++++++++++++++++++++++++++++ - -+--------------------+-----------------------------------------------------------------------------------------------+ -|Interface Definition|Description | -+====================+===============================================================================================+ -|URI |/onap/so/infra/serviceInstantiation/e2eServiceInstances/v3/{serviceId}/operations/{operationId}| -+--------------------+-----------------------------------------------------------------------------------------------+ -|Operation Type |GET | -+--------------------+-----------------------------------------------------------------------------------------------+ - -Request Parameters: - -+--------------+---------+-----------+-------+--------------+ -|Attribute |Qualifier|Cardinality|Content|Description | -+==============+=========+===========+=======+==============+ -|serviceId |M |1 |Service instance ID. | -+--------------+---------+-----------+-------+--------------+ -|operationId |M |1 |Service Operation ID. | -+--------------+---------+-----------+-------+--------------+ - -Response: - -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|Attribute |Qualifier|Cardinality|Content|Description | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|operation |M |1 |String |Operation object identify. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|operationId |M |1 |String |Operation ID. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|operation |M |1 |String |Operation type, create|delete. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|result |M |1 |String |Operation result: finished, error, processing. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|reason |M |1 |String |If failing, need to write fail reason. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|userId |M |1 |String |Operation user ID. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|operationContent |M |1 |String |The status detail of current operation which is being executing. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|progress |M |1 |String |Current operation progress. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|operateAt |M |1 |String |Time that it starts to execute operation. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ -|finishedAt |M |1 |String |Time that it finished executing operation. | -+------------------+---------+-----------+-------+------------------------------------------------------------------------+ Inventory APIs -------------- @@ -4044,7 +2726,7 @@ Candidates Object +-------------------+---------+-----------+-------+--------------------------------------------------------------------------------+ |identifiers |Y |1..N |List |A list of identifiers. | +-------------------+---------+-----------+-------+--------------------------------------------------------------------------------+ -|cloudOwner |C |1 |String |The name of a cloud owner. Only required if identifierType is cloud_region_id. | +|cloudOwner |C |1 |String |The name of a cloud owner. Only required if identifierType is cloud_region_id. | +-------------------+---------+-----------+-------+--------------------------------------------------------------------------------+ diff --git a/docs/api/apis/e2eServiceInstances-api.rst b/docs/api/apis/e2eServiceInstances-api.rst new file mode 100644 index 0000000000..08434efdfd --- /dev/null +++ b/docs/api/apis/e2eServiceInstances-api.rst @@ -0,0 +1,185 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 Huawei Technologies Co., Ltd. + +e2eServiceInstances API +======================= + +This API allows to manage: + +- e2eServiceInstances (create and delete) +- operations on e2eServiceInstances (get) + + +Create E2E service instance ++++++++++++++++++++++++++++ + ++--------------------+------------------------------------------------------------+ +|Interface Definition|Description | ++====================+============================================================+ +|URI |/onap/so/infra/e2eServiceInstances/v3 | ++--------------------+------------------------------------------------------------+ +|Operation Type |POST | ++--------------------+------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+------------------------------------------------------------+ + +Request Body: + ++---------+---------+-----------+--------------------------+-----------------------------+ +|Attribute|Qualifier|Cardinality|Content |Description | ++=========+=========+===========+==========================+=============================+ +|service |M |1 |Service Object |Content of service object. | ++---------+---------+-----------+--------------------------+-----------------------------+ + +Service Object + ++------------------------------+-----------------+------------------------------------+ +|Attribute |Content |Description | ++==============================+=================+====================================+ +|name |String |Service instance name. | ++------------------------------+-----------------+------------------------------------+ +|description |String |Service instance description | ++------------------------------+-----------------+------------------------------------+ +|serviceUuid |String |Model UUID | ++------------------------------+-----------------+------------------------------------+ +|serviceInvariantUuid |String |Model Invariant UUID | ++------------------------------+-----------------+------------------------------------+ +|gloabalSubscriberId |String |Customer Id | ++------------------------------+-----------------+------------------------------------+ +|serviceType |String |service Type | ++------------------------------+-----------------+------------------------------------+ +|parameters |Object |Parameter Object | ++------------------------------+-----------------+------------------------------------+ + +Parameter Object + ++------------------------------+-----------------+------------------------------------+ +|Attribute |Content |Description | ++==============================+=================+====================================+ +|locationConstraints |List of object |location infor for each vnf | ++------------------------------+-----------------+------------------------------------+ +|resource |List of Resource |resource of service/resource | ++------------------------------+-----------------+------------------------------------+ +|requestInputs |key-value map |input of service/resource | ++------------------------------+-----------------+------------------------------------+ + +LocationConstraint Object + ++------------------------------+-----------------+------------------------------------+ +|Attribute |Content |Description | ++==============================+=================+====================================+ +|vnfProfileId |String |Customization id for VNF | ++------------------------------+-----------------+------------------------------------+ +|locationConstraints |Object |DC location info of VNF | ++------------------------------+-----------------+------------------------------------+ + +VnfLocationConstraint Object + ++------------------------------+-----------------+------------------------------------+ +|Attribute |Content |Description | ++==============================+=================+====================================+ +|vimId |String |VIM id from ESR definition | ++------------------------------+-----------------+------------------------------------+ + +Resource Object + ++------------------------------+-----------------+------------------------------------+ +|Attribute |Content |Description | ++==============================+=================+====================================+ +|resourceName |String |The resource name | ++------------------------------+-----------------+------------------------------------+ +|resourceInvariantUuid |String |The resource invariant UUID. | ++------------------------------+-----------------+------------------------------------+ +|resourceUuid |String |The resource UUID. | ++------------------------------+-----------------+------------------------------------+ +|resourceCustomizationUuid |String |The resource customization UUID. | ++------------------------------+-----------------+------------------------------------+ +|parameters |Object |Parameter of resource | ++------------------------------+-----------------+------------------------------------+ + +Response: + ++-------------+---------+-----------+-------+------------------------------------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content|Description | ++-------------+---------+-----------+-------+------------------------------------------------------------------------+ +|serviceId |M |1 |String |Service instance ID. | ++-------------+---------+-----------+-------+------------------------------------------------------------------------+ +|operationId |M |1 |String |Service Operation ID. | ++-------------+---------+-----------+-------+------------------------------------------------------------------------+ + +Delete E2E service instance ++++++++++++++++++++++++++++ + ++--------------------+----------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+======================================================================+ +|URI |/onap/so/infra/e2eServiceInstances/v3/{serviceId} | ++--------------------+----------------------------------------------------------------------+ +|Operation Type |DELETE | ++--------------------+----------------------------------------------------------------------+ + +Request Parameters: + ++-------------------+---------+-----------+-------+----------------------------------------+ +|Attribute |Qualifier|Cardinality|Content|Description | ++===================+=========+===========+=======+========================================+ +|globalSubscriberId |M |1 |String |The subscriber id. It is defined in AAI | ++-------------------+---------+-----------+-------+----------------------------------------+ +|serviceType |M |1 |String |The service type. It is defined in AAI | ++-------------------+---------+-----------+-------+----------------------------------------+ + +Response: + ++-------------+---------+-----------+-------+------------------------------------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content|Description | ++-------------+---------+-----------+-------+------------------------------------------------------------------------+ +|operationId |M |1 |String |The operation id. | ++-------------+---------+-----------+-------+------------------------------------------------------------------------+ + +Query E2E service operation result +++++++++++++++++++++++++++++++++++ + ++--------------------+-----------------------------------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+===============================================================================================+ +|URI |/onap/so/infra/e2eServiceInstances/v3/{serviceId}/operations/{operationId} | ++--------------------+-----------------------------------------------------------------------------------------------+ +|Operation Type |GET | ++--------------------+-----------------------------------------------------------------------------------------------+ + +Request Parameters: + ++--------------+---------+-----------+-------+--------------+ +|Attribute |Qualifier|Cardinality|Content|Description | ++==============+=========+===========+=======+==============+ +|serviceId |M |1 |Service instance ID. | ++--------------+---------+-----------+-------+--------------+ +|operationId |M |1 |Service Operation ID. | ++--------------+---------+-----------+-------+--------------+ + +Response: + ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content|Description | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|operation |M |1 |String |Operation object identify. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|operationId |M |1 |String |Operation ID. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|operation |M |1 |String |Operation type, create|delete. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|result |M |1 |String |Operation result: finished, error, processing. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|reason |M |1 |String |If failing, need to write fail reason. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|userId |M |1 |String |Operation user ID. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|operationContent |M |1 |String |The status detail of current operation which is being executing. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|progress |M |1 |String |Current operation progress. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|operateAt |M |1 |String |Time that it starts to execute operation. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ +|finishedAt |M |1 |String |Time that it finished executing operation. | ++------------------+---------+-----------+-------+------------------------------------------------------------------------+ diff --git a/docs/api/apis/serviceInstances-api.rst b/docs/api/apis/serviceInstances-api.rst new file mode 100644 index 0000000000..b3fd2cf47d --- /dev/null +++ b/docs/api/apis/serviceInstances-api.rst @@ -0,0 +1,1192 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2018 Huawei Technologies Co., Ltd. + +serviceInstances API +==================== + + +This API allows to generate some requests to manage: + +- serviceInstances (create, delete) +- volumeGroups attached to a vnf instance (create, delete) +- vfModules attached to a vnf instance (create, delete) +- vnfs attached to a service instance (create, delete) +- orchestrationRequests (get) + +links: + +- :ref:`create_service_instance` +- :ref:`delete_service_instance` +- :ref:`create_volume_group` +- :ref:`delete_volume_group` +- :ref:`create_vf_module` +- :ref:`delete_vf_module` +- :ref:`create_vnf` +- :ref:`delete_vnf` +- :ref:`get_orchestration_request_by_id` +- :ref:`get_orchestration_request_all` + + +.. _create_service_instance: + +Create service instance ++++++++++++++++++++++++ + ++--------------------+--------------------------------------------------------+ +|Interface Definition|Description | ++====================+========================================================+ +|URI |/onap/so/infra/serviceInstances/v6 | ++--------------------+--------------------------------------------------------+ +|Operation Type |POST | ++--------------------+--------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+--------------------------------------------------------+ + +Request Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++-------------------+--------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++===================+==========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestParameters |requestParameters Object |Content of requestParameters object. | ++-------------------+--------------------------+-------------------------------------------------+ +|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | ++-------------------+--------------------------+-------------------------------------------------+ +|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | ++-------------------+--------------------------+-------------------------------------------------+ +|project |project Object |Content of project object. | ++-------------------+--------------------------+-------------------------------------------------+ +|owningEntity |owningEntity Object |Content of owningEntity object. | ++-------------------+--------------------------+-------------------------------------------------+ +|platform |platform Object |Content of platform object. | ++-------------------+--------------------------+-------------------------------------------------+ +|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | ++-------------------+--------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelInvariantId |String |The Model Invariant Id. | ++-------------------------+------------------+-------------------------------------------------+ +|ModelNameVersionId |String |The modelname Version Id | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelVersion |String |Version of the model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelCustomization Name |String |The Model Customization name | ++-------------------------+------------------+-------------------------------------------------+ +|modelCustomizationUuid |String |The Model Customization UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelVersionId |String |The Model version id | ++-------------------------+------------------+-------------------------------------------------+ +|modelUuid |String |The Model UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInvariantUuid |String |The Model Invariant UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInstanceName |String |The Model Instance name | ++-------------------------+------------------+-------------------------------------------------+ + + +SubscriberInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|GlobalSubscriberId |String |Global customer Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|SubscriberName |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ +|billingAccountNumber |String |billingAccountNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|callbackUrl |String |callbackUrl of the request | ++-------------------------+------------------+-------------------------------------------------+ +|correlator |String |correlator of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderNumber |String |orderNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|productFamilyId |String |productFamilyId of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderVersion |String |orderVersion of the request | ++-------------------------+------------------+-------------------------------------------------+ +|instanceName |String |instanceName of the request | ++-------------------------+------------------+-------------------------------------------------+ +|suppressRollback |String |suppressRollback of the request | ++-------------------------+------------------+-------------------------------------------------+ +|requestorId |String |requestorId of the request | ++-------------------------+------------------+-------------------------------------------------+ + +RequestParameters Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|SubscriptionServiceType |String |The service type of the Subscription | ++-------------------------+------------------+-------------------------------------------------+ +|UserParams |Array |The product family Id. | ++-------------------------+------------------+-------------------------------------------------+ +|aLaCarte |Boolean | aLaCarte | ++-------------------------+------------------+-------------------------------------------------+ +|autoBuildVfModules |Boolean |autoBuildVfModules | ++-------------------------+------------------+-------------------------------------------------+ +|cascadeDelete |Boolean |cascadeDelete | ++-------------------------+------------------+-------------------------------------------------+ +|usePreload |Boolean |usePreload | ++-------------------------+------------------+-------------------------------------------------+ +|rebuildVolumeGroups |Boolean |rebuildVolumeGroups | ++-------------------------+------------------+-------------------------------------------------+ +|payload |String |payload | ++-------------------------+------------------+-------------------------------------------------+ +|controllerType |String |controllerType | ++-------------------------+------------------+-------------------------------------------------+ + +UserParams Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|name |String |Tag name of attribute | ++-------------------------+------------------+-------------------------------------------------+ +|value |String |Value of the tag | ++-------------------------+------------------+-------------------------------------------------+ + +CloudConfiguration Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|tenantId |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ +|aicNodeClli |String |aicNodeClli property | ++-------------------------+------------------+-------------------------------------------------+ + +Project Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|projectName |String |Name of the project | ++-------------------------+------------------+-------------------------------------------------+ + +OwningEntity Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|owningEntityId |String |owningEntityId of the owingEntity | ++-------------------------+------------------+-------------------------------------------------+ +|owningEntityName |String |owningEntityName of the owingEntity | ++-------------------------+------------------+-------------------------------------------------+ + +Platform Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|platformName |String |Platform Name | ++-------------------------+------------------+-------------------------------------------------+ + +LineOfBusiness Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|lineOfBusinessName |String |Line Of Business Name | ++-------------------------+------------------+-------------------------------------------------+ + + +.. _delete_service_instance: + +Delete service instance ++++++++++++++++++++++++ + ++--------------------+--------------------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+================================================================================+ +|URI |/onap/so/infra/serviceInstances/v6/{serviceInstanceId} | ++--------------------+--------------------------------------------------------------------------------+ +|Operation Type |DELETE | ++--------------------+--------------------------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+--------------------------------------------------------------------------------+ + +Request Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++-------------------+-------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++===================+=========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++-------------------+-------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++-------------------+-------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelInvariantId |String |The Model Invariant Id. | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelVersion |String |Version of the model | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ + + +.. _create_volume_group: + +Create Volume Group ++++++++++++++++++++ + ++--------------------+------------------------------------------------------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+==================================================================================================================+ +|URI |/onap/so/infra/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups | ++--------------------+------------------------------------------------------------------------------------------------------------------+ +|Operation Type |POST | ++--------------------+------------------------------------------------------------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+------------------------------------------------------------------------------------------------------------------+ + +Request Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++-------------------+--------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++===================+==========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestParameters |requestParameters Object |Content of requestParameters object. | ++-------------------+--------------------------+-------------------------------------------------+ +|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | ++-------------------+--------------------------+-------------------------------------------------+ +|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | ++-------------------+--------------------------+-------------------------------------------------+ +|project |project Object |Content of project object. | ++-------------------+--------------------------+-------------------------------------------------+ +|owningEntity |owningEntity Object |Content of owningEntity object. | ++-------------------+--------------------------+-------------------------------------------------+ +|platform |platform Object |Content of platform object. | ++-------------------+--------------------------+-------------------------------------------------+ +|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | ++-------------------+--------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelInvariantId |String |The Model Invariant Id. | ++-------------------------+------------------+-------------------------------------------------+ +|ModelNameVersionId |String |The modelname Version Id | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelVersion |String |Version of the model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelCustomization Name |String |The Model Customization name | ++-------------------------+------------------+-------------------------------------------------+ +|modelCustomizationUuid |String |The Model Customization UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelVersionId |String |The Model version id | ++-------------------------+------------------+-------------------------------------------------+ +|modelUuid |String |The Model UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInvariantUuid |String |The Model Invariant UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInstanceName |String |The Model Instance name | ++-------------------------+------------------+-------------------------------------------------+ + +CloudConfiguration Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|tenantId |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ +|aicNodeClli |String |aicNodeClli property | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ +|billingAccountNumber |String |billingAccountNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|callbackUrl |String |callbackUrl of the request | ++-------------------------+------------------+-------------------------------------------------+ +|correlator |String |correlator of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderNumber |String |orderNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|productFamilyId |String |productFamilyId of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderVersion |String |orderVersion of the request | ++-------------------------+------------------+-------------------------------------------------+ +|instanceName |String |instanceName of the request | ++-------------------------+------------------+-------------------------------------------------+ +|suppressRollback |String |suppressRollback of the request | ++-------------------------+------------------+-------------------------------------------------+ +|requestorId |String |requestorId of the request | ++-------------------------+------------------+-------------------------------------------------+ + +relatedInstance List + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|relatedInstance |Object |relatedInstance Object | ++-------------------------+------------------+-------------------------------------------------+ + +relatedInstance List + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|instanceId |String |instanceId | ++-------------------------+------------------+-------------------------------------------------+ +|modelInfo |Object |Content of modelInfo object. | ++-------------------------+------------------+-------------------------------------------------+ + +.. _delete_volume_group: + +Delete Volume Group ++++++++++++++++++++ + ++--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+============================================================================================================================================+ +|URI |/onap/so/infra/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups/{volume-groupinstance-id} | ++--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +|Operation Type |DELETE | ++--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+--------------------------------------------------------------------------------------------------------------------------------------------+ + +Request Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++---------------------+-------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=====================+=========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++---------------------+-------------------------+-------------------------------------------------+ +|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. | ++---------------------+-------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++---------------------+-------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ + +CloudConfiguration Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|tenantId |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ + +.. _create_vf_module: + +Create VF Module +++++++++++++++++ + ++--------------------+---------------------------------------------------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+===============================================================================================================+ +|URI |/onap/so/infra/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules | ++--------------------+---------------------------------------------------------------------------------------------------------------+ +|Operation Type |POST | ++--------------------+---------------------------------------------------------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+---------------------------------------------------------------------------------------------------------------+ + +Request Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++---------------------+-------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=====================+=========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++---------------------+-------------------------+-------------------------------------------------+ +|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. | ++---------------------+-------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++---------------------+-------------------------+-------------------------------------------------+ +|relatedInstanceList |List |Content of relatedInstanceList. | ++---------------------+-------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelInvariantId |String |The Model Invariant Id. | ++-------------------------+------------------+-------------------------------------------------+ +|ModelNameVersionId |String |The modelname Version Id | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelVersion |String |Version of the model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelCustomization Name |String |The Model Customization name | ++-------------------------+------------------+-------------------------------------------------+ + +CloudConfiguration Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|tenantId |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|InstanceName |String |The instance Name | ++-------------------------+------------------+-------------------------------------------------+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ +|SuppressRollback |Boolean |SuppressRollback | ++-------------------------+------------------+-------------------------------------------------+ + +relatedInstance List + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|relatedInstance |Object |relatedInstance Object | ++-------------------------+------------------+-------------------------------------------------+ + +relatedInstance List + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|instanceId |String |instanceId | ++-------------------------+------------------+-------------------------------------------------+ +|modelInfo |Object |Content of modelInfo object. | ++-------------------------+------------------+-------------------------------------------------+ +|instanceName |String |Name of the instance | ++-------------------------+------------------+-------------------------------------------------+ + +.. _delete_vf_module: + +Delete VF Module +++++++++++++++++ + ++--------------------+-------------------------------------------------------------------------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+=====================================================================================================================================+ +|URI |/onap/so/infra/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId}/vfModules/{vfmoduleinstance-id} | ++--------------------+-------------------------------------------------------------------------------------------------------------------------------------+ +|Operation Type |DELETE | ++--------------------+-------------------------------------------------------------------------------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+-------------------------------------------------------------------------------------------------------------------------------------+ + +Request Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++---------------------+-------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=====================+=========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++---------------------+-------------------------+-------------------------------------------------+ +|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. | ++---------------------+-------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++---------------------+-------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelInvariantId |String |The Model Invariant Id. | ++-------------------------+------------------+-------------------------------------------------+ +|ModelNameVersionId |String |The modelname Version Id | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelVersion |String |Version of the model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelCustomization Name |String |The Model Customization name | ++-------------------------+------------------+-------------------------------------------------+ + +CloudConfiguration Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|tenantId |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ + + +.. _create_vnf: + +Create VNF +++++++++++ + ++--------------------+-------------------------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+=====================================================================================+ +|URI |/onap/so/infra/serviceInstances/v6/{serviceInstanceId}/vnfs | ++--------------------+-------------------------------------------------------------------------------------+ +|Operation Type |POST | ++--------------------+-------------------------------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+-------------------------------------------------------------------------------------+ + +Request Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++-------------------+--------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++===================+==========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestParameters |requestParameters Object |Content of requestParameters object. | ++-------------------+--------------------------+-------------------------------------------------+ +|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | ++-------------------+--------------------------+-------------------------------------------------+ +|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | ++-------------------+--------------------------+-------------------------------------------------+ +|project |project Object |Content of project object. | ++-------------------+--------------------------+-------------------------------------------------+ +|owningEntity |owningEntity Object |Content of owningEntity object. | ++-------------------+--------------------------+-------------------------------------------------+ +|platform |platform Object |Content of platform object. | ++-------------------+--------------------------+-------------------------------------------------+ +|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | ++-------------------+--------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelInvariantId |String |The Model Invariant Id. | ++-------------------------+------------------+-------------------------------------------------+ +|ModelNameVersionId |String |The modelname Version Id | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelVersion |String |Version of the model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelCustomization Name |String |The Model Customization name | ++-------------------------+------------------+-------------------------------------------------+ +|modelCustomizationUuid |String |The Model Customization UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelVersionId |String |The Model version id | ++-------------------------+------------------+-------------------------------------------------+ +|modelUuid |String |The Model UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInvariantUuid |String |The Model Invariant UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInstanceName |String |The Model Instance name | ++-------------------------+------------------+-------------------------------------------------+ + +CloudConfiguration Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|tenantId |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ +|billingAccountNumber |String |billingAccountNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|callbackUrl |String |callbackUrl of the request | ++-------------------------+------------------+-------------------------------------------------+ +|correlator |String |correlator of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderNumber |String |orderNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|productFamilyId |String |productFamilyId of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderVersion |String |orderVersion of the request | ++-------------------------+------------------+-------------------------------------------------+ +|instanceName |String |instanceName of the request | ++-------------------------+------------------+-------------------------------------------------+ +|suppressRollback |String |suppressRollback of the request | ++-------------------------+------------------+-------------------------------------------------+ +|requestorId |String |requestorId of the request | ++-------------------------+------------------+-------------------------------------------------+ + +relatedInstance List + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|relatedInstance |Object |relatedInstance Object | ++-------------------------+------------------+-------------------------------------------------+ + +relatedInstance List + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|instanceId |String |instanceId | ++-------------------------+------------------+-------------------------------------------------+ +|modelInfo |Object |Content of modelInfo object. | ++-------------------------+------------------+-------------------------------------------------+ + +RequestParameters Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|UserParams |Array |The product family Id. | ++-------------------------+------------------+-------------------------------------------------+ + +UserParams Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|name |String |Tag name of attribute | ++-------------------------+------------------+-------------------------------------------------+ +|value |String |Value of the tag | ++-------------------------+------------------+-------------------------------------------------+ + +.. _delete_vnf: + +Delete VNF +++++++++++ + ++--------------------+-----------------------------------------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+=====================================================================================================+ +|URI |/onap/so/infra/serviceInstances/v6/{serviceInstanceId}/vnfs/{vnfInstanceId} | ++--------------------+-----------------------------------------------------------------------------------------------------+ +|Operation Type |DELETE | ++--------------------+-----------------------------------------------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+-----------------------------------------------------------------------------------------------------+ + +Request Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|requestDetails |M |1 |requestDetails Object |Content of requestDetails object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++---------------------+-------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=====================+=========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++---------------------+-------------------------+-------------------------------------------------+ +|cloudConfiguration |cloudConfiguration Object|Content of cloudConfiguration object. | ++---------------------+-------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++---------------------+-------------------------+-------------------------------------------------+ +|requestParameters |requestParameters Object |Content of requestParameters object. | ++---------------------+-------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ + +CloudConfiguration Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|lcpCloudRegionId |String |CloudRegion Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|tenantId |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ + +RequestParameters Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|UserParams |Array |The product family Id. | ++-------------------------+------------------+-------------------------------------------------+ + +UserParams Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|name |String |Tag name of attribute | ++-------------------------+------------------+-------------------------------------------------+ +|value |String |Value of the tag | ++-------------------------+------------------+-------------------------------------------------+ + +.. _get_orchestration_request_by_id: + +GET Orchestration Request ++++++++++++++++++++++++++ + ++--------------------+-------------------------------------------------------------------------------------+ +|Interface Definition|Description | ++====================+=====================================================================================+ +|URI |/onap/so/infra/orchestrationRequests/v6/{request-id} | ++--------------------+-------------------------------------------------------------------------------------+ +|Operation Type |GET | ++--------------------+-------------------------------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+-------------------------------------------------------------------------------------+ + +Response Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|request |M |1 |request Object |Content of request object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +Request Object + ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++===================+=========+===========+==========================+===========================================+ +|requestId |M |1 |String |Request Id | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|startTime |M |1 |request Object |Start time. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|requestScope |M |1 |request Object |Scope of the request. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|requestType |M |1 |request Object |Type of the request. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|requestDetails |M |1 |requestDetails Object |Type of the request. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|requestStatus |M |1 |requestStatus Object |Type of the request. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++-------------------+--------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++===================+==========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestParameters |requestParameters Object |Content of requestParameters object. | ++-------------------+--------------------------+-------------------------------------------------+ +|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | ++-------------------+--------------------------+-------------------------------------------------+ +|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | ++-------------------+--------------------------+-------------------------------------------------+ +|project |project Object |Content of project object. | ++-------------------+--------------------------+-------------------------------------------------+ +|owningEntity |owningEntity Object |Content of owningEntity object. | ++-------------------+--------------------------+-------------------------------------------------+ +|platform |platform Object |Content of platform object. | ++-------------------+--------------------------+-------------------------------------------------+ +|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | ++-------------------+--------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelInvariantId |String |The Model Invariant Id. | ++-------------------------+------------------+-------------------------------------------------+ +|ModelNameVersionId |String |The modelname Version Id | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelVersion |String |Version of the model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelCustomization Name |String |The Model Customization name | ++-------------------------+------------------+-------------------------------------------------+ +|modelCustomizationUuid |String |The Model Customization UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelVersionId |String |The Model version id | ++-------------------------+------------------+-------------------------------------------------+ +|modelUuid |String |The Model UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInvariantUuid |String |The Model Invariant UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInstanceName |String |The Model Instance name | ++-------------------------+------------------+-------------------------------------------------+ + +SubscriberInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|GlobalSubscriberId |String |Global customer Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|SubscriberName |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ +|billingAccountNumber |String |billingAccountNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|callbackUrl |String |callbackUrl of the request | ++-------------------------+------------------+-------------------------------------------------+ +|correlator |String |correlator of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderNumber |String |orderNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|productFamilyId |String |productFamilyId of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderVersion |String |orderVersion of the request | ++-------------------------+------------------+-------------------------------------------------+ +|instanceName |String |instanceName of the request | ++-------------------------+------------------+-------------------------------------------------+ +|suppressRollback |String |suppressRollback of the request | ++-------------------------+------------------+-------------------------------------------------+ +|requestorId |String |requestorId of the request | ++-------------------------+------------------+-------------------------------------------------+ + +RequestParameters Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|SubscriptionServiceType |String |The service type of the Subscription | ++-------------------------+------------------+-------------------------------------------------+ + +RequestStatus Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|finishTime |String |Time | ++-------------------------+------------------+-------------------------------------------------+ +|requestState |String |state of the request | ++-------------------------+------------------+-------------------------------------------------+ +|statusMessage |String |statusMessage | ++-------------------------+------------------+-------------------------------------------------+ +|percentProgress |String |percentage of progress | ++-------------------------+------------------+-------------------------------------------------+ + + +.. _get_orchestration_request_all: + +GET Orchestration Requests +++++++++++++++++++++++++++ + ++--------------------+--------------------------------------------------------------+ +|Interface Definition|Description | ++====================+==============================================================+ +|URI |/onap/so/infra/orchestrationRequests/v6 | ++--------------------+--------------------------------------------------------------+ +|Operation Type |GET | ++--------------------+--------------------------------------------------------------+ +|Content-Type |application/json | ++--------------------+--------------------------------------------------------------+ + +Response Body: + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|requestList |M |1 |Array |Content of request List. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestList : + ++----------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++================+=========+===========+==========================+===========================================+ +|request |M |1 |request Object |Content of request object. | ++----------------+---------+-----------+--------------------------+-------------------------------------------+ + +Request Object + ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|Attribute |Qualifier|Cardinality|Content |Description | ++===================+=========+===========+==========================+===========================================+ +|requestId |M |1 |String |Request Id. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|startTime |M |1 |request Object |Start time. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|requestScope |M |1 |request Object |Scope of the request. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|requestType |M |1 |request Object |Type of the request. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|requestDetails |M |1 |requestDetails Object |Type of the request. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ +|requestStatus |M |1 |requestStatus Object |Type of the request. | ++-------------------+---------+-----------+--------------------------+-------------------------------------------+ + +RequestDetails Object + ++-------------------+--------------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++===================+==========================+=================================================+ +|modelInfo |modelInfo Object |Content of modelInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|subscriberInfo |subscriberInfo Object |Content of subscriberInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestInfo |requestInfo Object |Content of requestInfo object. | ++-------------------+--------------------------+-------------------------------------------------+ +|requestParameters |requestParameters Object |Content of requestParameters object. | ++-------------------+--------------------------+-------------------------------------------------+ +|relatedInstanceList|relatedInstanceList Object|Content of relatedInstanceList object. | ++-------------------+--------------------------+-------------------------------------------------+ +|cloudConfiguration |cloudConfiguration Object |Content of cloudConfiguration object. | ++-------------------+--------------------------+-------------------------------------------------+ +|project |project Object |Content of project object. | ++-------------------+--------------------------+-------------------------------------------------+ +|owningEntity |owningEntity Object |Content of owningEntity object. | ++-------------------+--------------------------+-------------------------------------------------+ +|platform |platform Object |Content of platform object. | ++-------------------+--------------------------+-------------------------------------------------+ +|lineOfBusiness |lineOfBusiness Object |Content of lineOfBusiness object. | ++-------------------+--------------------------+-------------------------------------------------+ + +ModelInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|ModelType |String |Type of model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelInvariantId |String |The Model Invariant Id. | ++-------------------------+------------------+-------------------------------------------------+ +|ModelNameVersionId |String |The modelname Version Id | ++-------------------------+------------------+-------------------------------------------------+ +|ModelName |String |Name of the Model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelVersion |String |Version of the model | ++-------------------------+------------------+-------------------------------------------------+ +|ModelCustomization Name |String |The Model Customization name | ++-------------------------+------------------+-------------------------------------------------+ +|modelCustomizationUuid |String |The Model Customization UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelVersionId |String |The Model version id | ++-------------------------+------------------+-------------------------------------------------+ +|modelUuid |String |The Model UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInvariantUuid |String |The Model Invariant UUid | ++-------------------------+------------------+-------------------------------------------------+ +|modelInstanceName |String |The Model Instance name | ++-------------------------+------------------+-------------------------------------------------+ + +SubscriberInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|GlobalSubscriberId |String |Global customer Id (in A&AI) | ++-------------------------+------------------+-------------------------------------------------+ +|SubscriberName |String |Name of the Subscriber | ++-------------------------+------------------+-------------------------------------------------+ + +RequestInfo Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|Source |String |source of the request | ++-------------------------+------------------+-------------------------------------------------+ +|billingAccountNumber |String |billingAccountNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|callbackUrl |String |callbackUrl of the request | ++-------------------------+------------------+-------------------------------------------------+ +|correlator |String |correlator of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderNumber |String |orderNumber of the request | ++-------------------------+------------------+-------------------------------------------------+ +|productFamilyId |String |productFamilyId of the request | ++-------------------------+------------------+-------------------------------------------------+ +|orderVersion |String |orderVersion of the request | ++-------------------------+------------------+-------------------------------------------------+ +|instanceName |String |instanceName of the request | ++-------------------------+------------------+-------------------------------------------------+ +|suppressRollback |String |suppressRollback of the request | ++-------------------------+------------------+-------------------------------------------------+ +|requestorId |String |requestorId of the request | ++-------------------------+------------------+-------------------------------------------------+ + +RequestParameters Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|SubscriptionServiceType |String |The service type of the Subscription | ++-------------------------+------------------+-------------------------------------------------+ + +RequestStatus Object + ++-------------------------+------------------+-------------------------------------------------+ +|Attribute |Content |Description | ++=========================+==================+=================================================+ +|finishTime |String |Time | ++-------------------------+------------------+-------------------------------------------------+ +|requestState |String |state of the request | ++-------------------------+------------------+-------------------------------------------------+ +|statusMessage |String |statusMessage | ++-------------------------+------------------+-------------------------------------------------+ +|percentProgress |String |percentage of progress | ++-------------------------+------------------+-------------------------------------------------+ diff --git a/docs/api/offered_consumed_apis.rst b/docs/api/offered_consumed_apis.rst index 0caef0a426..1d0a8f005b 100644 --- a/docs/api/offered_consumed_apis.rst +++ b/docs/api/offered_consumed_apis.rst @@ -3,7 +3,7 @@ .. Copyright 2018 Huawei Technologies Co., Ltd. SO Offered and Consumed APIs -===================================== +============================ The list of APIs that SO offers can be found in following table: @@ -22,8 +22,9 @@ The list of APIs that SO offers can be found in following table: "swagger json file", "html doc", "yaml doc" ":download:`link <swagger/swagger.json>`", ":download:`link <swagger/swagger.html>`", ":download:`link <swagger/swagger.yaml>`" - -The list of APIs that SO offerers for monitroing the BPMN flows could be found in the following table: + +The list of APIs that SO offerers for monitoring the BPMN flows +could be found in the following table: .. csv-table:: :header: "|Swagger-icon|", "|yml-icon|" @@ -33,11 +34,13 @@ The list of APIs that SO offerers for monitroing the BPMN flows could be found i ":download:`link <swagger/SO_MONITORING_SWAGGER.json>`", ":download:`link <swagger/SO_MONITORING_SWAGGER.yaml>`" Further Reading ----------------------------------------- +--------------- Detailed documentation can be found here: .. toctree:: :maxdepth: 1 - apis/SO_Interface.rst
\ No newline at end of file + apis/serviceInstances-api.rst + apis/e2eServiceInstances-api.rst + apis/consumed-apis.rst diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/filters/RequestUriFilter.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/filters/RequestUriFilter.java deleted file mode 100644 index a3ff1ab95d..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandler/filters/RequestUriFilter.java +++ /dev/null @@ -1,61 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * 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.onap.so.apihandler.filters; - -import java.io.IOException; -import java.net.URI; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.container.ContainerRequestFilter; -import javax.ws.rs.container.PreMatching; -import javax.ws.rs.core.UriInfo; -import org.onap.so.apihandlerinfra.Constants; - - -@PreMatching -public class RequestUriFilter implements ContainerRequestFilter { - - private String requestURI; - - @Override - public void filter(ContainerRequestContext context) throws IOException { - UriInfo uriInfo = context.getUriInfo(); - URI baseURI = uriInfo.getBaseUri(); - requestURI = uriInfo.getPath(); - - if (requestURI.contains("onap/so/infra/serviceInstances")) { - requestURI = requestURI.replaceFirst("serviceInstances", "serviceInstantiation"); - if (!requestURI.contains(Constants.SERVICE_INSTANCE_PATH)) { - // Adds /serviceInstances after the version provided in the URI - requestURI = new StringBuilder(requestURI) - .insert(requestURI.indexOf(Constants.SERVICE_INSTANTIATION_PATH) + 24, - Constants.SERVICE_INSTANCE_PATH) - .toString(); - } - requestURI = baseURI + requestURI; - URI uri = URI.create(requestURI); - context.setRequestUri(uri); - } - } - - public String getRequestUri() { - return requestURI; - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java index 00d36b3ff9..e162a67680 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/JerseyConfiguration.java @@ -7,9 +7,9 @@ * 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. @@ -25,7 +25,6 @@ import javax.ws.rs.ApplicationPath; import org.glassfish.jersey.server.ResourceConfig; import org.glassfish.jersey.servlet.ServletProperties; import org.onap.so.apihandler.filters.RequestIdFilter; -import org.onap.so.apihandler.filters.RequestUriFilter; import org.onap.so.apihandlerinfra.exceptions.ApiExceptionMapper; import org.onap.so.apihandlerinfra.infra.rest.Network; import org.onap.so.apihandlerinfra.infra.rest.ServiceInstance; @@ -72,7 +71,6 @@ public class JerseyConfiguration extends ResourceConfig { register(SwaggerSerializers.class); register(ApiExceptionMapper.class); register(RuntimeExceptionMapper.class); - register(RequestUriFilter.class); register(RequestIdFilter.class); register(E2EServiceInstances.class); register(WorkflowSpecificationsHandler.class); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java index b1d38983ec..9b72bdc608 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/ServiceInstances.java @@ -444,7 +444,6 @@ public class ServiceInstances extends AbstractRestHandler { requestHandlerUtils.getRequestUri(requestContext, uriPrefix)); } - @DELETE @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}") @Consumes(MediaType.APPLICATION_JSON) @@ -593,7 +592,6 @@ public class ServiceInstances extends AbstractRestHandler { requestHandlerUtils.getRequestUri(requestContext, uriPrefix)); } - @POST @Path("/{version:[vV][5-7]}/serviceInstances/{serviceInstanceId}/vnfs/{vnfInstanceId}/volumeGroups") @Consumes(MediaType.APPLICATION_JSON) @@ -766,6 +764,27 @@ public class ServiceInstances extends AbstractRestHandler { requestHandlerUtils.getRequestUri(requestContext, uriPrefix)); } + /** + * This method is used for POST a request to the BPEL client (BPMN). + * + * Convert the requestJson to ServiceInstanceRequest(sir), create the msoRequest object, check whether this request + * is already being processed in requestdb for duplicate check. + * + * Based on the alacarte flag, sir and msoRequest will do the recipe lookup from the service and servicerecipe table + * of catalogdb, and get the OrchestrationURI. + * + * If the present request is not the duplicate request then this request will be saved in the requestdb. and will + * POST a request to the BPMN engine at the OrchestrationURI fetched. + * + * @param requestJSON Json fetched as body in the API call + * @param action Type of action to be performed + * @param instanceIdMap Map of instance ids of service/vnf/vf/configuration etc.. + * @param version Supported version of API + * @param requestId Unique id for the request + * @param requestUri + * @return response object + * @throws ApiException + */ public Response serviceInstances(String requestJSON, Actions action, HashMap<String, String> instanceIdMap, String version, String requestId, String requestUri) throws ApiException { return serviceInstances(requestJSON, action, instanceIdMap, version, requestId, requestUri, null); @@ -877,6 +896,7 @@ public class ServiceInstances extends AbstractRestHandler { try { infraActiveRequestsClient.save(currentActiveReq); } catch (Exception e) { + logger.error("Exception occurred", e); ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError) .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); @@ -890,6 +910,7 @@ public class ServiceInstances extends AbstractRestHandler { aLaCarte = false; } + RequestClientParameter requestClientParameter = null; try { requestClientParameter = new RequestClientParameter.Builder().setRequestId(requestId) @@ -902,6 +923,7 @@ public class ServiceInstances extends AbstractRestHandler { .setApiVersion(apiVersion).setALaCarte(aLaCarte).setRequestUri(requestUri) .setInstanceGroupId(instanceGroupId).build(); } catch (IOException e) { + logger.error("Exception occurred", e); ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_BPEL_RESPONSE_ERROR, ErrorCode.SchemaError) .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); @@ -927,6 +949,21 @@ public class ServiceInstances extends AbstractRestHandler { return action; } + /** + * This method deletes the Instance Groups. + * + * This method will check whether the request is not duplicate in requestdb. if its not then will save as a new + * request. And will send a POST request to BEPL client to delete the Insatnce Groups. + * + * @param action + * @param instanceIdMap + * @param version + * @param requestId + * @param requestUri + * @param requestContext + * @return + * @throws ApiException + */ public Response deleteInstanceGroups(Actions action, HashMap<String, String> instanceIdMap, String version, String requestId, String requestUri, ContainerRequestContext requestContext) throws ApiException { String instanceGroupId = instanceIdMap.get(CommonConstants.INSTANCE_GROUP_INSTANCE_ID); @@ -980,6 +1017,7 @@ public class ServiceInstances extends AbstractRestHandler { try { infraActiveRequestsClient.save(currentActiveReq); } catch (Exception e) { + logger.error("Exception occurred", e); ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError) .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); @@ -992,6 +1030,7 @@ public class ServiceInstances extends AbstractRestHandler { .setRequestAction(action.toString()).setApiVersion(apiVersion).setALaCarte(aLaCarte) .setRequestUri(requestUri).setInstanceGroupId(instanceGroupId).build(); + return requestHandlerUtils.postBPELRequest(currentActiveReq, requestClientParameter, recipeLookupResult.getOrchestrationURI(), requestScope); } @@ -1005,7 +1044,8 @@ public class ServiceInstances extends AbstractRestHandler { protected RecipeLookupResult getServiceInstanceOrchestrationURI(ServiceInstancesRequest sir, Actions action, boolean alaCarteFlag, InfraActiveRequests currentActiveReq) throws ApiException { RecipeLookupResult recipeLookupResult = null; - // if the aLaCarte flag is set to TRUE, the API-H should choose the VID_DEFAULT recipe for the requested action + // if the aLaCarte flag is set to TRUE, the API-H should choose the VID_DEFAULT + // recipe for the requested action ModelInfo modelInfo = sir.getRequestDetails().getModelInfo(); // Query MSO Catalog DB @@ -1021,7 +1061,6 @@ public class ServiceInstances extends AbstractRestHandler { new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError) .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); - ValidateException validateException = new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build(); @@ -1040,7 +1079,6 @@ public class ServiceInstances extends AbstractRestHandler { new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError) .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); - ValidateException validateException = new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build(); @@ -1058,7 +1096,6 @@ public class ServiceInstances extends AbstractRestHandler { new ErrorLoggerInfo.Builder(MessageEnum.APIH_REQUEST_VALIDATION_ERROR, ErrorCode.SchemaError) .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); - ValidateException validateException = new ValidateException.Builder(e.getMessage(), HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_BAD_PARAMETER).cause(e).errorInfo(errorLoggerInfo).build(); @@ -1075,7 +1112,6 @@ public class ServiceInstances extends AbstractRestHandler { new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ACCESS_EXC, ErrorCode.DataError) .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); - RecipeNotFoundException recipeNotFoundExceptionException = new RecipeNotFoundException.Builder("Recipe could not be retrieved from catalog DB.", HttpStatus.SC_NOT_FOUND, ErrorNumbers.SVC_GENERAL_SERVICE_ERROR).errorInfo(errorLoggerInfo) @@ -1125,7 +1161,8 @@ public class ServiceInstances extends AbstractRestHandler { } } - // if an aLaCarte flag was sent in the request, throw an error if the recipe was not found + // if an aLaCarte flag was sent in the request, throw an error if the recipe was + // not found RequestParameters reqParam = requestDetails.getRequestParameters(); if (reqParam != null && alaCarteFlag && recipe == null) { return null; @@ -1314,23 +1351,32 @@ public class ServiceInstances extends AbstractRestHandler { if (modelInfo.getModelType().equals(ModelType.vnf)) { // a. For a vnf request (only create, no update currently): - // i. (v3-v4) If modelInfo.modelCustomizationId is provided, use it to validate catalog DB has record in + // i. (v3-v4) If modelInfo.modelCustomizationId is provided, use it to validate + // catalog DB has record in // vnf_resource_customization.model_customization_uuid. - // ii. (v2-v4) If modelInfo.modelCustomizationId is NOT provided (because it is a pre-1702 ASDC model or + // ii. (v2-v4) If modelInfo.modelCustomizationId is NOT provided (because it is + // a pre-1702 ASDC model or // pre-v3), then modelInfo.modelCustomizationName must have // been provided (else create request should be rejected). APIH should use the - // relatedInstance.modelInfo[service].modelVersionId** + modelInfo[vnf].modelCustomizationName - // to “join�? service_to_resource_customizations with vnf_resource_customization to confirm a + // relatedInstance.modelInfo[service].modelVersionId** + + // modelInfo[vnf].modelCustomizationName + // to “join�? service_to_resource_customizations with + // vnf_resource_customization to confirm a // vnf_resource_customization.model_customization_uuid record exists. // **If relatedInstance.modelInfo[service].modelVersionId was not provided, use - // relatedInstance.modelInfo[service].modelInvariantId + modelVersion instead to lookup modelVersionId + // relatedInstance.modelInfo[service].modelInvariantId + modelVersion instead to + // lookup modelVersionId // (MODEL_UUID) in SERVICE table. - // iii. Regardless of how the value was provided/obtained above, APIH must always populate - // vnfModelCustomizationId in bpmnRequest. It would be assumed it was MSO generated + // iii. Regardless of how the value was provided/obtained above, APIH must + // always populate + // vnfModelCustomizationId in bpmnRequest. It would be assumed it was MSO + // generated // during 1707 data migration if VID did not provide it originally on request. - // iv. Note: continue to construct the “vnf-type�? value and pass to BPMN (must still be populated + // iv. Note: continue to construct the “vnf-type�? value and pass to BPMN + // (must still be populated // in A&AI). - // 1. If modelCustomizationName is NOT provided on a vnf/vfModule request, use modelCustomizationId to + // 1. If modelCustomizationName is NOT provided on a vnf/vfModule request, use + // modelCustomizationId to // look it up in our catalog to construct vnf-type value to pass to BPMN. VnfResource vnfResource = null; @@ -1461,14 +1507,13 @@ public class ServiceInstances extends AbstractRestHandler { throw new ValidationException("vfModuleCustomization"); } else if (vfModule == null && vfmc != null) { vfModule = vfmc.getVfModule(); // can't be null as vfModuleModelUUID is not-null property in - // VfModuleCustomization table + // VfModuleCustomization table } if (modelInfo.getModelVersionId() == null) { modelInfo.setModelVersionId(vfModule.getModelUUID()); } - recipe = catalogDbClient.getFirstVnfComponentsRecipeByVfModuleModelUUIDAndVnfComponentTypeAndAction( vfModule.getModelUUID(), vnfComponentType, action.toString()); if (recipe == null) { @@ -1531,7 +1576,6 @@ public class ServiceInstances extends AbstractRestHandler { return new RecipeLookupResult(vnfRecipe.getOrchestrationUri(), vnfRecipe.getRecipeTimeout()); } - private RecipeLookupResult getNetworkUri(ServiceInstancesRequest sir, Actions action) throws ValidationException { String defaultNetworkType = requestHandlerUtils.getDefaultModel(sir); @@ -1571,7 +1615,6 @@ public class ServiceInstances extends AbstractRestHandler { return recipe != null ? new RecipeLookupResult(recipe.getOrchestrationUri(), recipe.getRecipeTimeout()) : null; } - private Response configurationRecipeLookup(String requestJSON, Action action, HashMap<String, String> instanceIdMap, String version, String requestId, String requestUri) throws ApiException { String serviceInstanceId; @@ -1610,7 +1653,6 @@ public class ServiceInstances extends AbstractRestHandler { referencesResponse.setRequestId(requestId); serviceResponse.setRequestReferences(referencesResponse); - String orchestrationUri = env.getProperty(CommonConstants.ALACARTE_ORCHESTRATION); String timeOut = env.getProperty(CommonConstants.ALACARTE_RECIPE_TIMEOUT); @@ -1622,7 +1664,6 @@ public class ServiceInstances extends AbstractRestHandler { new ErrorLoggerInfo.Builder(MessageEnum.APIH_DB_ATTRIBUTE_NOT_FOUND, ErrorCode.DataError) .errorSource(Constants.MSO_PROP_APIHANDLER_INFRA).build(); - ValidateException validateException = new ValidateException.Builder(error, HttpStatus.SC_NOT_FOUND, ErrorNumbers.SVC_GENERAL_SERVICE_ERROR).errorInfo(errorLoggerInfo).build(); diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/AbstractRestHandler.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/AbstractRestHandler.java index e11732ddc4..20e27a5265 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/AbstractRestHandler.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/infra/rest/handler/AbstractRestHandler.java @@ -111,7 +111,7 @@ public abstract class AbstractRestHandler { String instanceName, String requestScope, InfraActiveRequests currentActiveReq) throws ApiException { InfraActiveRequests dup = null; try { - if (!(instanceName == null && requestScope.equals("service") && (action == Action.createInstance + if (!(instanceName == null && "service".equals(requestScope) && (action == Action.createInstance || action == Action.activateInstance || action == Action.assignInstance))) { dup = infraActiveRequestsClient.checkInstanceNameDuplicate(instanceIdMap, instanceName, requestScope); } @@ -175,7 +175,7 @@ public abstract class AbstractRestHandler { selfLinkUrl = Optional.of(new URL(aUrl.getProtocol(), aUrl.getHost(), aUrl.getPort(), selfLinkPath)); } catch (Exception e) { selfLinkUrl = Optional.empty(); // ignore - logger.error(e.getMessage()); + logger.error("Exception in buildSelfLinkUrl", e); } return selfLinkUrl; } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/TenantIsolationRequest.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/TenantIsolationRequest.java index efdc52b837..6449b0bb75 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/TenantIsolationRequest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/TenantIsolationRequest.java @@ -92,6 +92,7 @@ public class TenantIsolationRequest { requestJSON = mapper.writeValueAsString(request.getRequestDetails()); } catch (JsonProcessingException e) { + logger.error("Exception in JSON processing", e); throw new ValidationException("Parse ServiceInstanceRequest to JSON string", true); } @@ -325,6 +326,7 @@ public class TenantIsolationRequest { orchestrationFilterParams.put(queryParam, value); } } catch (Exception e) { + logger.error("Exception in getOrchestrationFilters", e); throw new ValidationException(e.getMessage(), true); } } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java index b5ba9281a6..18ca6d3086 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java @@ -50,12 +50,19 @@ public class SDCClientHelper { private static Logger logger = LoggerFactory.getLogger(SDCClientHelper.class); private static final String SDC_CONTENT_TYPE = "application/json"; private static final String SDC_ACCEPT_TYPE = "application/json"; - private static String PARTIAL_SDC_URI = "/sdc/v1/catalog/services/"; + private static final String PARTIAL_SDC_URI = "/sdc/v1/catalog/services/"; - private static String MESSAGE_UNDEFINED_ERROR = "Undefined Error Message!"; - private static String MESSAGE_UNEXPECTED_FORMAT = "Unexpected response format from SDC."; + private static final String MESSAGE_UNDEFINED_ERROR = "Undefined Error Message!"; + private static final String MESSAGE_UNEXPECTED_FORMAT = "Unexpected response format from SDC."; private final HttpClientFactory httpClientFactory = new HttpClientFactory(); + private static final String STATUS_CODE = "statusCode"; + private static final String MESSAGE = "message"; + private static final String MESSAGE_ID = "messageId"; + private static final String REQUEST_ERROR = "requestError"; + private static final String SERVICE_EXCEPTION = "serviceException"; + private static final String POLICY_EXCEPTION = "policyException"; + @Value("${mso.sdc.endpoint}") private String sdcEndpoint; @Value("${mso.sdc.activate.userid}") @@ -89,12 +96,11 @@ public class SDCClientHelper { ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError) .build(); - ValidateException validateException = new ValidateException.Builder( + + throw new ValidateException.Builder( " SDC credentials 'mso.sdc.client.auth' not setup in properties file!", HttpStatus.SC_BAD_REQUEST, ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).errorInfo(errorLoggerInfo) .build(); - - throw validateException; } URL url = new URL(urlString); @@ -114,12 +120,12 @@ public class SDCClientHelper { sdcResponseJsonObj = enhanceJsonResponse(new JSONObject(responseData), statusCode); } catch (Exception ex) { - logger.debug("calling SDC Exception message: {}", ex.getMessage()); + logger.debug("calling SDC Exception message:", ex); String errorMessage = " Encountered Error while calling SDC POST Activate. " + ex.getMessage(); logger.debug(errorMessage); - sdcResponseJsonObj.put("statusCode", String.valueOf(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())); - sdcResponseJsonObj.put("messageId", ""); - sdcResponseJsonObj.put("message", errorMessage); + sdcResponseJsonObj.put(STATUS_CODE, String.valueOf(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())); + sdcResponseJsonObj.put(MESSAGE_ID, ""); + sdcResponseJsonObj.put(MESSAGE, errorMessage); } return sdcResponseJsonObj; @@ -139,11 +145,9 @@ public class SDCClientHelper { ErrorLoggerInfo errorLoggerInfo = new ErrorLoggerInfo.Builder(MessageEnum.APIH_GENERAL_EXCEPTION, ErrorCode.BusinessProcesssError) .build(); - ValidateException validateException = - new ValidateException.Builder("Bad request could not post payload", HttpStatus.SC_BAD_REQUEST, - ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(ex).errorInfo(errorLoggerInfo).build(); - throw validateException; + throw new ValidateException.Builder("Bad request could not post payload", HttpStatus.SC_BAD_REQUEST, + ErrorNumbers.SVC_DETAILED_SERVICE_ERROR).cause(ex).errorInfo(errorLoggerInfo).build(); } } @@ -154,7 +158,7 @@ public class SDCClientHelper { * @param statusCode - int * @return enhancedAsdcResponseJsonObj - JSONObject object */ - public JSONObject enhanceJsonResponse(JSONObject sdcResponseJsonObj, int statusCode) throws JSONException { + public JSONObject enhanceJsonResponse(JSONObject sdcResponseJsonObj, int statusCode) { JSONObject enhancedAsdcResponseJsonObj = new JSONObject(); @@ -163,31 +167,31 @@ public class SDCClientHelper { if (statusCode == Response.Status.ACCEPTED.getStatusCode()) { // Accepted enhancedAsdcResponseJsonObj.put("distributionId", sdcResponseJsonObj.get("distributionId")); - enhancedAsdcResponseJsonObj.put("statusCode", Integer.toString(statusCode)); - enhancedAsdcResponseJsonObj.put("messageId", ""); - enhancedAsdcResponseJsonObj.put("message", "Success"); + enhancedAsdcResponseJsonObj.put(STATUS_CODE, Integer.toString(statusCode)); + enhancedAsdcResponseJsonObj.put(MESSAGE_ID, ""); + enhancedAsdcResponseJsonObj.put(MESSAGE, "Success"); } else { // error - if (sdcResponseJsonObj.has("requestError")) { - JSONObject requestErrorObj = sdcResponseJsonObj.getJSONObject("requestError"); - if (sdcResponseJsonObj.getJSONObject("requestError").has("serviceException")) { - message = requestErrorObj.getJSONObject("serviceException").getString("text"); - messageId = requestErrorObj.getJSONObject("serviceException").getString("messageId"); + if (sdcResponseJsonObj.has(REQUEST_ERROR)) { + JSONObject requestErrorObj = sdcResponseJsonObj.getJSONObject(REQUEST_ERROR); + if (sdcResponseJsonObj.getJSONObject(REQUEST_ERROR).has(SERVICE_EXCEPTION)) { + message = requestErrorObj.getJSONObject(SERVICE_EXCEPTION).getString("text"); + messageId = requestErrorObj.getJSONObject(SERVICE_EXCEPTION).getString(MESSAGE_ID); } - if (sdcResponseJsonObj.getJSONObject("requestError").has("policyException")) { - message = requestErrorObj.getJSONObject("policyException").getString("text"); - messageId = requestErrorObj.getJSONObject("policyException").getString("messageId"); + if (sdcResponseJsonObj.getJSONObject(REQUEST_ERROR).has(POLICY_EXCEPTION)) { + message = requestErrorObj.getJSONObject(POLICY_EXCEPTION).getString("text"); + messageId = requestErrorObj.getJSONObject(POLICY_EXCEPTION).getString(MESSAGE_ID); } - enhancedAsdcResponseJsonObj.put("statusCode", Integer.toString(statusCode)); - enhancedAsdcResponseJsonObj.put("messageId", messageId); - enhancedAsdcResponseJsonObj.put("message", message); + enhancedAsdcResponseJsonObj.put(STATUS_CODE, Integer.toString(statusCode)); + enhancedAsdcResponseJsonObj.put(MESSAGE_ID, messageId); + enhancedAsdcResponseJsonObj.put(MESSAGE, message); } else { // unexpected format - enhancedAsdcResponseJsonObj.put("statusCode", + enhancedAsdcResponseJsonObj.put(STATUS_CODE, String.valueOf(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())); - enhancedAsdcResponseJsonObj.put("messageId", MESSAGE_UNDEFINED_ERROR); - enhancedAsdcResponseJsonObj.put("message", MESSAGE_UNEXPECTED_FORMAT); + enhancedAsdcResponseJsonObj.put(MESSAGE_ID, MESSAGE_UNDEFINED_ERROR); + enhancedAsdcResponseJsonObj.put(MESSAGE, MESSAGE_UNEXPECTED_FORMAT); } } return enhancedAsdcResponseJsonObj; @@ -214,7 +218,7 @@ public class SDCClientHelper { * @return String json * @throws JSONException */ - public String buildJsonWorkloadContext(String workloadContext) throws JSONException { + public String buildJsonWorkloadContext(String workloadContext) { return new JSONObject().put("workloadContext", workloadContext).toString(); } diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java index 3005abaf9b..3226a0c313 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java @@ -61,16 +61,14 @@ public class ActivateVnfStatusOperationalEnvironment { private OperationalEnvServiceModelStatus queryServiceModelResponse = null; private boolean isOverallSuccess = false; - private final int RETRY_COUNT_ZERO = 0; - private final String ERROR_REASON_ABORTED = "ABORTED"; - private final String RECOVERY_ACTION_RETRY = "RETRY"; - private final String RECOVERY_ACTION_ABORT = "ABORT"; - private final String RECOVERY_ACTION_SKIP = "SKIP"; - private final String DISTRIBUTION_STATUS_OK = DistributionStatus.DISTRIBUTION_COMPLETE_OK.toString(); - private final String DISTRIBUTION_STATUS_ERROR = DistributionStatus.DISTRIBUTION_COMPLETE_ERROR.toString(); - private final String DISTRIBUTION_STATUS_SENT = "SENT"; - - private final String MESSAGE_UNDEFINED_ID = "Undefined Error Message!"; + private static final int RETRY_COUNT_ZERO = 0; + private static final String ERROR_REASON_ABORTED = "ABORTED"; + private static final String RECOVERY_ACTION_RETRY = "RETRY"; + private static final String RECOVERY_ACTION_ABORT = "ABORT"; + private static final String RECOVERY_ACTION_SKIP = "SKIP"; + private static final String DISTRIBUTION_STATUS_OK = DistributionStatus.DISTRIBUTION_COMPLETE_OK.toString(); + private static final String DISTRIBUTION_STATUS_ERROR = DistributionStatus.DISTRIBUTION_COMPLETE_ERROR.toString(); + private static final String DISTRIBUTION_STATUS_SENT = "SENT"; @Autowired private ActivateVnfDBHelper dbHelper; @@ -130,6 +128,7 @@ public class ActivateVnfStatusOperationalEnvironment { } } catch (Exception e) { + logger.error("Exception in execute", e); requestDb.updateInfraFailureCompletion(e.getMessage(), this.origRequestId, this.queryServiceModelResponse.getVnfOperationalEnvId()); } diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandler/filters/RequestUriFilterTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandler/filters/RequestUriFilterTest.java deleted file mode 100644 index 276b438529..0000000000 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandler/filters/RequestUriFilterTest.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP - SO - * ================================================================================ - * Copyright (C) 2017 - 2018 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.onap.so.apihandler.filters; - -import static org.junit.Assert.assertEquals; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; -import java.io.IOException; -import java.net.URI; -import javax.ws.rs.container.ContainerRequestContext; -import javax.ws.rs.core.UriInfo; -import org.junit.Test; -import org.onap.so.apihandlerinfra.BaseTest; - - - -public class RequestUriFilterTest extends BaseTest { - - @Test - public void filterTest() throws IOException { - RequestUriFilter URIFilter = new RequestUriFilter(); - URI baseURI = URI.create("http://localhost:58879/"); - String requestURI = "onap/so/infra/serviceInstances/v5"; - - ContainerRequestContext mockContext = mock(ContainerRequestContext.class); - UriInfo mockInfo = mock(UriInfo.class); - - when(mockContext.getUriInfo()).thenReturn(mockInfo); - when(mockInfo.getBaseUri()).thenReturn(baseURI); - when(mockInfo.getPath()).thenReturn(requestURI); - - - URIFilter.filter(mockContext); - assertEquals("http://localhost:58879/onap/so/infra/serviceInstantiation/v5/serviceInstances", - URIFilter.getRequestUri()); - } -} diff --git a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java index a79aeb2bd7..48a5343104 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java +++ b/mso-api-handlers/mso-api-handler-infra/src/test/java/org/onap/so/apihandlerinfra/ServiceInstancesTest.java @@ -7,9 +7,9 @@ * 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. @@ -285,14 +285,13 @@ public class ServiceInstancesTest extends BaseTest { requestReferences.setInstanceId("1882939"); requestReferences.setRequestSelfLink(createExpectedSelfLink("v5", "32807a28-1a14-4b88-b7b3-2950918aa76d")); expectedResponse.setRequestReferences(requestReferences); - uri = servInstanceUriPrev7 + "v5"; + uri = servInstanceuri + "v5"; ResponseEntity<String> response = sendRequest(inputStream("/ServiceInstancePrev7.json"), uri, HttpMethod.POST, headers); // then - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); + assertEquals(404, response.getStatusCode().value()); ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class); - assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId")); } @Test @@ -896,7 +895,7 @@ public class ServiceInstancesTest extends BaseTest { ResponseEntity<String> response = sendRequest(inputStream("/VnfWithServiceRelatedInstanceFail.json"), uri, HttpMethod.POST); - assertEquals(Response.Status.BAD_REQUEST.getStatusCode(), response.getStatusCode().value()); + assertEquals(404, response.getStatusCode().value()); } @Test @@ -2248,14 +2247,12 @@ public class ServiceInstancesTest extends BaseTest { requestReferences.setInstanceId("1882939"); requestReferences.setRequestSelfLink(createExpectedSelfLink("v5", "32807a28-1a14-4b88-b7b3-2950918aa76d")); expectedResponse.setRequestReferences(requestReferences); - uri = servInstanceUriPrev7 + "v5"; + uri = servInstanceuri + "v5"; ResponseEntity<String> response = sendRequest(inputStream("/MacroServiceInstance.json"), uri, HttpMethod.POST, headers); // then - assertEquals(Response.Status.ACCEPTED.getStatusCode(), response.getStatusCode().value()); - ServiceInstancesResponse realResponse = mapper.readValue(response.getBody(), ServiceInstancesResponse.class); - assertThat(realResponse, sameBeanAs(expectedResponse).ignoring("requestReferences.requestId")); + assertEquals(404, response.getStatusCode().value()); } @Test diff --git a/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml b/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml index 89482fdcda..e1de3317e7 100644 --- a/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml +++ b/packages/docker/src/main/docker/docker-files/configs/logging/logback-spring.xml @@ -1,12 +1,12 @@ -<!-- ============LICENSE_START======================================================= - ECOMP MSO ================================================================================ - 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 +<!-- ============LICENSE_START======================================================= + ECOMP MSO ================================================================================ + 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========================================================= --> <configuration scan="true" debug="false"> @@ -23,11 +23,11 @@ <property name="metricsLogName" value="metrics" /> <property name="auditLogName" value="audit" /> <property name="debugLogName" value="debug" /> - + <property name="currentTimeStamp" value="%d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX",UTC}"/> <property name="errorPattern" - value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode}|%X{ErrorDesc}|%msg%n" /> + value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}|%thread|%X{ServiceName}|%X{PartnerName}|%X{TargetEntity}|%X{TargetServiceName}|%.-5level|%X{ErrorCode:-500}|%X{ErrorDesc}|%msg%n" /> <property name="debugPattern" value="%d{yyyy-MM-dd'T'HH:mm:ss.SSSXXX}|%X{RequestID}| %logger{50} - %msg%n" /> @@ -52,7 +52,7 @@ <appender name="Audit" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> - <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator"> + <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator"> <marker>EXIT</marker> </evaluator> <onMismatch>DENY</onMismatch> @@ -80,7 +80,7 @@ <appender name="Metric" class="ch.qos.logback.core.rolling.RollingFileAppender"> <filter class="ch.qos.logback.core.filter.EvaluatorFilter"> - <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator"> + <evaluator class="ch.qos.logback.classic.boolex.OnMarkerEvaluator"> <marker>INVOKE_RETURN</marker> </evaluator> <onMismatch>DENY</onMismatch> |