Search in sources :

Example 1 with TargetGroup

use of com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup in project cloudbreak by hortonworks.

the class LoadBalancerToLoadBalancerResponseConverter method convertTargetGroup.

public List<TargetGroupResponse> convertTargetGroup(TargetGroup targetGroup) {
    Set<InstanceGroup> instanceGroups = instanceGroupService.findByTargetGroupId(targetGroup.getId());
    Set<String> instanceIds = getInstanceMetadataForGroups(instanceGroups).stream().map(InstanceMetaData::getInstanceId).collect(Collectors.toSet());
    TargetGroupConfigDbWrapper targetGroupConfig = targetGroup.getProviderConfig();
    Set<TargetGroupPortPair> portPairs = loadBalancerConfigService.getTargetGroupPortPairs(targetGroup);
    return portPairs.stream().map(portPair -> mapPortPairToTargetGroup(instanceIds, targetGroupConfig, portPair)).collect(Collectors.toList());
}
Also used : TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) LoadBalancerConfigService(com.sequenceiq.cloudbreak.service.LoadBalancerConfigService) TargetGroup(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup) AwsTargetGroupConfigDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.aws.AwsTargetGroupConfigDb) GcpLoadBalancerConfigDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.gcp.GcpLoadBalancerConfigDb) AzureTargetGroupResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.loadbalancer.AzureTargetGroupResponse) AwsTargetGroupResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.loadbalancer.AwsTargetGroupResponse) InstanceGroupService(com.sequenceiq.cloudbreak.service.stack.InstanceGroupService) GcpTargetGroupConfigDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.gcp.GcpTargetGroupConfigDb) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) LoadBalancer(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.LoadBalancer) Map(java.util.Map) InstanceMetaDataService(com.sequenceiq.cloudbreak.service.stack.InstanceMetaDataService) AwsLoadBalancerConfigDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.aws.AwsLoadBalancerConfigDb) TargetGroupPersistenceService(com.sequenceiq.cloudbreak.service.stack.TargetGroupPersistenceService) LoadBalancerResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.loadbalancer.LoadBalancerResponse) GcpTargetGroupResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.loadbalancer.GcpTargetGroupResponse) TargetGroupConfigDbWrapper(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroupConfigDbWrapper) AzureTargetGroupConfigDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.azure.AzureTargetGroupConfigDb) Set(java.util.Set) AwsTargetGroupArnsDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.aws.AwsTargetGroupArnsDb) AzureLoadBalancerResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.loadbalancer.AzureLoadBalancerResponse) Collectors(java.util.stream.Collectors) AwsLoadBalancerResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.loadbalancer.AwsLoadBalancerResponse) AzureLoadBalancerConfigDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.azure.AzureLoadBalancerConfigDb) List(java.util.List) Component(org.springframework.stereotype.Component) GcpLoadBalancerResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.loadbalancer.GcpLoadBalancerResponse) InstanceMetaData(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData) Optional(java.util.Optional) TargetGroupResponse(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.loadbalancer.TargetGroupResponse) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup) GcpLoadBalancerNamesDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.gcp.GcpLoadBalancerNamesDb) TargetGroupConfigDbWrapper(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroupConfigDbWrapper) TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)

Example 2 with TargetGroup

use of com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup in project cloudbreak by hortonworks.

the class LoadBalancerConfigService method createLoadBalancers.

public Set<LoadBalancer> createLoadBalancers(Stack stack, DetailedEnvironmentResponse environment, StackV4Request source) {
    LoadBalancerSku sku = getLoadBalancerSku(source);
    boolean azureLoadBalancerDisabled = CloudPlatform.AZURE.toString().equalsIgnoreCase(stack.getCloudPlatform()) && LoadBalancerSku.NONE.equals(sku);
    if (azureLoadBalancerDisabled) {
        Optional<TargetGroup> oozieTargetGroup = setupOozieHATargetGroup(stack, true);
        if (oozieTargetGroup.isPresent()) {
            throw new CloudbreakServiceException("Unsupported setup: Load balancers are disabled, but Oozie HA is configured. " + "Either enable Azure load balancers, or use a non-HA Oozie setup.");
        }
        LOGGER.debug("Azure load balancers have been explicitly disabled.");
        return Collections.emptySet();
    }
    boolean loadBalancerFlagEnabled = source != null && source.isEnableLoadBalancer();
    Set<LoadBalancer> loadBalancers = setupLoadBalancers(stack, environment, false, loadBalancerFlagEnabled, sku);
    if (stack.getCloudPlatform().equalsIgnoreCase(CloudPlatform.AZURE.toString())) {
        configureLoadBalancerAvailabilitySets(stack.getName(), loadBalancers);
        configureLoadBalancerSku(source, loadBalancers);
    }
    return loadBalancers;
}
Also used : LoadBalancerSku(com.sequenceiq.common.api.type.LoadBalancerSku) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) TargetGroup(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup) LoadBalancer(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.LoadBalancer)

