use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.aws.AwsDatabaseServerV4Parameters 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.aws.AwsDatabaseServerV4Parameters in project cloudbreak by hortonworks.
the class AwsDatabaseServerParameterSetterTest method testHAServer.
@Test
public void testHAServer() {
underTest.setParameters(request, SdxDatabaseAvailabilityType.HA, null);
verify(request).setAws(captor.capture());
AwsDatabaseServerV4Parameters awsDatabaseServerV4Parameters = captor.getValue();
assertEquals("true", awsDatabaseServerV4Parameters.getMultiAZ());
assertEquals(30, awsDatabaseServerV4Parameters.getBackupRetentionPeriod());
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.aws.AwsDatabaseServerV4Parameters in project cloudbreak by hortonworks.
the class AwsDatabaseServerParameterSetterTest method testEngineVersion.
@Test
public void testEngineVersion() {
underTest.setParameters(request, SdxDatabaseAvailabilityType.NON_HA, "13");
verify(request).setAws(captor.capture());
AwsDatabaseServerV4Parameters awsDatabaseServerV4Parameters = captor.getValue();
assertEquals("false", awsDatabaseServerV4Parameters.getMultiAZ());
assertEquals(0, awsDatabaseServerV4Parameters.getBackupRetentionPeriod());
assertEquals("13", awsDatabaseServerV4Parameters.getEngineVersion());
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.aws.AwsDatabaseServerV4Parameters in project cloudbreak by hortonworks.
the class AwsDatabaseServerParameterSetterTest method testNonHAServer.
@Test
public void testNonHAServer() {
underTest.setParameters(request, SdxDatabaseAvailabilityType.NON_HA, null);
verify(request).setAws(captor.capture());
AwsDatabaseServerV4Parameters awsDatabaseServerV4Parameters = captor.getValue();
assertEquals("false", awsDatabaseServerV4Parameters.getMultiAZ());
assertEquals(0, awsDatabaseServerV4Parameters.getBackupRetentionPeriod());
}
use of com.sequenceiq.redbeams.api.endpoint.v4.stacks.aws.AwsDatabaseServerV4Parameters in project cloudbreak by hortonworks.
the class AwsDatabaseServerParameterSetter method setParameters.
@Override
public void setParameters(DatabaseServerV4StackRequest request, SdxDatabaseAvailabilityType availabilityType, String databaseEngineVersion) {
AwsDatabaseServerV4Parameters parameters = new AwsDatabaseServerV4Parameters();
if (SdxDatabaseAvailabilityType.HA.equals(availabilityType)) {
parameters.setBackupRetentionPeriod(backupRetentionPeriodHa);
parameters.setMultiAZ("true");
} else if (SdxDatabaseAvailabilityType.NON_HA.equals(availabilityType)) {
parameters.setBackupRetentionPeriod(backupRetentionPeriodNonHa);
parameters.setMultiAZ("false");
} else {
throw new IllegalArgumentException(availabilityType + " database availability type is not supported on AWS.");
}
if (StringUtils.isNotEmpty(databaseEngineVersion)) {
parameters.setEngineVersion(databaseEngineVersion);
}
request.setAws(parameters);
}
Aggregations