use of com.sequenceiq.cloudbreak.service.externaldatabase.model.DatabaseStackConfig 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.cloudbreak.service.externaldatabase.model.DatabaseStackConfig 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.cloudbreak.service.externaldatabase.model.DatabaseStackConfig in project cloudbreak by hortonworks.
the class ExternalDatabaseServiceTest method setUp.
@BeforeEach
void setUp() {
underTest = new ExternalDatabaseService(redbeamsClient, clusterRepository, dbConfigs, parameterDecoratorMap, databaseObtainerService);
environmentResponse = new DetailedEnvironmentResponse();
environmentResponse.setCloudPlatform(CLOUD_PLATFORM.name());
environmentResponse.setCrn(ENV_CRN);
dbConfigs.put(CLOUD_PLATFORM, new DatabaseStackConfig("instance", "vendor", 1234));
lenient().when(parameterDecoratorMap.get(CLOUD_PLATFORM)).thenReturn(dbServerParameterDecorator);
}
Aggregations