use of org.onap.sdc.toscaparser.api.elements.Metadata in project so by onap.
the class ToscaResourceInstaller method createVFCInstanceGroupMembers.
private void createVFCInstanceGroupMembers(VnfcInstanceGroupCustomization vfcInstanceGroupCustom, IEntityDetails vfcModuleEntity, List<Input> inputList, Set<VnfcCustomization> existingVnfcGroupSet) {
List<IEntityDetails> members = vfcModuleEntity.getMemberNodes();
if (!CollectionUtils.isEmpty(members)) {
for (IEntityDetails vfcEntity : members) {
VnfcCustomization existingVfcGroup = findExistingVfc(existingVnfcGroupSet, vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
if (existingVfcGroup == null) {
VnfcCustomization vnfcCustomization = new VnfcCustomization();
Metadata metadata = vfcEntity.getMetadata();
vnfcCustomization.setModelCustomizationUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
vnfcCustomization.setModelInstanceName(vfcEntity.getName());
vnfcCustomization.setModelUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
vnfcCustomization.setModelInvariantUUID(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
vnfcCustomization.setModelVersion(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
vnfcCustomization.setModelName(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
vnfcCustomization.setToscaNodeType(testNull(vfcEntity.getToscaType()));
vnfcCustomization.setDescription(testNull(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
vnfcCustomization.setResourceInput(getVnfcResourceInput(vfcEntity, inputList));
vnfcCustomization.setVnfcInstanceGroupCustomization(vfcInstanceGroupCustom);
List<VnfcCustomization> vnfcCustomizations = vfcInstanceGroupCustom.getVnfcCustomizations();
if (vnfcCustomizations == null) {
vnfcCustomizations = new ArrayList<>();
vfcInstanceGroupCustom.setVnfcCustomizations(vnfcCustomizations);
}
vnfcCustomizations.add(vnfcCustomization);
existingVnfcGroupSet.add(vnfcCustomization);
}
}
}
}
use of org.onap.sdc.toscaparser.api.elements.Metadata in project so by onap.
the class ToscaResourceInstaller method installTheVfResource.
@Transactional(rollbackFor = { ArtifactInstallerException.class })
public void installTheVfResource(ToscaResourceStructure toscaResourceStruct, VfResourceStructure vfResourceStruct) throws ArtifactInstallerException {
VfResourceStructure vfResourceStructure = vfResourceStruct;
extractHeatInformation(toscaResourceStruct, vfResourceStructure);
// PCLO: in case of deployment failure, use a string that will represent
// the type of artifact that failed...
List<ASDCElementInfo> artifactListForLogging = new ArrayList<>();
try {
createToscaCsar(toscaResourceStruct);
createService(toscaResourceStruct, vfResourceStruct);
Service service = toscaResourceStruct.getCatalogService();
createServiceInfo(toscaResourceStruct, service);
List<IEntityDetails> vfEntityList = getEntityDetails(toscaResourceStruct, EntityQuery.newBuilder(SdcTypes.VF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
List<IEntityDetails> arEntityDetails = new ArrayList<IEntityDetails>();
for (IEntityDetails vfEntityDetails : vfEntityList) {
Metadata metadata = vfEntityDetails.getMetadata();
String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
if (ALLOTTED_RESOURCE.equalsIgnoreCase(category)) {
arEntityDetails.add(vfEntityDetails);
}
processVfModules(vfEntityDetails, toscaResourceStruct, vfResourceStructure, service, metadata);
}
processResourceSequence(toscaResourceStruct, service);
processAllottedResources(arEntityDetails, toscaResourceStruct, service);
processNetworks(toscaResourceStruct, service);
// process Network Collections
processNetworkCollections(toscaResourceStruct, service);
// Process Service Proxy & Configuration
processServiceProxyAndConfiguration(toscaResourceStruct, service);
logger.info("Saving Service: {} ", service.getModelName());
service = serviceRepo.save(service);
correlateConfigCustomResources(service);
workflowResource.processWorkflows(vfResourceStructure);
WatchdogComponentDistributionStatus status = new WatchdogComponentDistributionStatus(vfResourceStruct.getNotification().getDistributionID(), MSO);
status.setComponentDistributionStatus(DistributionStatusEnum.COMPONENT_DONE_OK.name());
watchdogCDStatusRepository.save(status);
toscaResourceStruct.setSuccessfulDeployment();
} catch (Exception e) {
logger.debug("Exception :", e);
WatchdogComponentDistributionStatus status = new WatchdogComponentDistributionStatus(vfResourceStruct.getNotification().getDistributionID(), MSO);
status.setComponentDistributionStatus(DistributionStatusEnum.COMPONENT_DONE_ERROR.name());
watchdogCDStatusRepository.save(status);
Throwable dbExceptionToCapture = e;
while (!(dbExceptionToCapture instanceof ConstraintViolationException || dbExceptionToCapture instanceof LockAcquisitionException) && (dbExceptionToCapture.getCause() != null)) {
dbExceptionToCapture = dbExceptionToCapture.getCause();
}
if (dbExceptionToCapture instanceof ConstraintViolationException || dbExceptionToCapture instanceof LockAcquisitionException) {
logger.warn(LoggingAnchor.FIVE, MessageEnum.ASDC_ARTIFACT_ALREADY_DEPLOYED.toString(), vfResourceStructure.getResourceInstance().getResourceName(), vfResourceStructure.getNotification().getServiceVersion(), ErrorCode.DataError.getValue(), "Exception - ASCDC Artifact already deployed", e);
} else {
String elementToLog = (!artifactListForLogging.isEmpty() ? artifactListForLogging.get(artifactListForLogging.size() - 1).toString() : "No element listed");
logger.error(LoggingAnchor.FOUR, MessageEnum.ASDC_ARTIFACT_INSTALL_EXC.toString(), elementToLog, ErrorCode.DataError.getValue(), "Exception caught during installation of " + vfResourceStructure.getResourceInstance().getResourceName() + ". Transaction rollback", e);
throw new ArtifactInstallerException("Exception caught during installation of " + vfResourceStructure.getResourceInstance().getResourceName() + ". Transaction rollback.", e);
}
}
}
use of org.onap.sdc.toscaparser.api.elements.Metadata in project so by onap.
the class ToscaResourceInstaller method createService.
protected Service createService(ToscaResourceStructure toscaResourceStructure, ResourceStructure resourceStructure) {
Metadata serviceMetadata = toscaResourceStructure.getServiceMetadata();
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) {
if (toscaResourceStructure.getServiceVersion() != null) {
service.setModelVersion(toscaResourceStructure.getServiceVersion());
}
service.setServiceType(serviceMetadata.getValue("serviceType"));
service.setServiceRole(serviceMetadata.getValue("serviceRole"));
service.setServiceFunction(serviceMetadata.getValue("serviceFunction"));
service.setCategory(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));
service.setDescription(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
service.setModelName(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
service.setModelUUID(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
service.setEnvironmentContext(serviceMetadata.getValue("environmentContext"));
if (resourceStructure != null)
service.setWorkloadContext(resourceStructure.getNotification().getWorkloadContext());
service.setModelInvariantUUID(serviceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
service.setCsar(toscaResourceStructure.getCatalogToscaCsar());
service.setNamingPolicy(serviceMetadata.getValue("namingPolicy"));
String generateNaming = serviceMetadata.getValue("ecompGeneratedNaming");
Boolean generateNamingValue = null;
if (generateNaming != null) {
generateNamingValue = "true".equalsIgnoreCase(generateNaming);
}
service.setOnapGeneratedNaming(generateNamingValue);
List<Input> serviceInputs = toscaResourceStructure.getSdcCsarHelper().getServiceInputs();
logger.debug("serviceInputs: {} " + serviceInputs);
if (!serviceInputs.isEmpty()) {
serviceInputs.forEach(input -> {
if (CDS_MODEL_NAME.equalsIgnoreCase(input.getName())) {
String value = input.getDefault() != null ? input.getDefault().toString() : null;
service.setBlueprintName(value);
}
if (CDS_MODEL_VERSION.equalsIgnoreCase(input.getName())) {
String value = input.getDefault() != null ? input.getDefault().toString() : null;
service.setBlueprintVersion(value);
}
if (CONTROLLER_ACTOR.equalsIgnoreCase(input.getName())) {
String value = input.getDefault() != null ? input.getDefault().toString() : null;
service.setControllerActor(value);
}
if (SKIP_POST_INST_CONF.equalsIgnoreCase(input.getName())) {
String value = input.getDefault() != null ? input.getDefault().toString() : "false";
service.setSkipPostInstConf(Boolean.valueOf(value));
}
});
}
}
toscaResourceStructure.setCatalogService(service);
return service;
}
use of org.onap.sdc.toscaparser.api.elements.Metadata in project so by onap.
the class ToscaResourceInstaller method createVNFCInstanceGroup.
protected VnfcInstanceGroupCustomization createVNFCInstanceGroup(IEntityDetails vfcInstanceEntity, IEntityDetails vfEntityDetails, VnfResourceCustomization vnfResourceCustomization, ToscaResourceStructure toscaResourceStructure, Set<VnfcCustomization> existingVnfcGroupSet) {
Metadata instanceMetadata = vfcInstanceEntity.getMetadata();
InstanceGroup existingInstanceGroup = instanceGroupRepo.findByModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
VFCInstanceGroup vfcInstanceGroup;
if (existingInstanceGroup == null) {
// Populate InstanceGroup
vfcInstanceGroup = new VFCInstanceGroup();
vfcInstanceGroup.setModelName(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
vfcInstanceGroup.setModelInvariantUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
vfcInstanceGroup.setModelUUID(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
vfcInstanceGroup.setModelVersion(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
vfcInstanceGroup.setToscaNodeType(vfcInstanceEntity.getToscaType());
// Set Role
vfcInstanceGroup.setRole("SUB-INTERFACE");
// Set type
vfcInstanceGroup.setType(InstanceGroupType.VNFC);
} else {
vfcInstanceGroup = (VFCInstanceGroup) existingInstanceGroup;
}
// Populate VNFCInstanceGroupCustomization
VnfcInstanceGroupCustomization vfcInstanceGroupCustom = new VnfcInstanceGroupCustomization();
vfcInstanceGroupCustom.setVnfResourceCust(vnfResourceCustomization);
vnfResourceCustomization.getVnfcInstanceGroupCustomizations().add(vfcInstanceGroupCustom);
vfcInstanceGroupCustom.setInstanceGroup(vfcInstanceGroup);
vfcInstanceGroup.getVnfcInstanceGroupCustomizations().add(vfcInstanceGroupCustom);
vfcInstanceGroupCustom.setDescription(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
String getInputName = null;
Map<String, Property> groupProperties = vfcInstanceEntity.getProperties();
for (String key : groupProperties.keySet()) {
Property property = groupProperties.get(key);
String vfcName = property.getName();
if (vfcName != null) {
if (vfcName.equals("vfc_instance_group_function")) {
String vfcValue = property.getValue().toString();
int getInputIndex = vfcValue.indexOf("{get_input=");
if (getInputIndex > -1) {
getInputName = vfcValue.substring(getInputIndex + 11, vfcValue.length() - 1);
}
}
}
}
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));
}
vfcInstanceGroupCustom.setInstanceGroup(vfcInstanceGroup);
List<Input> inputs = vfEntityDetails.getInputs();
createVFCInstanceGroupMembers(vfcInstanceGroupCustom, vfcInstanceEntity, inputs, existingVnfcGroupSet);
return vfcInstanceGroupCustom;
}
use of org.onap.sdc.toscaparser.api.elements.Metadata in project so by onap.
the class ASDCNotificationLogging method dumpCSARNotification.
public static String dumpCSARNotification(INotificationData asdcNotification, ToscaResourceStructure toscaResourceStructure) {
if (asdcNotification == null) {
return "NULL";
}
ToscaResourceInstaller toscaResourceInstaller = new ToscaResourceInstaller();
StringBuilder buffer = new StringBuilder("CSAR Notification:");
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
ISdcCsarHelper csarHelper = toscaResourceStructure.getSdcCsarHelper();
buffer.append("Service Level Properties:");
buffer.append(System.lineSeparator());
buffer.append("Name:");
buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("Model Version:");
buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("Model InvariantUuid:");
buffer.append(testNull(csarHelper.getServiceMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("Service Type:");
buffer.append(csarHelper.getServiceMetadata().getValue("serviceType"));
buffer.append(System.lineSeparator());
buffer.append("Service Role:");
buffer.append(csarHelper.getServiceMetadata().getValue("serviceRole"));
buffer.append(System.lineSeparator());
buffer.append("WorkLoad Context:");
buffer.append(asdcNotification.getWorkloadContext());
buffer.append(System.lineSeparator());
buffer.append("Environment Context:");
buffer.append(csarHelper.getServiceMetadata().getValue("environmentContext"));
buffer.append(System.lineSeparator());
List<IEntityDetails> serviceProxyResourceList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.SERVICE_PROXY), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), true);
if (serviceProxyResourceList != null) {
for (IEntityDetails serviceProxyEntity : serviceProxyResourceList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Service Proxy Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Version:");
buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Service Proxy Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Model Instance Name:");
buffer.append(serviceProxyEntity.getName());
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
buffer.append(serviceProxyEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append("Version:");
buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(serviceProxyEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
}
}
List<IEntityDetails> configurationList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.CONFIGURATION), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), true);
if (configurationList != null) {
for (IEntityDetails configEntity : configurationList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Configuration Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Version:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
buffer.append(configEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Configuration Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Model Instance Name:");
buffer.append(configEntity.getName());
buffer.append(System.lineSeparator());
buffer.append("NFFunction:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
buffer.append(System.lineSeparator());
buffer.append("NFRole:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity, SdcPropertyNames.PROPERTY_NAME_NFROLE));
buffer.append(System.lineSeparator());
buffer.append("NFType:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
buffer.append(System.lineSeparator());
}
}
List<IEntityDetails> vfEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.VF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
for (IEntityDetails vfEntity : vfEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("VNF Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
buffer.append("Version:");
buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("Type:");
buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)));
buffer.append(System.lineSeparator());
buffer.append("Category:");
buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY)));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("Max Instances:");
buffer.append(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES));
buffer.append(System.lineSeparator());
buffer.append("Min Instances:");
buffer.append(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES));
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("VNF Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("Customization UUID:");
buffer.append(testNull(vfEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
buffer.append("NFFunction:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(vfEntity, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
buffer.append(System.lineSeparator());
buffer.append("NFCode:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(vfEntity, "nf_naming_code"));
buffer.append(System.lineSeparator());
buffer.append("NFRole:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(vfEntity, SdcPropertyNames.PROPERTY_NAME_NFROLE));
buffer.append(System.lineSeparator());
buffer.append("NFType:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(vfEntity, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
buffer.append(System.lineSeparator());
buffer.append("MultiStageDesign:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(vfEntity, "multi_stage_design"));
buffer.append(System.lineSeparator());
List<IEntityDetails> vfcInstanceEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder("org.openecomp.groups.VfcInstanceGroup"), TopologyTemplateQuery.newBuilder(SdcTypes.VF).customizationUUID(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID), false);
if (vfcInstanceEntityList != null) {
for (IEntityDetails vfcEntity : vfcInstanceEntityList) {
Metadata instanceMetadata = vfcEntity.getMetadata();
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("VNFC Instance Group Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Version:");
buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("Type:");
buffer.append(vfcEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
}
}
List<IEntityDetails> vfModuleEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder("org.openecomp.groups.VfModule"), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE).customizationUUID(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID), false);
for (IEntityDetails vfModuleEntity : vfModuleEntityList) {
Metadata vfMetadata = vfModuleEntity.getMetadata();
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("VF Module Properties:");
buffer.append(System.lineSeparator());
buffer.append("ModelInvariantUuid:");
buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELINVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelName:");
buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELNAME)));
buffer.append(System.lineSeparator());
buffer.append("ModelUuid:");
buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelVersion:");
buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELVERSION)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(testNull(vfMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
List<IEntityDetails> groupMembers = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder("org.openecomp.groups.VfModule").uUID(SdcPropertyNames.PROPERTY_NAME_VFMODULEMODELUUID), TopologyTemplateQuery.newBuilder(SdcTypes.VF), false);
for (IEntityDetails node : groupMembers) {
buffer.append("Member Name:");
buffer.append(testNull(node.getName()));
buffer.append(System.lineSeparator());
}
buffer.append(System.lineSeparator());
buffer.append("VF Module Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
buffer.append(testNull(toscaResourceInstaller.getLeafPropertyValue(vfModuleEntity, SdcPropertyNames.PROPERTY_NAME_VFMODULECUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
}
List<IEntityDetails> fabricEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.CONFIGURATION), TopologyTemplateQuery.newBuilder(SdcTypes.VF), false);
if (fabricEntityList != null) {
for (IEntityDetails configEntity : fabricEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Fabric Configuration Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Version:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
buffer.append(configEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Fabric Configuration Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
buffer.append(configEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Model Instance Name:");
buffer.append(configEntity.getName());
buffer.append(System.lineSeparator());
buffer.append("NFFunction:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
buffer.append(System.lineSeparator());
buffer.append("NFRole:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity, SdcPropertyNames.PROPERTY_NAME_NFROLE));
buffer.append(System.lineSeparator());
buffer.append("NFType:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(configEntity, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
buffer.append(System.lineSeparator());
}
}
List<IEntityDetails> cvnfcEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.CVFC), TopologyTemplateQuery.newBuilder(SdcTypes.VF), false);
for (IEntityDetails cvnfcEntity : cvnfcEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("CVNFC Properties:");
buffer.append(System.lineSeparator());
buffer.append("ModelCustomizationUuid:");
buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelInvariantUuid:");
buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelName:");
buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("ModelUuid:");
buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelVersion:");
buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(testNull(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
buffer.append("Template Name:");
buffer.append(testNull(cvnfcEntity.getName()));
buffer.append(System.lineSeparator());
List<IEntityDetails> vfcEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.VFC), TopologyTemplateQuery.newBuilder(SdcTypes.CVFC).customizationUUID(cvnfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)), false);
for (IEntityDetails vfcEntity : vfcEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("VNFC Properties:");
buffer.append(System.lineSeparator());
buffer.append("ModelCustomizationUuid:");
buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelInvariantUuid:");
buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelName:");
buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("ModelUuid:");
buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("ModelVersion:");
buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
buffer.append("Sub Category:");
buffer.append(testNull(vfcEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY)));
buffer.append(System.lineSeparator());
}
}
}
List<IEntityDetails> vlEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.VL), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
if (vlEntityList != null) {
for (IEntityDetails vlEntity : vlEntityList) {
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("NETWORK Level Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("Model InvariantUuid:");
buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("Model Version:");
buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("AIC Max Version:");
buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES)));
buffer.append(System.lineSeparator());
buffer.append("AIC Min Version:");
buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_MININSTANCES)));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(testNull(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION)));
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("NETWORK Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("CustomizationUUID:");
buffer.append(vlEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Network Technology:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(vlEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY));
buffer.append(System.lineSeparator());
buffer.append("Network Type:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(vlEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE));
buffer.append(System.lineSeparator());
buffer.append("Network Role:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(vlEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE));
buffer.append(System.lineSeparator());
buffer.append("Network Scope:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(vlEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE));
buffer.append(System.lineSeparator());
}
}
List<IEntityDetails> crEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.CR), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
if (crEntityList != null) {
for (IEntityDetails crEntity : crEntityList) {
buffer.append(System.lineSeparator());
buffer.append("Network Collection Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
buffer.append(System.lineSeparator());
buffer.append("Customization UUID:");
buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Version:");
buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
buffer.append(crEntity.getToscaType());
buffer.append(System.lineSeparator());
buffer.append("CR Function:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, "cr_function"));
buffer.append(System.lineSeparator());
buffer.append("CR Role:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, "cr_role"));
buffer.append(System.lineSeparator());
buffer.append("CR Type:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, "cr_type"));
buffer.append(System.lineSeparator());
List<IEntityDetails> networkEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.VL), TopologyTemplateQuery.newBuilder(SdcTypes.CR).customizationUUID(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)), false);
for (IEntityDetails vlEntity : networkEntityList) {
Metadata vlMetadata = vlEntity.getMetadata();
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Network CR VL Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append("Version:");
buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
buffer.append("AIC Max Version:");
buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_MAXINSTANCES));
buffer.append(System.lineSeparator());
buffer.append("Description:");
buffer.append(vlMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append("Tosca Node Type:");
buffer.append(vlEntity.getToscaType());
buffer.append(System.lineSeparator());
}
List<IEntityDetails> ncEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder("org.openecomp.groups.NetworkCollection"), TopologyTemplateQuery.newBuilder(SdcTypes.CR).customizationUUID(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)), false);
if (ncEntityList != null) {
for (IEntityDetails ncEntity : ncEntityList) {
Metadata instanceMetadata = ncEntity.getMetadata();
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Network Instance Group Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_NAME));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_UUID));
buffer.append(System.lineSeparator());
buffer.append("InvariantUuid:");
buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID));
buffer.append(System.lineSeparator());
buffer.append("Version:");
buffer.append(instanceMetadata.getValue(SdcPropertyNames.PROPERTY_NAME_VERSION));
buffer.append(System.lineSeparator());
}
}
buffer.append(System.lineSeparator());
buffer.append("Network Collection Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Customization UUID:");
buffer.append(crEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID));
buffer.append(System.lineSeparator());
buffer.append("Model Instance Name:");
buffer.append(crEntity.getName());
buffer.append(System.lineSeparator());
buffer.append("Network Scope:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKSCOPE));
buffer.append(System.lineSeparator());
buffer.append("Network Role:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKROLE));
buffer.append(System.lineSeparator());
buffer.append("Network Type:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTYPE));
buffer.append(System.lineSeparator());
buffer.append("Network Technology:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(crEntity, SdcPropertyNames.PROPERTY_NAME_NETWORKTECHNOLOGY));
buffer.append(System.lineSeparator());
}
}
List<IEntityDetails> arEntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.VF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
if (arEntityList != null) {
buffer.append(System.lineSeparator());
buffer.append("VF Allotted Resource Properties:");
buffer.append(System.lineSeparator());
for (IEntityDetails arEntity : arEntityList) {
Metadata metadata = arEntity.getMetadata();
String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
if ("Allotted Resource".equalsIgnoreCase(category)) {
buffer.append(System.lineSeparator());
buffer.append("Allotted Resource Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("Model InvariantUuid:");
buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("Model Version:");
buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("Model Subcategory:");
buffer.append(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));
buffer.append(System.lineSeparator());
buffer.append("Model Category:");
buffer.append(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));
buffer.append(System.lineSeparator());
buffer.append("Model Description:");
buffer.append(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Allotted Resource Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Cutomization UUID:");
buffer.append(testNull(arEntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
buffer.append("NFFunction:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(arEntity, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
buffer.append(System.lineSeparator());
buffer.append("NFCode:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(arEntity, "nf_naming_code"));
buffer.append(System.lineSeparator());
buffer.append("NFRole:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(arEntity, SdcPropertyNames.PROPERTY_NAME_NFROLE));
buffer.append(System.lineSeparator());
buffer.append("NFType:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(arEntity, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
buffer.append(System.lineSeparator());
}
}
}
List<IEntityDetails> pnfAREntityList = toscaResourceInstaller.getEntityDetails(toscaResourceStructure, EntityQuery.newBuilder(SdcTypes.PNF), TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE), false);
if (pnfAREntityList != null) {
buffer.append(System.lineSeparator());
buffer.append("PNF Allotted Resource Properties:");
buffer.append(System.lineSeparator());
for (IEntityDetails pnfAREntity : pnfAREntityList) {
Metadata metadata = pnfAREntity.getMetadata();
String category = metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY);
if ("Allotted Resource".equalsIgnoreCase(category)) {
buffer.append(System.lineSeparator());
buffer.append("Allotted Resource Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("Model Name:");
buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_NAME)));
buffer.append(System.lineSeparator());
buffer.append("Model InvariantUuid:");
buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_INVARIANTUUID)));
buffer.append(System.lineSeparator());
buffer.append("Model Version:");
buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_VERSION)));
buffer.append(System.lineSeparator());
buffer.append("Model UUID:");
buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_UUID)));
buffer.append(System.lineSeparator());
buffer.append("Model Subcategory:");
buffer.append(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_SUBCATEGORY));
buffer.append(System.lineSeparator());
buffer.append("Model Category:");
buffer.append(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CATEGORY));
buffer.append(System.lineSeparator());
buffer.append("Model Description:");
buffer.append(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_DESCRIPTION));
buffer.append(System.lineSeparator());
buffer.append(System.lineSeparator());
buffer.append("Allotted Resource Customization Properties:");
buffer.append(System.lineSeparator());
buffer.append("Model Cutomization UUID:");
buffer.append(testNull(pnfAREntity.getMetadata().getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)));
buffer.append(System.lineSeparator());
buffer.append("NFFunction:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(pnfAREntity, SdcPropertyNames.PROPERTY_NAME_NFFUNCTION));
buffer.append(System.lineSeparator());
buffer.append("NFCode:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(pnfAREntity, "nf_naming_code"));
buffer.append(System.lineSeparator());
buffer.append("NFRole:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(pnfAREntity, SdcPropertyNames.PROPERTY_NAME_NFROLE));
buffer.append(System.lineSeparator());
buffer.append("NFType:");
buffer.append(toscaResourceInstaller.getLeafPropertyValue(pnfAREntity, SdcPropertyNames.PROPERTY_NAME_NFTYPE));
buffer.append(System.lineSeparator());
}
}
}
return buffer.toString();
}
Aggregations