Example 3 with TargetGroup

use of com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup in project cloudbreak by hortonworks.

the class LoadBalancerConfigService method setupKnoxTargetGroup.

private Optional<TargetGroup> setupKnoxTargetGroup(Stack stack, boolean dryRun) {
    TargetGroup knoxTargetGroup = null;
    Set<String> knoxGatewayGroupNames = getKnoxGatewayGroups(stack);
    Set<InstanceGroup> knoxGatewayInstanceGroups = stack.getInstanceGroups().stream().filter(ig -> knoxGatewayGroupNames.contains(ig.getGroupName())).collect(Collectors.toSet());
    if (AZURE.equalsIgnoreCase(stack.getCloudPlatform()) && knoxGatewayInstanceGroups.size() > 1) {
        throw new CloudbreakServiceException("For Azure load balancers, Knox must be defined in a single instance group.");
    } else if (!knoxGatewayInstanceGroups.isEmpty()) {
        LOGGER.info("Knox gateway instance found; enabling Knox load balancer configuration.");
        knoxTargetGroup = new TargetGroup();
        knoxTargetGroup.setType(TargetGroupType.KNOX);
        knoxTargetGroup.setInstanceGroups(knoxGatewayInstanceGroups);
        if (!dryRun) {
            LOGGER.debug("Adding target group to Knox gateway instances groups.");
            TargetGroup finalKnoxTargetGroup = knoxTargetGroup;
            knoxGatewayInstanceGroups.forEach(ig -> ig.addTargetGroup(finalKnoxTargetGroup));
        } else {
            LOGGER.debug("Dry run, skipping instance group/target group linkage.");
        }
    }
    return Optional.ofNullable(knoxTargetGroup);
}
Also used : Arrays(java.util.Arrays) EntitlementService(com.sequenceiq.cloudbreak.auth.altus.EntitlementService) LoggerFactory(org.slf4j.LoggerFactory) StringUtils(org.apache.commons.lang3.StringUtils) OozieRoles(com.sequenceiq.cloudbreak.cmtemplate.configproviders.oozie.OozieRoles) ThreadBasedUserCrnProvider(com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider) LoadBalancer(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.LoadBalancer) ProviderParameterCalculator(com.sequenceiq.cloudbreak.common.mappable.ProviderParameterCalculator) PublicEndpointAccessGateway(com.sequenceiq.common.api.type.PublicEndpointAccessGateway) Map(java.util.Map) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) SubnetSelector(com.sequenceiq.cloudbreak.converter.v4.environment.network.SubnetSelector) AzureStackV4Parameters(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.parameter.stack.AzureStackV4Parameters) LoadBalancerPersistenceService(com.sequenceiq.cloudbreak.service.stack.LoadBalancerPersistenceService) Set(java.util.Set) LoadBalancerSku(com.sequenceiq.common.api.type.LoadBalancerSku) Collectors(java.util.stream.Collectors) KnoxRoles(com.sequenceiq.cloudbreak.cmtemplate.configproviders.knox.KnoxRoles) Json(com.sequenceiq.cloudbreak.common.json.Json) List(java.util.List) Optional(java.util.Optional) GCP(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform.GCP) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) CLOUDERA_STACK_VERSION_7_2_11(com.sequenceiq.cloudbreak.cmtemplate.CMRepositoryVersionUtil.CLOUDERA_STACK_VERSION_7_2_11) OOZIE_HTTPS_PORT(com.sequenceiq.cloudbreak.cmtemplate.configproviders.oozie.OozieHAConfigProvider.OOZIE_HTTPS_PORT) NetworkConstants(com.sequenceiq.cloudbreak.common.network.NetworkConstants) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) TargetGroup(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup) Network(com.sequenceiq.cloudbreak.domain.Network) EnvironmentNetworkResponse(com.sequenceiq.environment.api.v1.environment.model.response.EnvironmentNetworkResponse) CloudPlatform(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform) LoadBalancerType(com.sequenceiq.common.api.type.LoadBalancerType) HashSet(java.util.HashSet) Inject(javax.inject.Inject) Value(org.springframework.beans.factory.annotation.Value) AWS(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform.AWS) Service(org.springframework.stereotype.Service) CMRepositoryVersionUtil.isVersionNewerOrEqualThanLimited(com.sequenceiq.cloudbreak.cmtemplate.CMRepositoryVersionUtil.isVersionNewerOrEqualThanLimited) NetworkV4Base(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.base.NetworkV4Base) Map.entry(java.util.Map.entry) AzureInstanceGroupParameters(com.sequenceiq.cloudbreak.cloud.model.instance.AzureInstanceGroupParameters) LoadBalancerCreation(com.sequenceiq.common.api.type.LoadBalancerCreation) CloudSubnet(com.sequenceiq.cloudbreak.cloud.model.CloudSubnet) Logger(org.slf4j.Logger) AvailabilitySetNameService(com.sequenceiq.cloudbreak.cloud.model.instance.AvailabilitySetNameService) TargetGroupType(com.sequenceiq.common.api.type.TargetGroupType) InstanceGroupType(com.sequenceiq.common.api.type.InstanceGroupType) StackV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.StackV4Request) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) StackType(com.sequenceiq.cloudbreak.api.endpoint.v4.common.StackType) Preconditions(com.google.common.base.Preconditions) AZURE(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform.AZURE) Collections(java.util.Collections) CloudbreakServiceException(com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException) TargetGroup(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)

