use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest in project cloudbreak by hortonworks.
the class DatabaseService method getDatabaseServerRequest.
private DatabaseServerV4StackRequest getDatabaseServerRequest(CloudPlatform cloudPlatform, SdxCluster sdxCluster) {
DatabaseConfig databaseConfig = dbConfigs.get(new DatabaseConfigKey(cloudPlatform, sdxCluster.getClusterShape()));
if (databaseConfig == null) {
throw new BadRequestException("Database config for cloud platform " + cloudPlatform + ", cluster shape " + sdxCluster.getClusterShape() + " not found");
}
DatabaseServerV4StackRequest req = new DatabaseServerV4StackRequest();
req.setInstanceType(databaseConfig.getInstanceType());
req.setDatabaseVendor(databaseConfig.getVendor());
req.setStorageSize(databaseConfig.getVolumeSize());
databaseServerParameterSetterMap.get(cloudPlatform).setParameters(req, sdxCluster.getDatabaseAvailabilityType(), sdxCluster.getDatabaseEngineVersion());
return req;
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest in project cloudbreak by hortonworks.
the class AzureDatabaseServerParameterSetter method setParameters.
@Override
public void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType, String databaseEngineVersion) {
AzureDatabaseServerV4Parameters parameters = new AzureDatabaseServerV4Parameters();
if (SdxDatabaseAvailabilityType.HA.equals(availabilityType)) {
parameters.setBackupRetentionDays(backupRetentionPeriodHa);
parameters.setGeoRedundantBackup(geoRedundantBackupHa);
} else if (SdxDatabaseAvailabilityType.NON_HA.equals(availabilityType)) {
parameters.setBackupRetentionDays(backupRetentionPeriodNonHa);
parameters.setGeoRedundantBackup(geoRedundantBackupNonHa);
} else {
throw new IllegalArgumentException(availabilityType + " database availability type is not supported on Azure.");
}
if (StringUtils.isNotEmpty(databaseEngineVersion)) {
parameters.setDbVersion(databaseEngineVersion);
}
request.setAzure(parameters);
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest in project cloudbreak by hortonworks.
the class GcpDatabaseServerParameterDecorator method setParameters.
@Override
public void setParameters(DatabaseServerV4StackRequest request, DatabaseServerParameter serverParameter) {
GcpDatabaseServerV4Parameters parameters = new GcpDatabaseServerV4Parameters();
parameters.setEngineVersion(serverParameter.getEngineVersion());
request.setGcp(parameters);
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest in project cloudbreak by hortonworks.
the class AllocateDatabaseServerV4RequestTest method testGettersAndSetters.
@Test
public void testGettersAndSetters() {
request.setName("myallocation");
assertEquals("myallocation", request.getName());
request.setEnvironmentCrn("myenv");
request.setTags(new HashMap<>());
assertEquals("myenv", request.getEnvironmentCrn());
NetworkV4StackRequest network = new NetworkV4StackRequest();
request.setNetwork(network);
assertEquals(network, request.getNetwork());
DatabaseServerV4StackRequest server = new DatabaseServerV4StackRequest();
request.setDatabaseServer(server);
assertEquals(server, request.getDatabaseServer());
}
Aggregations