Search in sources :

Example 11 with InstanceGroup

use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup in project cloudbreak by hortonworks.

the class RegisterPublicDnsHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<RegisterPublicDnsRequest> event) {
    RegisterPublicDnsRequest request = event.getData();
    Stack stack = request.getStack();
    if (gatewayPublicEndpointManagementService.isCertRenewalTriggerable(stack)) {
        try {
            LOGGER.debug("Fetching instance group and instance metadata for stack.");
            InstanceGroup instanceGroup = instanceGroupService.getPrimaryGatewayInstanceGroupByStackId(stack.getId());
            List<InstanceMetaData> instanceMetaData = instanceMetaDataService.findAliveInstancesInInstanceGroup(instanceGroup.getId());
            if (!instanceMetaData.isEmpty()) {
                stack.getInstanceGroups().stream().filter(ig -> ig.getId().equals(instanceGroup.getId())).forEach(ig -> ig.setInstanceMetaData(Set.copyOf(instanceMetaData)));
                LOGGER.debug("Registering load balancer public DNS entry");
                boolean success = clusterPublicEndpointManagementService.provisionLoadBalancer(stack);
                if (!success) {
                    throw new CloudbreakException("Public DNS registration resulted in failed state. Please consult DNS registration logs.");
                }
                LOGGER.debug("Load balancer public DNS registration was successful");
                return new RegisterPublicDnsSuccess(stack);
            } else {
                throw new CloudbreakException("Unable to find instance metadata for primary instance group. Certificates cannot " + "be updated.");
            }
        } catch (Exception e) {
            LOGGER.warn("Failed to register load balancer public DNS entries.", e);
            return new RegisterPublicDnsFailure(request.getResourceId(), e);
        }
    } else {
        LOGGER.info("Certificates and DNS are not managed by PEM for stack {}. Skipping public DNS registration.", stack.getName());
        return new RegisterPublicDnsSuccess(stack);
    }
}
Also used : InstanceMetaData(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) CloudbreakException(com.sequenceiq.cloudbreak.service.CloudbreakException) Logger(org.slf4j.Logger) RegisterPublicDnsRequest(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.RegisterPublicDnsRequest) LoggerFactory(org.slf4j.LoggerFactory) EventSelectorUtil(com.sequenceiq.flow.event.EventSelectorUtil) Set(java.util.Set) HandlerEvent(com.sequenceiq.flow.reactor.api.handler.HandlerEvent) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) RegisterPublicDnsSuccess(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.RegisterPublicDnsSuccess) InstanceGroupService(com.sequenceiq.cloudbreak.service.stack.InstanceGroupService) ClusterPublicEndpointManagementService(com.sequenceiq.cloudbreak.service.publicendpoint.ClusterPublicEndpointManagementService) GatewayPublicEndpointManagementService(com.sequenceiq.cloudbreak.service.publicendpoint.GatewayPublicEndpointManagementService) Inject(javax.inject.Inject) List(java.util.List) Component(org.springframework.stereotype.Component) ExceptionCatcherEventHandler(com.sequenceiq.flow.reactor.api.handler.ExceptionCatcherEventHandler) Event(reactor.bus.Event) InstanceMetaData(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData) InstanceMetaDataService(com.sequenceiq.cloudbreak.service.stack.InstanceMetaDataService) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup) RegisterPublicDnsFailure(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.RegisterPublicDnsFailure) RegisterPublicDnsRequest(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.RegisterPublicDnsRequest) RegisterPublicDnsSuccess(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.RegisterPublicDnsSuccess) RegisterPublicDnsFailure(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.RegisterPublicDnsFailure) CloudbreakException(com.sequenceiq.cloudbreak.service.CloudbreakException) CloudbreakException(com.sequenceiq.cloudbreak.service.CloudbreakException) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)

Example 12 with InstanceGroup

use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup in project cloudbreak by hortonworks.

the class CreateLoadBalancerEntityHandler method doAccept.

