Search in sources :

Example 1 with ModelInfoPnf

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);
    }
}
Also used : ModelInfoPnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf) Resource(org.onap.so.bpmn.infrastructure.workflow.tasks.Resource)

Example 2 with ModelInfoPnf

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;
}
Also used : ModelInfoPnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf)

Example 3 with 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());
}
Also used : ModelInfoPnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf) Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf) ModelInfoPnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf) ConfigureInstanceParamsForPnf(org.onap.so.client.cds.ConfigureInstanceParamsForPnf) ServiceInstance(org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance) ModelInfoServiceInstance(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)

Example 4 with ModelInfoPnf

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());
}
Also used : ModelInfoPnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf) Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf) ModelInfoPnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf) OrchestrationStatus(org.onap.so.db.catalog.beans.OrchestrationStatus) Test(org.junit.Test)

Example 5 with ModelInfoPnf

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);
}
Also used : ModelInfoPnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf) Pnf(org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf) ModelInfoPnf(org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf)

Aggregations

ModelInfoPnf (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoPnf)6 Pnf (org.onap.so.bpmn.servicedecomposition.bbobjects.Pnf)4 Test (org.junit.Test)1 Resource (org.onap.so.bpmn.infrastructure.workflow.tasks.Resource)1 ServiceInstance (org.onap.so.bpmn.servicedecomposition.bbobjects.ServiceInstance)1 ModelInfoServiceInstance (org.onap.so.bpmn.servicedecomposition.modelinfo.ModelInfoServiceInstance)1 ConfigureInstanceParamsForPnf (org.onap.so.client.cds.ConfigureInstanceParamsForPnf)1 OrchestrationStatus (org.onap.so.db.catalog.beans.OrchestrationStatus)1