use of com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.AvailabilityType in project cloudbreak by hortonworks.
the class FreeIpaScalingService method downscale.
public DownscaleResponse downscale(String accountId, DownscaleRequest request) {
Stack stack = stackService.getByEnvironmentCrnAndAccountIdWithListsAndMdcContext(request.getEnvironmentCrn(), accountId);
Set<InstanceMetaData> allInstances = stack.getNotDeletedInstanceMetaDataSet();
AvailabilityType originalAvailabilityType = AvailabilityType.getByInstanceCount(allInstances.size());
logRequest(OperationType.DOWNSCALE, request, originalAvailabilityType);
validationService.validateStackForDownscale(allInstances, stack, new ScalingPath(originalAvailabilityType, request.getTargetAvailabilityType()));
return triggerDownscale(request, stack, originalAvailabilityType);
}
Aggregations