Search in sources :

Example 16 with GenericVnf

use of org.onap.aai.domain.yang.GenericVnf in project so by onap.

the class MonitorInstantiateVnfmNodeTaskTest method testGetNodeStatus_genericVnfWithOrchStatusCreated_executionVariableSetToCreate.

@Test
public void testGetNodeStatus_genericVnfWithOrchStatusCreated_executionVariableSetToCreate() throws Exception {
    final org.onap.so.bpmn.servicedecomposition.bbobjects.GenericVnf vnf = getGenericVnf();
    final GenericVnf aaiGenericVnf = getAAIGenericVnf();
    aaiGenericVnf.setOrchestrationStatus(VNF_CREATED);
    when(extractPojosForBB.extractByKey(any(), eq(ResourceKey.GENERIC_VNF_ID))).thenReturn(vnf);
    when(mockedAaiVnfResources.getGenericVnf(eq(VNF_ID))).thenReturn(Optional.of(aaiGenericVnf));
    objUnderTest.getNodeStatus(stubbedxecution);
    assertTrue(stubbedxecution.getVariable(CREATE_VNF_NODE_STATUS));
}
Also used : GenericVnf(org.onap.aai.domain.yang.GenericVnf) BaseTaskTest(org.onap.so.bpmn.BaseTaskTest) Test(org.junit.Test)

Example 17 with GenericVnf

use of org.onap.aai.domain.yang.GenericVnf in project so by onap.

the class MonitorTerminateVnfmNodeTaskTest method getAAIGenericVnf.

private GenericVnf getAAIGenericVnf() {
    final GenericVnf genericVnf = new GenericVnf();
    genericVnf.setVnfId(VNF_ID);
    genericVnf.setVnfName(VNF_NAME);
    return genericVnf;
}
Also used : GenericVnf(org.onap.aai.domain.yang.GenericVnf)

Example 18 with GenericVnf

use of org.onap.aai.domain.yang.GenericVnf in project so by onap.

the class AAIRestClientImpl method updateMaintenceFlagVnfId.

@Override
public void updateMaintenceFlagVnfId(String vnfId, boolean inMaint) {
    GenericVnf genericVnf = new GenericVnf();
    genericVnf.setInMaint(inMaint);
    new AAIResourcesClient().update(AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.network().genericVnf(vnfId)), genericVnf);
}
Also used : GenericVnf(org.onap.aai.domain.yang.GenericVnf)

Example 19 with GenericVnf

use of org.onap.aai.domain.yang.GenericVnf in project so by onap.

the class AAIValidatorImpl method isVNFLocked.

@Override
public boolean isVNFLocked(String vnfId) {
    boolean isLocked = false;
    GenericVnf genericVnf = client.getVnfByName(vnfId);
    if (genericVnf.isInMaint())
        isLocked = true;
    return isLocked;
}
Also used : GenericVnf(org.onap.aai.domain.yang.GenericVnf)

Example 20 with GenericVnf

use of org.onap.aai.domain.yang.GenericVnf in project so by onap.

the class BpmnRequestBuilder method buildVolumeGroupDeleteRequest.

public ServiceInstancesRequest buildVolumeGroupDeleteRequest(String vnfId, String volumeGroupId) throws AAIEntityNotFound {
    GenericVnf vnf = aaiDataRet.getGenericVnf(vnfId);
    if (vnf == null) {
        throw new AAIEntityNotFound(GENERIC_VNF_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId);
    }
    VolumeGroup volumeGroup = aaiDataRet.getVolumeGroup(vnfId, volumeGroupId);
    if (volumeGroup == null) {
        throw new AAIEntityNotFound(VF_MODULE_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId + " volumeGroupId: " + volumeGroupId);
    }
    return createServiceInstancesRequest(vnf, volumeGroup);
}
Also used : GenericVnf(org.onap.aai.domain.yang.GenericVnf) VolumeGroup(org.onap.aai.domain.yang.VolumeGroup) AAIEntityNotFound(org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound)

Aggregations

GenericVnf (org.onap.aai.domain.yang.GenericVnf)63 Test (org.junit.Test)42 RequestDetails (org.onap.so.serviceinstancebeans.RequestDetails)15 WorkflowResourceIds (org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds)11 File (java.io.File)9 GenericVnfs (org.onap.aai.domain.yang.GenericVnfs)9 VfModule (org.onap.aai.domain.yang.VfModule)9 BuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock)9 ExecuteBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock)9 ArrayList (java.util.ArrayList)8 BaseTaskTest (org.onap.so.bpmn.BaseTaskTest)8 ServiceInstance (org.onap.aai.domain.yang.ServiceInstance)7 AAIPluralResourceUri (org.onap.aaiclient.client.aai.entities.uri.AAIPluralResourceUri)7 RestClient (org.onap.so.client.RestClient)6 CoreMatchers.containsString (org.hamcrest.CoreMatchers.containsString)5 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)5 GeneralBuildingBlock (org.onap.so.bpmn.servicedecomposition.entities.GeneralBuildingBlock)4 ResourceKey (org.onap.so.bpmn.servicedecomposition.entities.ResourceKey)4 List (java.util.List)3 DelegateExecution (org.camunda.bpm.engine.delegate.DelegateExecution)3