use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf in project so by onap.
the class ServiceEBBLoader method traverseServiceInstanceMSOPnfs.
private void traverseServiceInstanceMSOPnfs(List<Resource> resourceList, Resource serviceResource, List<Pair<WorkflowType, String>> aaiResourceIds, org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance serviceInstanceMSO) {
if (serviceInstanceMSO.getPnfs() == null) {
return;
}
for (org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf pnf : serviceInstanceMSO.getPnfs()) {
aaiResourceIds.add(new Pair<>(WorkflowType.PNF, pnf.getPnfId()));
Resource resource = new Resource(WorkflowType.PNF, pnf.getPnfId(), false, serviceResource);
ModelInfoPnf modelInfo = pnf.getModelInfoPnf();
if (modelInfo != null) {
resource.setModelVersionId(modelInfo.getModelUuid());
resource.setModelCustomizationId(modelInfo.getModelCustomizationUuid());
}
resourceList.add(resource);
}
}
use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf in project so by onap.
the class AAIPnfResourcesTest method getModelInfoPnf.
private ModelInfoPnf getModelInfoPnf() {
ModelInfoPnf modelInfoPnf = new ModelInfoPnf();
modelInfoPnf.setModelCustomizationUuid(TEST_CUSTOMIZATION_UUID);
modelInfoPnf.setModelInvariantUuid(TEST_INVARIANT_UUID);
modelInfoPnf.setModelUuid(TEST_VERSION);
return modelInfoPnf;
}
use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf in project so by onap.
the class GenericPnfCDSControllerRunnableBBTest method prepareData.
private void prepareData() throws BBObjectNotFoundException, PayloadGenerationException {
Pnf pnf = new Pnf();
ServiceInstance serviceInstance = new ServiceInstance();
pnf.setPnfName(pnfName);
pnf.setPnfId(pnfID);
ModelInfoPnf modelInfoPnf = new ModelInfoPnf();
modelInfoPnf.setModelCustomizationUuid(pnfCustomizationUUID);
pnf.setModelInfoPnf(modelInfoPnf);
serviceInstance.setServiceInstanceId(serviceInstanceID);
ModelInfoServiceInstance modelInfoServiceInstance = new ModelInfoServiceInstance();
modelInfoServiceInstance.setModelUuid(serviceModelUUID);
serviceInstance.setModelInfoServiceInstance(modelInfoServiceInstance);
execution.setVariable(GENERAL_BLOCK_EXECUTION_MAP_KEY, createGeneralBuildingBlock(createService(createPnfsList())));
when(extractPojosForBB.extractByKey(eq(execution), eq(ResourceKey.PNF))).thenReturn(pnf);
when(extractPojosForBB.extractByKey(eq(execution), eq(ResourceKey.SERVICE_INSTANCE_ID))).thenReturn(serviceInstance);
doNothing().when(configureInstanceParamsForPnf).populateInstanceParams(any(), any(), any());
}
use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf in project so by onap.
the class AAIObjectMapperTest method pnfMap.
@Test
public void pnfMap() {
final String pnfId = "PNF_id1";
final String pnfName = "PNF_name1";
final String modelCustomizationId = "8421fe03-fd1b-4bf7-845a-c3fe91edb03e";
final String modelInvariantId = "341a6f84-2cf9-4942-8f9e-2472ffe4e1d8";
final String modelVersionId = "b13a0706-46b9-4a98-a9f9-5b28431235e7";
final OrchestrationStatus orchestrationStatus = OrchestrationStatus.PRECREATED;
Pnf pnf = new Pnf();
pnf.setPnfId(pnfId);
pnf.setPnfName(pnfName);
pnf.setModelInfoPnf(new ModelInfoPnf());
pnf.getModelInfoPnf().setModelCustomizationUuid(modelCustomizationId);
pnf.getModelInfoPnf().setModelInvariantUuid(modelInvariantId);
pnf.getModelInfoPnf().setModelUuid(modelVersionId);
pnf.setOrchestrationStatus(orchestrationStatus);
org.onap.aai.domain.yang.Pnf aaiPnf = aaiObjectMapper.mapPnf(pnf);
assertEquals(aaiPnf.getPnfId(), pnfId);
assertEquals(aaiPnf.getPnfName(), pnfName);
assertEquals(aaiPnf.getModelCustomizationId(), modelCustomizationId);
assertEquals(aaiPnf.getModelInvariantId(), modelInvariantId);
assertEquals(aaiPnf.getModelVersionId(), modelVersionId);
assertEquals(aaiPnf.getOrchestrationStatus(), orchestrationStatus.toString());
}
use of org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf in project so by onap.
the class BBInputSetupPnf method populatePnfToServiceInstance.
static void populatePnfToServiceInstance(Pnfs pnfs, String pnfId, ServiceInstance serviceInstance) {
removePnfFromServiceIfExists(serviceInstance, pnfId);
Pnf pnf = new Pnf();
pnf.setPnfId(pnfId);
pnf.setPnfName(pnfs.getInstanceName());
pnf.setModelInfoPnf(new ModelInfoPnf());
pnf.getModelInfoPnf().setModelCustomizationUuid(pnfs.getModelInfo().getModelCustomizationId());
pnf.getModelInfoPnf().setModelInvariantUuid(pnfs.getModelInfo().getModelInvariantId());
pnf.getModelInfoPnf().setModelUuid(pnfs.getModelInfo().getModelVersionId());
pnf.setOrchestrationStatus(OrchestrationStatus.PRECREATED);
serviceInstance.getPnfs().add(pnf);
}
Aggregations