@Override
protected Selectable doAccept(HandlerEvent<CreateLoadBalancerEntityRequest> event) {
    CreateLoadBalancerEntityRequest request = event.getData();
    Stack stack = stackService.getById(request.getResourceId());
    try {
        LOGGER.debug("Creating load balancer entity objects for stack {}", stack.getId());
        DetailedEnvironmentResponse environment = environmentClientService.getByCrn(stack.getEnvironmentCrn());
        if (environment != null && environment.getNetwork() != null && PublicEndpointAccessGateway.ENABLED.equals(environment.getNetwork().getPublicEndpointAccessGateway())) {
            enableEndpointGateway(stack, environment);
        }
        Set<InstanceGroup> instanceGroups = instanceGroupService.getByStackAndFetchTemplates(stack.getId());
        instanceGroups.forEach(ig -> ig.setTargetGroups(targetGroupPersistenceService.findByInstanceGroupId(ig.getId())));
        Set<LoadBalancer> existingLoadBalancers = loadBalancerPersistenceService.findByStackId(stack.getId());
        stack.setInstanceGroups(instanceGroups);
        Set<LoadBalancer> newLoadBalancers = loadBalancerConfigService.createLoadBalancers(stack, environment, null);
        Stack savedStack;
        if (doLoadBalancersAlreadyExist(existingLoadBalancers, newLoadBalancers)) {
            LOGGER.debug("Load balancer entities already exist. Continuing flow.");
            savedStack = stack;
        } else {
            LOGGER.debug("Persisting stack and load balancer objects to database.");
            stack.setLoadBalancers(newLoadBalancers);
            String stackName = stack.getName();
            savedStack = measure(() -> stackService.save(stack), LOGGER, "Stackrepository save took {} ms for stack {}", stackName);
            measure(() -> loadBalancerPersistenceService.saveAll(newLoadBalancers), LOGGER, "Load balancers saved in {} ms for stack {}", stackName);
            measure(() -> targetGroupPersistenceService.saveAll(newLoadBalancers.stream().flatMap(lb -> lb.getTargetGroupSet().stream()).collect(Collectors.toSet())), LOGGER, "Target groups saved in {} ms for stack {}", stackName);
            measure(() -> instanceGroupService.saveAll(newLoadBalancers.stream().flatMap(lb -> lb.getAllInstanceGroups().stream()).collect(Collectors.toSet())), LOGGER, "Instance groups saved in {} ms for stack {}", stackName);
            if (stack.getNetwork() != null) {
                measure(() -> networkService.pureSave(stack.getNetwork()), LOGGER, "Network saved in {} ms for stack {}", stackName);
            }
        }
        LOGGER.debug("Load balancer entities successfully persisted.");
        savedStack.setInstanceGroups(newLoadBalancers.stream().flatMap(lb -> lb.getAllInstanceGroups().stream()).collect(Collectors.toSet()));
        savedStack.setNetwork(stack.getNetwork());
        return new CreateLoadBalancerEntitySuccess(request.getResourceId(), savedStack);
    } catch (Exception e) {
        LOGGER.warn("Failed create load balancer entities and persist them to the database.", e);
        return new CreateLoadBalancerEntityFailure(request.getResourceId(), e);
    }
}
Also used : Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) CreateLoadBalancerEntityFailure(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.CreateLoadBalancerEntityFailure) CreateLoadBalancerEntitySuccess(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.CreateLoadBalancerEntitySuccess) CloudbreakException(com.sequenceiq.cloudbreak.service.CloudbreakException) LoadBalancerConfigService(com.sequenceiq.cloudbreak.service.LoadBalancerConfigService) LoggerFactory(org.slf4j.LoggerFactory) EventSelectorUtil(com.sequenceiq.flow.event.EventSelectorUtil) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) ENDPOINT_GATEWAY_SUBNET_ID(com.sequenceiq.cloudbreak.common.network.NetworkConstants.ENDPOINT_GATEWAY_SUBNET_ID) InstanceGroupService(com.sequenceiq.cloudbreak.service.stack.InstanceGroupService) Inject(javax.inject.Inject) SUBNET_ID(com.sequenceiq.cloudbreak.common.network.NetworkConstants.SUBNET_ID) ExceptionCatcherEventHandler(com.sequenceiq.flow.reactor.api.handler.ExceptionCatcherEventHandler) Event(reactor.bus.Event) LoadBalancer(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.LoadBalancer) PublicEndpointAccessGateway(com.sequenceiq.common.api.type.PublicEndpointAccessGateway) Map(java.util.Map) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) NetworkService(com.sequenceiq.cloudbreak.service.network.NetworkService) TargetGroupPersistenceService(com.sequenceiq.cloudbreak.service.stack.TargetGroupPersistenceService) CreateLoadBalancerEntityRequest(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.CreateLoadBalancerEntityRequest) SubnetSelector(com.sequenceiq.cloudbreak.converter.v4.environment.network.SubnetSelector) LoadBalancerPersistenceService(com.sequenceiq.cloudbreak.service.stack.LoadBalancerPersistenceService) CloudSubnet(com.sequenceiq.cloudbreak.cloud.model.CloudSubnet) Logger(org.slf4j.Logger) Benchmark.measure(com.sequenceiq.cloudbreak.util.Benchmark.measure) Set(java.util.Set) HandlerEvent(com.sequenceiq.flow.reactor.api.handler.HandlerEvent) EnvironmentClientService(com.sequenceiq.cloudbreak.service.environment.EnvironmentClientService) Collectors(java.util.stream.Collectors) Json(com.sequenceiq.cloudbreak.common.json.Json) Component(org.springframework.stereotype.Component) Optional(java.util.Optional) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup) Collections(java.util.Collections) StackService(com.sequenceiq.cloudbreak.service.stack.StackService) CreateLoadBalancerEntityFailure(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.CreateLoadBalancerEntityFailure) CreateLoadBalancerEntityRequest(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.CreateLoadBalancerEntityRequest) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) LoadBalancer(com.sequenceiq.cloudbreak.domain.stack.loadbalancer.LoadBalancer) CloudbreakException(com.sequenceiq.cloudbreak.service.CloudbreakException) Stack(com.sequenceiq.cloudbreak.domain.stack.Stack) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup) CreateLoadBalancerEntitySuccess(com.sequenceiq.cloudbreak.reactor.api.event.stack.loadbalancer.CreateLoadBalancerEntitySuccess)

