Search in sources :

Example 1 with DatabaseServerV4StackRequest

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;
}
Also used : DatabaseStackConfig(com.sequenceiq.cloudbreak.service.externaldatabase.model.DatabaseStackConfig) DatabaseServerV4StackRequest(com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest) BadRequestException(javax.ws.rs.BadRequestException) DatabaseServerParameter(com.sequenceiq.cloudbreak.service.externaldatabase.model.DatabaseServerParameter)

Example 2 with DatabaseServerV4StackRequest

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;
}
Also used : DatabaseStackConfig(com.sequenceiq.cloudbreak.service.externaldatabase.model.DatabaseStackConfig) DatabaseServerV4StackRequest(com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest) BadRequestException(javax.ws.rs.BadRequestException) DatabaseServerParameter(com.sequenceiq.cloudbreak.service.externaldatabase.model.DatabaseServerParameter)

Example 3 with DatabaseServerV4StackRequest

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);
}
Also used : AwsDatabaseServerV4Parameters(com.sequenceiq.redbeams.api.endpoint.v4.stacks.aws.AwsDatabaseServerV4Parameters)

Example 4 with DatabaseServerV4StackRequest

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);
}
Also used : AzureDatabaseServerV4Parameters(com.sequenceiq.redbeams.api.endpoint.v4.stacks.azure.AzureDatabaseServerV4Parameters)

Example 5 with DatabaseServerV4StackRequest

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;
}
Also used : DatabaseServerV4StackRequest(com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest)

Aggregations

DatabaseServerV4StackRequest (com.sequenceiq.redbeams.api.endpoint.v4.stacks.DatabaseServerV4StackRequest)8 DatabaseServerParameter (com.sequenceiq.cloudbreak.service.externaldatabase.model.DatabaseServerParameter)3 BadRequestException (javax.ws.rs.BadRequestException)3 DatabaseStackConfig (com.sequenceiq.cloudbreak.service.externaldatabase.model.DatabaseStackConfig)2 AllocateDatabaseServerV4Request (com.sequenceiq.redbeams.api.endpoint.v4.databaseserver.requests.AllocateDatabaseServerV4Request)2 NetworkV4StackRequest (com.sequenceiq.redbeams.api.endpoint.v4.stacks.NetworkV4StackRequest)2 AwsDatabaseServerV4Parameters (com.sequenceiq.redbeams.api.endpoint.v4.stacks.aws.AwsDatabaseServerV4Parameters)2 AzureDatabaseServerV4Parameters (com.sequenceiq.redbeams.api.endpoint.v4.stacks.azure.AzureDatabaseServerV4Parameters)2 GcpDatabaseServerV4Parameters (com.sequenceiq.redbeams.api.endpoint.v4.stacks.gcp.GcpDatabaseServerV4Parameters)2 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)2 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)1 SdxStatusEntity (com.sequenceiq.datalake.entity.SdxStatusEntity)1 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)1 SslConfigV4Request (com.sequenceiq.redbeams.api.endpoint.v4.databaseserver.requests.SslConfigV4Request)1 SecurityGroupV4StackRequest (com.sequenceiq.redbeams.api.endpoint.v4.stacks.SecurityGroupV4StackRequest)1 SslCertificateEntry (com.sequenceiq.redbeams.configuration.SslCertificateEntry)1 DBStack (com.sequenceiq.redbeams.domain.stack.DBStack)1 Test (org.junit.Test)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1