use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest in project cloudbreak by hortonworks.
the class ExternalDatabaseService method getDatabaseServerStackRequest.
private DatabaseServerV4StackRequest getDatabaseServerStackRequest(CloudPlatform cloudPlatform, DatabaseAvailabilityType externalDatabase) {
DatabaseStackConfig databaseStackConfig = dbConfigs.get(cloudPlatform);
if (databaseStackConfig == null) {
throw new BadRequestException("Database config for cloud platform " + cloudPlatform + " not found");
}
DatabaseServerV4StackRequest request = new DatabaseServerV4StackRequest();
request.setInstanceType(databaseStackConfig.getInstanceType());
request.setDatabaseVendor(databaseStackConfig.getVendor());
request.setStorageSize(databaseStackConfig.getVolumeSize());
DatabaseServerParameter serverParameter = DatabaseServerParameter.builder().withHighlyAvailable(DatabaseAvailabilityType.HA == externalDatabase).build();
parameterDecoratorMap.get(cloudPlatform).setParameters(request, serverParameter);
return request;
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest in project cloudbreak by hortonworks.
the class ExternalDatabaseService method getDatabaseServerStackRequest.
private DatabaseServerV4StackRequest getDatabaseServerStackRequest(CloudPlatform cloudPlatform, DatabaseAvailabilityType externalDatabase, String databaseEngineVersion) {
DatabaseStackConfig databaseStackConfig = dbConfigs.get(cloudPlatform);
if (databaseStackConfig == null) {
throw new BadRequestException("Database config for cloud platform " + cloudPlatform + " not found");
}
DatabaseServerV4StackRequest request = new DatabaseServerV4StackRequest();
request.setInstanceType(databaseStackConfig.getInstanceType());
request.setDatabaseVendor(databaseStackConfig.getVendor());
request.setStorageSize(databaseStackConfig.getVolumeSize());
DatabaseServerParameter serverParameter = DatabaseServerParameter.builder().withHighlyAvailable(DatabaseAvailabilityType.HA == externalDatabase).withEngineVersion(databaseEngineVersion).build();
parameterDecoratorMap.get(cloudPlatform).setParameters(request, serverParameter);
return request;
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest in project cloudbreak by hortonworks.
the class AwsDatabaseServerParameterDecorator method setParameters.
@Override
public void setParameters(DatabaseServerV4StackRequest request, DatabaseServerParameter serverParameter) {
AwsDatabaseServerV4Parameters parameters = new AwsDatabaseServerV4Parameters();
parameters.setBackupRetentionPeriod(serverParameter.isHighlyAvailable() ? retentionPeriodHa : retentionPeriodNonHa);
parameters.setMultiAZ(Boolean.toString(serverParameter.isHighlyAvailable()));
parameters.setEngineVersion(serverParameter.getEngineVersion());
request.setAws(parameters);
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest in project cloudbreak by hortonworks.
the class AzureDatabaseServerParameterDecorator method setParameters.
@Override
public void setParameters(DatabaseServerV4StackRequest request, DatabaseServerParameter serverParameter) {
AzureDatabaseServerV4Parameters parameters = new AzureDatabaseServerV4Parameters();
if (serverParameter.isHighlyAvailable()) {
parameters.setBackupRetentionDays(retentionPeriodHa);
parameters.setGeoRedundantBackup(geoRedundantBackupHa);
} else {
parameters.setBackupRetentionDays(retentionPeriodNonHa);
parameters.setGeoRedundantBackup(geoRedundantBackupNonHa);
}
parameters.setBackupRetentionDays(retentionPeriodHa);
parameters.setGeoRedundantBackup(geoRedundantBackupHa);
parameters.setDbVersion(serverParameter.getEngineVersion());
request.setAzure(parameters);
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest in project cloudbreak by hortonworks.
the class RedbeamsDatabaseServerTestDto method withDatabaseServer.
public RedbeamsDatabaseServerTestDto withDatabaseServer() {
DatabaseServerV4StackRequest databaseServerV4StackRequest = new DatabaseServerV4StackRequest();
databaseServerV4StackRequest.setDatabaseVendor("postgres");
getRequest().setDatabaseServer(databaseServerV4StackRequest);
return this;
}
Aggregations