use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.azure.AzureDatabaseServerV4Parameters 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.azure.AzureDatabaseServerV4Parameters in project cloudbreak by hortonworks.
the class AzureDatabaseServerParameterSetterTest method testNonHAServer.
@Test
public void testNonHAServer() {
underTest.setParameters(request, SdxDatabaseAvailabilityType.NON_HA, null);
verify(request).setAzure(captor.capture());
AzureDatabaseServerV4Parameters azureDatabaseServerV4Parameters = captor.getValue();
assertEquals(false, azureDatabaseServerV4Parameters.getGeoRedundantBackup());
assertEquals(7, azureDatabaseServerV4Parameters.getBackupRetentionDays());
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.azure.AzureDatabaseServerV4Parameters in project cloudbreak by hortonworks.
the class AzureDatabaseServerParameterSetterTest method testHAServer.
@Test
public void testHAServer() {
underTest.setParameters(request, SdxDatabaseAvailabilityType.HA, null);
verify(request).setAzure(captor.capture());
AzureDatabaseServerV4Parameters azureDatabaseServerV4Parameters = captor.getValue();
assertEquals(true, azureDatabaseServerV4Parameters.getGeoRedundantBackup());
assertEquals(30, azureDatabaseServerV4Parameters.getBackupRetentionDays());
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.azure.AzureDatabaseServerV4Parameters in project cloudbreak by hortonworks.
the class AzureDatabaseServerParameterSetterTest method testEngineVersion.
@Test
public void testEngineVersion() {
underTest.setParameters(request, SdxDatabaseAvailabilityType.NON_HA, "13");
verify(request).setAzure(captor.capture());
AzureDatabaseServerV4Parameters azureDatabaseServerV4Parameters = captor.getValue();
assertEquals(false, azureDatabaseServerV4Parameters.getGeoRedundantBackup());
assertEquals(7, azureDatabaseServerV4Parameters.getBackupRetentionDays());
assertEquals("13", azureDatabaseServerV4Parameters.getDbVersion());
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.azure.AzureDatabaseServerV4Parameters 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);
}
Aggregations