Search in sources :

Example 1 with VolumeGroupRollback

use of org.onap.so.adapters.vnfrest.VolumeGroupRollback in project so by onap.

the class PollService method determineCreateVolumeGroupStatus.

private Optional<String> determineCreateVolumeGroupStatus(CreateVolumeGroupRequest req, ExternalTask externalTask, MutableBoolean success, boolean isMulticloud) throws MsoException {
    boolean pollRollbackStatus = externalTask.getVariable("PollRollbackStatus");
    String stackId = externalTask.getVariable("stackId");
    if (pollRollbackStatus) {
        logger.debug("Executing External Task Poll Service for Rollback Volume Group");
        if (!isMulticloud) {
            pollDeleteResource(118, req.getCloudSiteId(), req.getTenantId(), stackId, success);
        }
        return Optional.empty();
    } else {
        logger.debug("Executing External Task Poll Service for Create Volume Group");
        Map<String, String> outputs = new HashMap<String, String>();
        if (!isMulticloud) {
            int timeoutMinutes = msoHeatUtils.getVfHeatTimeoutValue(req.getModelCustomizationUuid(), true);
            StackInfo stack = pollCreateResource(timeoutMinutes, req.getCloudSiteId(), req.getTenantId(), stackId, success);
            outputs = vnfAdapterImpl.copyStringOutputs(stack.getOutputs());
        }
        VolumeGroupRollback rb = new VolumeGroupRollback(req.getVolumeGroupId(), stackId, true, req.getTenantId(), req.getCloudOwner(), req.getCloudSiteId(), req.getMsoRequest(), req.getMessageId());
        CreateVolumeGroupResponse createResponse = new CreateVolumeGroupResponse(req.getVolumeGroupId(), stackId, true, outputs, rb, req.getMessageId());
        return Optional.of(createResponse.toXmlString());
    }
}
Also used : VolumeGroupRollback(org.onap.so.adapters.vnfrest.VolumeGroupRollback) CreateVolumeGroupResponse(org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse) HashMap(java.util.HashMap) StackInfo(org.onap.so.openstack.beans.StackInfo)

Aggregations

HashMap (java.util.HashMap)1 CreateVolumeGroupResponse (org.onap.so.adapters.vnfrest.CreateVolumeGroupResponse)1 VolumeGroupRollback (org.onap.so.adapters.vnfrest.VolumeGroupRollback)1 StackInfo (org.onap.so.openstack.beans.StackInfo)1