Example 4 with TargetGroup

use of com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup in project cloudbreak by hortonworks.

the class LoadBalancerToLoadBalancerResponseConverterTest method createAwsTargetGroups.

private Set<TargetGroup> createAwsTargetGroups() {
    AwsTargetGroupArnsDb awsTargetGroupArnsDb = new AwsTargetGroupArnsDb();
    awsTargetGroupArnsDb.setListenerArn(LISTENER_ARN);
    awsTargetGroupArnsDb.setTargetGroupArn(TG_ARN);
    AwsTargetGroupConfigDb awsTargetGroupConfigDb = new AwsTargetGroupConfigDb();
    awsTargetGroupConfigDb.setPortArnMapping(Map.of(PORT, awsTargetGroupArnsDb));
    TargetGroupConfigDbWrapper targetGroupConfigDbWrapper = new TargetGroupConfigDbWrapper();
    targetGroupConfigDbWrapper.setAwsConfig(awsTargetGroupConfigDb);
    TargetGroup targetGroup = new TargetGroup();
    targetGroup.setProviderConfig(targetGroupConfigDbWrapper);
    return Set.of(targetGroup);
}
Also used : TargetGroupConfigDbWrapper(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroupConfigDbWrapper) AwsTargetGroupConfigDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.aws.AwsTargetGroupConfigDb) TargetGroup(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup) AwsTargetGroupArnsDb(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.aws.AwsTargetGroupArnsDb)

Example 5 with TargetGroup

use of com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup in project cloudbreak by hortonworks.

the class StackToCloudStackConverterTest method testConvertWithMultipleKnoxLoadBalancers.