Example 13 with InstanceGroup

use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup in project cloudbreak by hortonworks.

the class UpdateHostsValidator method validateRegisteredHosts.

private void validateRegisteredHosts(Stack stack, HostGroupAdjustmentV4Request hostGroupAdjustment) {
    String hostGroupName = hostGroupAdjustment.getHostGroup();
    hostGroupService.getByClusterIdAndName(stack.getCluster().getId(), hostGroupName).ifPresentOrElse(hostGroup -> {
        if (hostGroup.getInstanceGroup() == null) {
            throw new BadRequestException(String.format("Can't find instancegroup for hostgroup: %s", hostGroupName));
        } else {
            InstanceGroup instanceGroup = hostGroup.getInstanceGroup();
            int hostsCount = instanceGroup.getNotDeletedAndNotZombieInstanceMetaDataSet().size();
            int adjustment = Math.abs(hostGroupAdjustment.getScalingAdjustment());
            Boolean validateNodeCount = hostGroupAdjustment.getValidateNodeCount();
            if (validateNodeCount == null || validateNodeCount) {
                if (hostsCount <= adjustment) {
                    String errorMessage = String.format("[hostGroup: '%s', current hosts: %s, decommissions requested: %s]", hostGroupName, hostsCount, adjustment);
                    throw new BadRequestException(String.format("The host group must contain at least 1 host after the decommission: %s", errorMessage));
                }
            } else if (hostsCount - adjustment < 0) {
                throw new BadRequestException(String.format("There are not enough hosts in host group: %s to remove", hostGroupName));
            }
        }
    }, () -> {
        throw new BadRequestException(String.format("Can't find hostgroup: %s", hostGroupName));
    });
}
Also used : BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Blueprint(com.sequenceiq.cloudbreak.domain.Blueprint) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)

Example 14 with InstanceGroup

use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup 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 15 with InstanceGroup

use of com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup in project cloudbreak by hortonworks.

the class LoadBalancerConfigService method getKnoxGatewayGroups.

public Set<String> getKnoxGatewayGroups(Stack stack) {
    LOGGER.debug("Fetching list of instance groups with Knox gateway installed");
    Set<String> groupNames = new HashSet<>();
    Cluster cluster = stack.getCluster();
    if (cluster != null) {
        LOGGER.debug("Checking if Knox gateway is explicitly defined");
        CmTemplateProcessor cmTemplateProcessor = new CmTemplateProcessor(cluster.getBlueprint().getBlueprintText());
        groupNames = cmTemplateProcessor.getHostGroupsWithComponent(KnoxRoles.KNOX_GATEWAY);
    }
    if (groupNames.isEmpty()) {
        LOGGER.debug("Knox gateway is not explicitly defined; searching for CM gateway hosts");
        groupNames = stack.getInstanceGroups().stream().filter(i -> InstanceGroupType.isGateway(i.getInstanceGroupType())).map(InstanceGroup::getGroupName).collect(Collectors.toSet());
    }
    if (groupNames.isEmpty()) {
        LOGGER.info("No Knox gateway instance groups found");
    }
    return groupNames;
}
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) Cluster(com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster) CmTemplateProcessor(com.sequenceiq.cloudbreak.cmtemplate.CmTemplateProcessor) HashSet(java.util.HashSet) InstanceGroup(com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)

Aggregations

InstanceGroup (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceGroup)288 InstanceMetaData (com.sequenceiq.cloudbreak.domain.stack.instance.InstanceMetaData)132 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)93 Test (org.junit.jupiter.api.Test)91 HashSet (java.util.HashSet)68 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)57 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)47 Template (com.sequenceiq.cloudbreak.domain.Template)45 Test (org.junit.Test)44 Json (com.sequenceiq.cloudbreak.common.json.Json)38 Set (java.util.Set)37 Cluster (com.sequenceiq.cloudbreak.domain.stack.cluster.Cluster)34 ArrayList (java.util.ArrayList)31 LinkedHashSet (java.util.LinkedHashSet)31 Map (java.util.Map)28 InstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate)27 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)27 List (java.util.List)26 HostGroup (com.sequenceiq.cloudbreak.domain.stack.cluster.host.HostGroup)25 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)22