use of com.sequenceiq.cloudbreak.converter.v4.stacks.StackToExternalDatabaseRequestConverter in project cloudbreak by hortonworks.
the class StackToStackV4RequestConverter method convert.
public StackV4Request convert(Stack source) {
StackV4Request stackV4Request = new StackV4Request();
stackV4Request.setCloudPlatform(getIfNotNull(source.getCloudPlatform(), cp -> Enum.valueOf(CloudPlatform.class, cp)));
stackV4Request.setEnvironmentCrn(source.getEnvironmentCrn());
stackV4Request.setCustomDomain(getCustomDomainSettings(source));
providerParameterCalculator.parse(new HashMap<>(source.getParameters()), stackV4Request);
stackV4Request.setAuthentication(stackAuthenticationToStackAuthenticationV4RequestConverter.convert(source.getStackAuthentication()));
stackV4Request.setNetwork(networkToNetworkV4RequestConverter.convert(source.getNetwork()));
stackV4Request.setCluster(clusterToClusterV4RequestConverter.convert(source.getCluster()));
stackV4Request.setExternalDatabase(getIfNotNull(source, stackToExternalDatabaseRequestConverter::convert));
if (!source.getLoadBalancers().isEmpty()) {
stackV4Request.setEnableLoadBalancer(true);
}
stackV4Request.setInstanceGroups(getInstanceGroups(source));
prepareImage(source, stackV4Request);
prepareTags(source, stackV4Request);
prepareTelemetryRequest(source, stackV4Request);
datalakeService.prepareDatalakeRequest(source, stackV4Request);
stackV4Request.setPlacement(getPlacementSettings(source.getRegion(), source.getAvailabilityZone()));
prepareInputs(source, stackV4Request);
stackV4Request.setTimeToLive(getStackTimeToLive(source));
return stackV4Request;
}
Aggregations