@Test
public void testConvertWithMultipleKnoxLoadBalancers() {
    Set<InstanceGroup> instanceGroups = new LinkedHashSet<>();
    InstanceGroup instanceGroup1 = mock(InstanceGroup.class);
    InstanceGroup instanceGroup2 = mock(InstanceGroup.class);
    when(instanceGroup1.getGroupName()).thenReturn("group1");
    when(instanceGroup2.getGroupName()).thenReturn("group2");
    instanceGroups.add(instanceGroup1);
    instanceGroups.add(instanceGroup2);
    when(stack.getInstanceGroupsAsList()).thenReturn(new ArrayList<>(instanceGroups));
    Template template = new Template();
    template.setVolumeTemplates(Set.of());
    when(instanceGroup1.getTemplate()).thenReturn(template);
    when(instanceGroup1.getNotDeletedInstanceMetaDataSet()).thenReturn(Set.of());
    when(instanceGroup1.getStack()).thenReturn(stack);
    when(instanceGroup2.getTemplate()).thenReturn(template);
    when(instanceGroup2.getNotDeletedInstanceMetaDataSet()).thenReturn(Set.of());
    when(instanceGroup2.getStack()).thenReturn(stack);
    TargetGroup targetGroup = mock(TargetGroup.class);
    when(targetGroup.getType()).thenReturn(TargetGroupType.KNOX);
    LoadBalancer internalLoadBalancer = mock(LoadBalancer.class);
    when(internalLoadBalancer.getType()).thenReturn(LoadBalancerType.PRIVATE);
    when(internalLoadBalancer.getId()).thenReturn(1L);
    LoadBalancer externalLoadBalancer = mock(LoadBalancer.class);
    when(externalLoadBalancer.getType()).thenReturn(LoadBalancerType.PUBLIC);
    when(externalLoadBalancer.getId()).thenReturn(2L);
    when(loadBalancerPersistenceService.findByStackId(anyLong())).thenReturn(Set.of(internalLoadBalancer, externalLoadBalancer));
    when(targetGroupPersistenceService.findByLoadBalancerId(anyLong())).thenReturn(Set.of(targetGroup));
    when(instanceGroupService.findByTargetGroupId(anyLong())).thenReturn(Set.of(instanceGroup1, instanceGroup2));
    when(loadBalancerConfigService.getTargetGroupPortPairs(any(TargetGroup.class))).thenReturn(Set.of(new TargetGroupPortPair(443, 8443)));
    CloudStack result = underTest.convert(stack);
    assertEquals(2, result.getLoadBalancers().size());
    Optional<CloudLoadBalancer> internalCloudLoadBalancer = result.getLoadBalancers().stream().filter(lb -> lb.getType() == LoadBalancerType.PRIVATE).findFirst();
    assertTrue(internalCloudLoadBalancer.isPresent());
    Optional<CloudLoadBalancer> externalCloudLoadBalancer = result.getLoadBalancers().stream().filter(lb -> lb.getType() == LoadBalancerType.PUBLIC).findFirst();
    assertTrue(externalCloudLoadBalancer.isPresent());
}
Also used : LinkedHashSet(java.util.LinkedHashSet) BeforeEach(org.junit.jupiter.api.BeforeEach) ResourceGroupUsage(com.sequenceiq.environment.api.v1.environment.model.request.azure.ResourceGroupUsage) Assertions.assertThat(org.assertj.core.api.Assertions.assertThat) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) ComponentConfigProviderService(com.sequenceiq.cloudbreak.service.ComponentConfigProviderService) PlatformParametersConsts(com.sequenceiq.cloudbreak.cloud.PlatformParametersConsts) InstanceMetadataToImageIdConverter(com.sequenceiq.cloudbreak.converter.InstanceMetadataToImageIdConverter) InstanceGroupService(com.sequenceiq.cloudbreak.service.stack.InstanceGroupService) AzureEnvironmentParameters(com.sequenceiq.environment.api.v1.environment.model.request.azure.AzureEnvironmentParameters) CmTemplateProcessorFactory(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessorFactory) ImageService(com.sequenceiq.cloudbreak.service.image.ImageService) Assertions.assertFalse(org.junit.jupiter.api.Assertions.assertFalse) ExtendWith(org.junit.jupiter.api.extension.ExtendWith) LoadBalancer(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.LoadBalancer) Map(java.util.Map) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) TargetGroupPersistenceService(com.sequenceiq.cloudbreak.service.stack.TargetGroupPersistenceService) MethodSource(org.junit.jupiter.params.provider.MethodSource) LoadBalancerPersistenceService(com.sequenceiq.cloudbreak.service.stack.LoadBalancerPersistenceService) MockitoExtension(org.mockito.junit.jupiter.MockitoExtension) Collection(java.util.Collection) StackTemplate(com.sequenceiq.cloudbreak.cloud.model.StackTemplate) StackTags(com.sequenceiq.cloudbreak.cloud.model.StackTags) Set(java.util.Set) LoadBalancerSku(com.sequenceiq.common.api.type.LoadBalancerSku) Collectors(java.util.stream.Collectors) Sets(com.google.common.collect.Sets) SecurityRule(com.sequenceiq.cloudbreak.domain.SecurityRule) RESOURCE_GROUP_USAGE_PARAMETER(com.sequenceiq.cloudbreak.cloud.PlatformParametersConsts.RESOURCE_GROUP_USAGE_PARAMETER) Test(org.junit.jupiter.api.Test) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) Json(com.sequenceiq.cloudbreak.common.json.Json) EncryptionType(com.sequenceiq.common.api.type.EncryptionType) FileSystem(com.sequenceiq.cloudbreak.domain.FileSystem) Group(com.sequenceiq.cloudbreak.cloud.model.Group) Assertions.assertTrue(org.junit.jupiter.api.Assertions.assertTrue) Optional(java.util.Optional) SecurityRuleService(com.sequenceiq.cloudbreak.service.securityrule.SecurityRuleService) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) NetworkConstants(com.sequenceiq.cloudbreak.common.network.NetworkConstants) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup) Mockito.mock(org.mockito.Mockito.mock) Assertions.assertThrows(org.junit.jupiter.api.Assertions.assertThrows) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) Strictness(org.mockito.quality.Strictness) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) Assertions.assertNotNull(org.junit.jupiter.api.Assertions.assertNotNull) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) MockitoSettings(org.mockito.junit.jupiter.MockitoSettings) TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) LoadBalancerConfigService(com.sequenceiq.cloudbreak.service.LoadBalancerConfigService) TargetGroup(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup) Mock(org.mockito.Mock) Assertions.assertNull(org.junit.jupiter.api.Assertions.assertNull) SpiFileSystem(com.sequenceiq.cloudbreak.cloud.model.SpiFileSystem) Image(com.sequenceiq.cloudbreak.cloud.model.Image) CloudPlatform(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform) ArrayList(java.util.ArrayList) LoadBalancerType(com.sequenceiq.common.api.type.LoadBalancerType) HashSet(java.util.HashSet) LinkedHashMap(java.util.LinkedHashMap) DefaultRootVolumeSizeProvider(com.sequenceiq.cloudbreak.service.stack.DefaultRootVolumeSizeProvider) InstanceTemplate(com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate) Assertions.assertEquals(org.junit.jupiter.api.Assertions.assertEquals) LinkedHashSet(java.util.LinkedHashSet) InjectMocks(org.mockito.InjectMocks) AzureResourceGroup(com.sequenceiq.environment.api.v1.environment.model.request.azure.AzureResourceGroup) TargetGroupType(com.sequenceiq.common.api.type.TargetGroupType) Mockito.times(org.mockito.Mockito.times) IOException(java.io.IOException) StackAuthentication(com.sequenceiq.cloudbreak.domain.StackAuthentication) EnvironmentClientService(com.sequenceiq.cloudbreak.service.environment.EnvironmentClientService) Mockito.when(org.mockito.Mockito.when) Mockito.verify(org.mockito.Mockito.verify) CloudbreakImageNotFoundException(com.sequenceiq.cloudbreak.core.CloudbreakImageNotFoundException) Template(com.sequenceiq.cloudbreak.domain.Template) SecurityGroup(com.sequenceiq.cloudbreak.domain.SecurityGroup) Mockito(org.mockito.Mockito) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) InstanceStatus(com.sequenceiq.cloudbreak.cloud.model.InstanceStatus) RESOURCE_GROUP_NAME_PARAMETER(com.sequenceiq.cloudbreak.cloud.PlatformParametersConsts.RESOURCE_GROUP_NAME_PARAMETER) InstanceMetaData(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData) Collections(java.util.Collections) ArgumentMatchers.anyString(org.mockito.ArgumentMatchers.anyString) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) TargetGroup(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup) LoadBalancer(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.LoadBalancer) CloudLoadBalancer(com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) TargetGroupPortPair(com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup) StackTemplate(com.sequenceiq.cloudbreak.cloud.model.StackTemplate) InstanceTemplate(com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate) Template(com.sequenceiq.cloudbreak.domain.Template) Test(org.junit.jupiter.api.Test) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest)

