Search in sources :

Example 26 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class RdsViewTest method testCreateRdsViewWhenRDSConfigContainsConnectionUrlWithoutDatabaseNameAndPort.

@Test
public void testCreateRdsViewWhenRDSConfigContainsConnectionUrlWithoutDatabaseNameAndPort() {
    String connectionUrl = "jdbc:postgresql://some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com";
    RDSConfig rdsConfig = createRdsConfig(connectionUrl);
    RdsView underTest = new RdsView(rdsConfig);
    Assert.assertEquals(ASSERT_ERROR_MSG, "some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com", underTest.getHostWithPort());
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) Test(org.junit.Test)

Example 27 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class RdsViewTest method testCreateRdsViewWhenRDSConfigContainsConnectionUrlWithoutJDBCUrlPrefix.

@Test
public void testCreateRdsViewWhenRDSConfigContainsConnectionUrlWithoutJDBCUrlPrefix() {
    String connectionUrl = "some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com:5432/ranger";
    RDSConfig rdsConfig = createRdsConfig(connectionUrl);
    RdsView underTest = new RdsView(rdsConfig);
    Assert.assertEquals(ASSERT_ERROR_MSG, "some-rds.1d3nt1f13r.eu-west-1.rds.amazonaws.com:5432", underTest.getHostWithPort());
}
Also used : RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig) Test(org.junit.Test)

Example 28 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class RdsConfigController method getPublic.

@Override
public RDSConfigResponse getPublic(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    RDSConfig rdsConfig = rdsConfigService.getPublicRdsConfig(name, user);
    return conversionService.convert(rdsConfig, RDSConfigResponse.class);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig)

Example 29 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class RdsConfigController method getPrivate.

@Override
public RDSConfigResponse getPrivate(String name) {
    IdentityUser user = authenticatedUserService.getCbUser();
    RDSConfig rdsConfig = rdsConfigService.getPrivateRdsConfig(name, user);
    return conversionService.convert(rdsConfig, RDSConfigResponse.class);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig)

Example 30 with RDSConfig

use of com.sequenceiq.cloudbreak.domain.RDSConfig in project cloudbreak by hortonworks.

the class RdsConfigController method getPublics.

@Override
public Set<RDSConfigResponse> getPublics() {
    IdentityUser user = authenticatedUserService.getCbUser();
    Set<RDSConfig> rdsConfigs = rdsConfigService.retrieveAccountRdsConfigs(user);
    return toJsonList(rdsConfigs);
}
Also used : IdentityUser(com.sequenceiq.cloudbreak.common.model.user.IdentityUser) RDSConfig(com.sequenceiq.cloudbreak.domain.RDSConfig)

Aggregations

RDSConfig (com.sequenceiq.cloudbreak.domain.RDSConfig)47 Test (org.junit.Test)16 Cluster (com.sequenceiq.cloudbreak.domain.Cluster)7 IdentityUser (com.sequenceiq.cloudbreak.common.model.user.IdentityUser)6 RDSConfigRequest (com.sequenceiq.cloudbreak.api.model.rds.RDSConfigRequest)5 Date (java.util.Date)5 HashSet (java.util.HashSet)5 NotFoundException (com.sequenceiq.cloudbreak.controller.NotFoundException)4 Json (com.sequenceiq.cloudbreak.domain.json.Json)4 IOException (java.io.IOException)4 APIResourceType (com.sequenceiq.cloudbreak.common.type.APIResourceType)3 BadRequestException (com.sequenceiq.cloudbreak.controller.BadRequestException)3 Blueprint (com.sequenceiq.cloudbreak.domain.Blueprint)3 Stack (com.sequenceiq.cloudbreak.domain.Stack)3 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)2 BlueprintInputJson (com.sequenceiq.cloudbreak.api.model.BlueprintInputJson)2 BlueprintParameterJson (com.sequenceiq.cloudbreak.api.model.BlueprintParameterJson)2 ConfigsResponse (com.sequenceiq.cloudbreak.api.model.ConfigsResponse)2 RdsView (com.sequenceiq.cloudbreak.blueprint.template.views.RdsView)2 StackRepoDetails (com.sequenceiq.cloudbreak.cloud.model.component.StackRepoDetails)2