use of org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest in project so by onap.
the class StackService method deleteVolumeGroup.
private void deleteVolumeGroup(String xmlRequest, Holder<String> canonicalStackId, MutableBoolean backout, MutableBoolean success) throws VnfException {
backout.setFalse();
DeleteVolumeGroupRequest req = JAXB.unmarshal(new StringReader(xmlRequest), DeleteVolumeGroupRequest.class);
vnfAdapterImpl.deleteVfModule(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), req.getVolumeGroupStackId(), null, req.getMsoRequest(), new Holder<>());
success.setTrue();
canonicalStackId.value = req.getVolumeGroupStackId();
}
use of org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest in project so by onap.
the class VnfAdapterDeleteTasks method deleteVolumeGroup.
public void deleteVolumeGroup(BuildingBlockExecution execution) {
try {
GeneralBuildingBlock gBBInput = execution.getGeneralBuildingBlock();
ServiceInstance serviceInstance = extractPojosForBB.extractByKey(execution, ResourceKey.SERVICE_INSTANCE_ID);
VolumeGroup volumeGroup = extractPojosForBB.extractByKey(execution, ResourceKey.VOLUME_GROUP_ID);
DeleteVolumeGroupRequest deleteVolumeGroupRequest = vnfAdapterVolumeGroupResources.deleteVolumeGroupRequest(gBBInput.getRequestContext(), gBBInput.getCloudRegion(), serviceInstance, volumeGroup);
execution.setVariable(VNFREST_REQUEST, deleteVolumeGroupRequest.toXmlString());
execution.setVariable("deleteVolumeGroupRequest", "true");
} catch (Exception ex) {
exceptionUtil.buildAndThrowWorkflowException(execution, 7000, ex);
}
}
use of org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest in project so by onap.
the class VnfAdapterDeleteTasksTest method test_deleteVolumeGroup.
@Test
public void test_deleteVolumeGroup() throws Exception {
DeleteVolumeGroupRequest deleteVolumeGroupRequest = new DeleteVolumeGroupRequest();
deleteVolumeGroupRequest.setVolumeGroupId("volumeGroupId");
doReturn(deleteVolumeGroupRequest).when(vnfAdapterVolumeGroupResources).deleteVolumeGroupRequest(requestContext, cloudRegion, serviceInstance, volumeGroup);
vnfAdapterDeleteTasks.deleteVolumeGroup(execution);
verify(vnfAdapterVolumeGroupResources, times(1)).deleteVolumeGroupRequest(ArgumentMatchers.eq(requestContext), ArgumentMatchers.eq(cloudRegion), ArgumentMatchers.eq(serviceInstance), ArgumentMatchers.eq(volumeGroup));
assertEquals(execution.getVariable("VNFREST_Request"), deleteVolumeGroupRequest.toXmlString());
}
use of org.onap.so.adapters.vnfrest.DeleteVolumeGroupRequest in project so by onap.
the class VnfAdapterObjectMapper method deleteVolumeGroupRequestMapper.
public DeleteVolumeGroupRequest deleteVolumeGroupRequestMapper(RequestContext requestContext, CloudRegion cloudRegion, ServiceInstance serviceInstance, VolumeGroup volumeGroup) throws IOException {
DeleteVolumeGroupRequest deleteVolumeGroupRequest = new DeleteVolumeGroupRequest();
deleteVolumeGroupRequest.setCloudSiteId(cloudRegion.getLcpCloudRegionId());
deleteVolumeGroupRequest.setTenantId(cloudRegion.getTenantId());
deleteVolumeGroupRequest.setVolumeGroupId(volumeGroup.getVolumeGroupId());
if (!StringUtils.isEmpty(volumeGroup.getHeatStackId())) {
deleteVolumeGroupRequest.setVolumeGroupStackId(volumeGroup.getHeatStackId());
} else {
deleteVolumeGroupRequest.setVolumeGroupStackId(volumeGroup.getVolumeGroupName());
}
deleteVolumeGroupRequest.setSkipAAI(true);
deleteVolumeGroupRequest.setMsoRequest(createMsoRequest(requestContext, serviceInstance));
String messageId = getRandomUuid();
deleteVolumeGroupRequest.setMessageId(messageId);
deleteVolumeGroupRequest.setNotificationUrl(createCallbackUrl("VNFAResponse", messageId));
return deleteVolumeGroupRequest;
}
Aggregations