Aggregations

TargetGroup (com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroup)19 TargetGroupPortPair (com.sequenceiq.cloudbreak.cloud.model.TargetGroupPortPair)12 TargetGroupConfigDbWrapper (com.sequenceiq.cloudbreak.domain.stack.loadbalancer.TargetGroupConfigDbWrapper)10 LoadBalancer (com.sequenceiq.cloudbreak.domain.stack.loadbalancer.LoadBalancer)9 CloudLoadBalancerMetadata (com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancerMetadata)7 InstanceGroup (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)7 Test (org.junit.Test)6 AwsTargetGroupConfigDb (com.sequenceiq.cloudbreak.domain.stack.loadbalancer.aws.AwsTargetGroupConfigDb)5 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)4 AwsTargetGroupArnsDb (com.sequenceiq.cloudbreak.domain.stack.loadbalancer.aws.AwsTargetGroupArnsDb)4 CloudLoadBalancer (com.sequenceiq.cloudbreak.cloud.model.CloudLoadBalancer)3 InstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate)3 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)3 Json (com.sequenceiq.cloudbreak.common.json.Json)3 AzureTargetGroupConfigDb (com.sequenceiq.cloudbreak.domain.stack.loadbalancer.azure.AzureTargetGroupConfigDb)3 LoadBalancerSku (com.sequenceiq.common.api.type.LoadBalancerSku)3 Map (java.util.Map)3 Optional (java.util.Optional)3 Set (java.util.Set)3 Collectors (java.util.stream.Collectors)3