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));
}
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;
}
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);
}
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;
}
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);
}
Aggregations