Search in sources :

Example 1 with InstanceGroup

use of com.sequenceiq.freeipa.entity.InstanceGroup in project cloudbreak by hortonworks.

the class StackToStackDetailsConverter method convert.

public StackDetails convert(Stack source) {
    StackDetails stackDetails = new StackDetails();
    stackDetails.setId(source.getId());
    stackDetails.setName(source.getName());
    stackDetails.setTunnel(source.getTunnel().name());
    stackDetails.setRegion(source.getRegion());
    stackDetails.setAvailabilityZone(source.getAvailabilityZone());
    stackDetails.setCloudPlatform(source.getCloudPlatform());
    stackDetails.setPlatformVariant(source.getPlatformvariant());
    StackStatus stackStatus = source.getStackStatus();
    if (stackStatus != null) {
        stackDetails.setStatus(stackStatus.getStatusString());
        stackDetails.setDetailedStatus(stackStatus.getDetailedStackStatusString());
        stackDetails.setStatusReason(stackStatus.getStatusReason());
    }
    Set<InstanceGroup> instanceGroups = instanceGroupService.findByStackId(source.getId());
    stackDetails.setMultiAz(getMultiAz(instanceGroups));
    stackDetails.setInstanceGroups(instanceGroups.stream().map(e -> instanceGroupToInstanceGroupDetailsConverter.convert(e)).collect(Collectors.toList()));
    stackDetails.setTags(source.getTags());
    convertImage(stackDetails, source);
    return stackDetails;
}
Also used : StackStatus(com.sequenceiq.freeipa.entity.StackStatus) StackDetails(com.sequenceiq.cloudbreak.structuredevent.event.StackDetails) InstanceGroup(com.sequenceiq.freeipa.entity.InstanceGroup)

Example 2 with InstanceGroup

use of com.sequenceiq.freeipa.entity.InstanceGroup in project cloudbreak by hortonworks.

the class CreateFreeIpaRequestToStackConverter method extendGatewaySecurityGroupWithDefaultGatewayCidrs.

private void extendGatewaySecurityGroupWithDefaultGatewayCidrs(Stack stack) {
    Set<InstanceGroup> gateways = stack.getInstanceGroups().stream().filter(ig -> InstanceGroupType.MASTER == ig.getInstanceGroupType()).collect(Collectors.toSet());
    Set<String> defaultGatewayCidrs = defaultGatewayCidr.stream().filter(StringUtils::isNotBlank).collect(Collectors.toSet());
    if (!defaultGatewayCidrs.isEmpty() && !stack.getTunnel().useCcm()) {
        for (InstanceGroup gateway : gateways) {
            if (gateway.getSecurityGroup() != null && CollectionUtils.isEmpty(gateway.getSecurityGroup().getSecurityGroupIds())) {
                Set<SecurityRule> rules = gateway.getSecurityGroup().getSecurityRules();
                defaultGatewayCidrs.forEach(cloudbreakCidr -> rules.add(createSecurityRule(gateway.getSecurityGroup(), cloudbreakCidr, stack.getGatewayport().toString())));
                LOGGER.info("The control plane cidrs {} are added to the {} gateway group for the {} port.", defaultGatewayCidrs, gateway.getGroupName(), stack.getGatewayport());
            }
        }
    }
}
Also used : GcpEnvironmentParameters(com.sequenceiq.environment.api.v1.environment.model.request.gcp.GcpEnvironmentParameters) EntitlementService(com.sequenceiq.cloudbreak.auth.altus.EntitlementService) CDPTagGenerationRequest(com.sequenceiq.cloudbreak.tag.request.CDPTagGenerationRequest) GCP_KMS_ENCRYPTION_KEY(com.sequenceiq.freeipa.util.CloudArgsForIgConverter.GCP_KMS_ENCRYPTION_KEY) LoggerFactory(org.slf4j.LoggerFactory) PasswordUtil(com.sequenceiq.cloudbreak.util.PasswordUtil) TimeoutException(java.util.concurrent.TimeoutException) AzureEnvironmentParameters(com.sequenceiq.environment.api.v1.environment.model.request.azure.AzureEnvironmentParameters) GcpResourceEncryptionParameters(com.sequenceiq.environment.api.v1.environment.model.request.gcp.GcpResourceEncryptionParameters) StringUtils(org.apache.commons.lang3.StringUtils) AwsEnvironmentParameters(com.sequenceiq.environment.api.v1.environment.model.request.aws.AwsEnvironmentParameters) Future(java.util.concurrent.Future) Map(java.util.Map) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) NetworkRequestToNetworkConverter(com.sequenceiq.freeipa.converter.network.NetworkRequestToNetworkConverter) CrnService(com.sequenceiq.freeipa.util.CrnService) Tunnel(com.sequenceiq.common.api.type.Tunnel) FreeIpaServerRequest(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.FreeIpaServerRequest) EnumMap(java.util.EnumMap) Platform(com.sequenceiq.cloudbreak.cloud.model.Platform) StackTags(com.sequenceiq.cloudbreak.cloud.model.StackTags) Set(java.util.Set) UUID(java.util.UUID) Collectors(java.util.stream.Collectors) Json(com.sequenceiq.cloudbreak.common.json.Json) StringIterate.isEmpty(com.gs.collections.impl.utility.StringIterate.isEmpty) DISK_ENCRYPTION_SET_ID(com.sequenceiq.freeipa.util.CloudArgsForIgConverter.DISK_ENCRYPTION_SET_ID) CollectionUtils(org.springframework.util.CollectionUtils) Optional(java.util.Optional) DetailedStackStatus(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.DetailedStackStatus) CloudArgsForIgConverter(com.sequenceiq.freeipa.util.CloudArgsForIgConverter) StackAuthenticationRequestToStackAuthenticationConverter(com.sequenceiq.freeipa.converter.authentication.StackAuthenticationRequestToStackAuthenticationConverter) BackupConverter(com.sequenceiq.freeipa.converter.backup.BackupConverter) SecurityGroup(com.sequenceiq.freeipa.entity.SecurityGroup) Region(com.sequenceiq.cloudbreak.cloud.model.Region) CreateFreeIpaRequest(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.create.CreateFreeIpaRequest) AWS_KMS_ENCRYPTION_KEY(com.sequenceiq.freeipa.util.CloudArgsForIgConverter.AWS_KMS_ENCRYPTION_KEY) PlacementBase(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.region.PlacementBase) StackStatus(com.sequenceiq.freeipa.entity.StackStatus) TelemetryConverter(com.sequenceiq.freeipa.converter.telemetry.TelemetryConverter) MDCBuilder(com.sequenceiq.cloudbreak.logger.MDCBuilder) InstanceGroupRequestToInstanceGroupConverter(com.sequenceiq.freeipa.converter.instance.InstanceGroupRequestToInstanceGroupConverter) HashMap(java.util.HashMap) AzureResourceEncryptionParameters(com.sequenceiq.environment.api.v1.environment.model.request.azure.AzureResourceEncryptionParameters) CloudPlatform(com.sequenceiq.cloudbreak.common.mappable.CloudPlatform) StringUtils.isNotEmpty(org.apache.commons.lang3.StringUtils.isNotEmpty) AwsDiskEncryptionParameters(com.sequenceiq.environment.api.v1.environment.model.request.aws.AwsDiskEncryptionParameters) HashSet(java.util.HashSet) Inject(javax.inject.Inject) Value(org.springframework.beans.factory.annotation.Value) Strings(com.google.common.base.Strings) CrnResourceDescriptor(com.sequenceiq.cloudbreak.auth.crn.CrnResourceDescriptor) Platform.platform(com.sequenceiq.cloudbreak.cloud.model.Platform.platform) AccountTagService(com.sequenceiq.freeipa.service.tag.AccountTagService) InstanceGroupType(com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceGroupType) Stack(com.sequenceiq.freeipa.entity.Stack) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Logger(org.slf4j.Logger) SecurityRule(com.sequenceiq.freeipa.entity.SecurityRule) Maps(com.google.common.collect.Maps) ExecutionException(java.util.concurrent.ExecutionException) TimeUnit(java.util.concurrent.TimeUnit) Component(org.springframework.stereotype.Component) InstanceGroup(com.sequenceiq.freeipa.entity.InstanceGroup) CostTagging(com.sequenceiq.cloudbreak.tag.CostTagging) SecurityRule(com.sequenceiq.freeipa.entity.SecurityRule) InstanceGroup(com.sequenceiq.freeipa.entity.InstanceGroup)

Example 3 with InstanceGroup

use of com.sequenceiq.freeipa.entity.InstanceGroup in project cloudbreak by hortonworks.

the class InstanceMetaDataToCloudInstanceConverter method convert.

public CloudInstance convert(InstanceMetaData metaDataEntity) {
    InstanceGroup group = metaDataEntity.getInstanceGroup();
    Optional<StackAuthenticationView> stackAuthenticationView = instanceMetaDataService.getStackAuthenticationViewByInstanceMetaDataId(metaDataEntity.getId());
    Template template = metaDataEntity.getInstanceGroup().getTemplate();
    Optional<StackAuthentication> stackAuthentication = stackAuthenticationView.map(StackAuthenticationView::getStackAuthentication);
    InstanceStatus status = getInstanceStatus(metaDataEntity);
    String imageId = stackAuthenticationView.map(StackAuthenticationView::getStackId).map(stackId -> imageService.getByStackId(stackId)).map(ImageEntity::getImageName).orElse(null);
    InstanceTemplate instanceTemplate = stackToCloudStackConverter.buildInstanceTemplate(template, group.getGroupName(), metaDataEntity.getPrivateId(), status, imageId);
    InstanceAuthentication instanceAuthentication = new InstanceAuthentication(stackAuthentication.map(StackAuthentication::getPublicKey).orElse(null), stackAuthentication.map(StackAuthentication::getPublicKeyId).orElse(null), stackAuthentication.map(StackAuthentication::getLoginUserName).orElse(null));
    Map<String, Object> params = new HashMap<>();
    params.put(SUBNET_ID, metaDataEntity.getSubnetId());
    params.put(CloudInstance.INSTANCE_NAME, metaDataEntity.getInstanceName());
    Stack stack = stackAuthenticationView.map(StackAuthenticationView::getStackId).map(stackService::getStackById).orElseThrow(NotFoundException::new);
    Map<String, Object> cloudInstanceParameters = stackToCloudStackConverter.buildCloudInstanceParameters(stack.getEnvironmentCrn(), metaDataEntity);
    params.putAll(cloudInstanceParameters);
    return new CloudInstance(metaDataEntity.getInstanceId(), instanceTemplate, instanceAuthentication, metaDataEntity.getSubnetId(), stack.getAvailabilityZone(), params);
}
Also used : StackAuthentication(com.sequenceiq.freeipa.entity.StackAuthentication) InstanceAuthentication(com.sequenceiq.cloudbreak.cloud.model.InstanceAuthentication) HashMap(java.util.HashMap) NotFoundException(javax.ws.rs.NotFoundException) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) InstanceGroup(com.sequenceiq.freeipa.entity.InstanceGroup) Template(com.sequenceiq.freeipa.entity.Template) InstanceTemplate(com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate) Stack(com.sequenceiq.freeipa.entity.Stack) InstanceStatus(com.sequenceiq.cloudbreak.cloud.model.InstanceStatus) StackAuthenticationView(com.sequenceiq.freeipa.entity.projection.StackAuthenticationView) InstanceTemplate(com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate)

Example 4 with InstanceGroup

use of com.sequenceiq.freeipa.entity.InstanceGroup in project cloudbreak by hortonworks.

the class FreeIpaUpscaleActions method updateMetadataAction.

@Bean(name = "UPSCALE_UPDATE_METADATA_STATE")
public Action<?, ?> updateMetadataAction() {
    return new AbstractUpscaleAction<>(PostInstallFreeIpaSuccess.class) {

        @Override
        protected void doExecute(StackContext context, PostInstallFreeIpaSuccess payload, Map<Object, Object> variables) {
            Stack stack = context.getStack();
            stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Upscale update metadata");
            if (!isRepair(variables)) {
                int nodeCount = getInstanceCountByGroup(variables);
                for (InstanceGroup instanceGroup : stack.getInstanceGroups()) {
                    instanceGroup.setNodeCount(nodeCount);
                    instanceGroupService.save(instanceGroup);
                }
            }
            sendEvent(context, UPSCALE_UPDATE_METADATA_FINISHED_EVENT.selector(), new StackEvent(stack.getId()));
        }
    };
}
Also used : StackEvent(com.sequenceiq.freeipa.flow.stack.StackEvent) StackContext(com.sequenceiq.freeipa.flow.stack.StackContext) PostInstallFreeIpaSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaSuccess) Map(java.util.Map) EnvironmentEndpoint(com.sequenceiq.environment.api.v1.environment.endpoint.EnvironmentEndpoint) Stack(com.sequenceiq.freeipa.entity.Stack) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) InstanceGroup(com.sequenceiq.freeipa.entity.InstanceGroup) Bean(org.springframework.context.annotation.Bean)

Example 5 with InstanceGroup

use of com.sequenceiq.freeipa.entity.InstanceGroup in project cloudbreak by hortonworks.

the class FreeIpaUpscaleActions method addInstancesAction.

@Bean(name = "UPSCALE_ADD_INSTANCES_STATE")
public Action<?, ?> addInstancesAction() {
    return new AbstractUpscaleAction<>(StackEvent.class) {

        @Override
        protected void doExecute(StackContext context, StackEvent payload, Map<Object, Object> variables) {
            Stack stack = context.getStack();
            stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Adding instances");
            List<CloudInstance> newInstances = buildNewInstances(context.getStack(), getInstanceCountByGroup(variables));
            if (newInstances.isEmpty()) {
                skipAddingNewInstances(context, stack);
            } else {
                addNewInstances(context, stack, newInstances);
            }
        }

        private void skipAddingNewInstances(StackContext context, Stack stack) {
            List<CloudResourceStatus> list = resourceService.getAllAsCloudResourceStatus(stack.getId());
            UpscaleStackRequest<UpscaleStackResult> request = new UpscaleStackRequest<>(context.getCloudContext(), context.getCloudCredential(), context.getCloudStack(), ResourceLists.transform(list), new AdjustmentTypeWithThreshold(AdjustmentType.EXACT, 0L));
            UpscaleStackResult result = new UpscaleStackResult(request.getResourceId(), ResourceStatus.CREATED, list);
            sendEvent(context, result.selector(), result);
        }

        private void addNewInstances(StackContext context, Stack stack, List<CloudInstance> newInstances) {
            Stack updatedStack = instanceMetaDataService.saveInstanceAndGetUpdatedStack(stack, newInstances);
            List<CloudResource> cloudResources = resourceService.findAllByStackId(stack.getId()).stream().map(resource -> resourceConverter.convert(resource)).collect(Collectors.toList());
            CloudStack updatedCloudStack = cloudStackConverter.convert(updatedStack);
            UpscaleStackRequest<UpscaleStackResult> request = new UpscaleStackRequest<>(context.getCloudContext(), context.getCloudCredential(), updatedCloudStack, cloudResources, new AdjustmentTypeWithThreshold(AdjustmentType.EXACT, (long) newInstances.size()));
            sendEvent(context, request.selector(), request);
        }

        private List<CloudInstance> buildNewInstances(Stack stack, int instanceCountByGroup) {
            long privateId = privateIdProvider.getFirstValidPrivateId(stack.getInstanceGroups());
            List<CloudInstance> newInstances = new ArrayList<>();
            for (InstanceGroup instanceGroup : stack.getInstanceGroups()) {
                int remainingInstances = instanceCountByGroup - instanceGroup.getNotDeletedInstanceMetaDataSet().size();
                for (long i = 0; i < remainingInstances; ++i) {
                    newInstances.add(cloudStackConverter.buildInstance(stack, null, instanceGroup, stack.getStackAuthentication(), privateId++, InstanceStatus.CREATE_REQUESTED));
                }
            }
            return newInstances;
        }
    };
}
Also used : StringUtils(org.apache.commons.lang3.StringUtils) UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent) ThreadBasedUserCrnProvider(com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider) Map(java.util.Map) UPSCALE_UPDATE_ENVIRONMENT_STACK_CONFIG_FINISHED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_UPDATE_ENVIRONMENT_STACK_CONFIG_FINISHED_EVENT) CloudVmInstanceStatus(com.sequenceiq.cloudbreak.cloud.model.CloudVmInstanceStatus) EnvironmentEndpoint(com.sequenceiq.environment.api.v1.environment.endpoint.EnvironmentEndpoint) PayloadConverter(com.sequenceiq.flow.core.PayloadConverter) UPSCALE_RECORD_HOSTNAMES_FINISHED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_RECORD_HOSTNAMES_FINISHED_EVENT) CloudResourceStatus(com.sequenceiq.cloudbreak.cloud.model.CloudResourceStatus) FailureDetails(com.sequenceiq.freeipa.api.v1.freeipa.user.model.FailureDetails) Set(java.util.Set) WebApplicationExceptionMessageExtractor(com.sequenceiq.cloudbreak.common.exception.WebApplicationExceptionMessageExtractor) AdjustmentType(com.sequenceiq.common.api.type.AdjustmentType) UPSCALE_UPDATE_ENVIRONMENT_STACK_CONFIG_FAILED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_UPDATE_ENVIRONMENT_STACK_CONFIG_FAILED_EVENT) ValidateCloudStorageRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.cloudstorage.ValidateCloudStorageRequest) Flow(com.sequenceiq.flow.core.Flow) CloudVmMetaDataStatus(com.sequenceiq.cloudbreak.cloud.model.CloudVmMetaDataStatus) KerberosConfigUpdateService(com.sequenceiq.freeipa.service.config.KerberosConfigUpdateService) InstanceGroupService(com.sequenceiq.freeipa.service.stack.instance.InstanceGroupService) UPSCALE_VALIDATE_INSTANCES_FAILED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_VALIDATE_INSTANCES_FAILED_EVENT) UPSCALE_UPDATE_KERBEROS_NAMESERVERS_CONFIG_FAILED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_UPDATE_KERBEROS_NAMESERVERS_CONFIG_FAILED_EVENT) ResourceLists(com.sequenceiq.cloudbreak.cloud.transform.ResourceLists) BootstrapMachinesRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesRequest) Selectable(com.sequenceiq.cloudbreak.common.event.Selectable) UPSCALE_UPDATE_KERBEROS_NAMESERVERS_CONFIG_FINISHED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_UPDATE_KERBEROS_NAMESERVERS_CONFIG_FINISHED_EVENT) UPSCALE_UPDATE_METADATA_FINISHED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_UPDATE_METADATA_FINISHED_EVENT) ResourceToCloudResourceConverter(com.sequenceiq.freeipa.converter.cloud.ResourceToCloudResourceConverter) ArrayList(java.util.ArrayList) StateContext(org.springframework.statemachine.StateContext) InstanceMetaData(com.sequenceiq.freeipa.entity.InstanceMetaData) Stack(com.sequenceiq.freeipa.entity.Stack) StackEvent(com.sequenceiq.freeipa.flow.stack.StackEvent) ClusterProxyRegistrationSuccess(com.sequenceiq.freeipa.flow.stack.provision.event.clusterproxy.ClusterProxyRegistrationSuccess) CommonResourceType(com.sequenceiq.common.api.type.CommonResourceType) PostInstallFreeIpaRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaRequest) UPSCALE_SAVE_METADATA_FINISHED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_SAVE_METADATA_FINISHED_EVENT) PostInstallFreeIpaSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.postinstall.PostInstallFreeIpaSuccess) PostInstallFreeIpaFailedToUpscaleFailureEventConverter(com.sequenceiq.freeipa.flow.freeipa.upscale.failure.PostInstallFreeIpaFailedToUpscaleFailureEventConverter) InstanceStatus(com.sequenceiq.cloudbreak.cloud.model.InstanceStatus) StackToCloudStackConverter(com.sequenceiq.freeipa.converter.cloud.StackToCloudStackConverter) InstallFreeIpaServicesSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesSuccess) SuccessDetails(com.sequenceiq.freeipa.api.v1.freeipa.user.model.SuccessDetails) Action(org.springframework.statemachine.action.Action) StackContext(com.sequenceiq.freeipa.flow.stack.StackContext) LoggerFactory(org.slf4j.LoggerFactory) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) ClientErrorException(javax.ws.rs.ClientErrorException) OrchestratorConfigRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.orchestrator.OrchestratorConfigRequest) ResourceService(com.sequenceiq.freeipa.service.resource.ResourceService) UpscaleStackRequest(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleStackRequest) UpscaleEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleEvent) UPSCALE_FINISHED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_FINISHED_EVENT) HostMetadataSetupRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupRequest) CollectMetadataResultToUpscaleFailureEventConverter(com.sequenceiq.freeipa.flow.freeipa.upscale.failure.CollectMetadataResultToUpscaleFailureEventConverter) ClusterProxyUpdateRegistrationRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.clusterproxy.ClusterProxyUpdateRegistrationRequest) UPSCALE_STARTING_FINISHED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_STARTING_FINISHED_EVENT) ResourceStatus(com.sequenceiq.cloudbreak.cloud.model.ResourceStatus) InstanceMetaDataService(com.sequenceiq.freeipa.service.stack.instance.InstanceMetaDataService) TlsSetupService(com.sequenceiq.freeipa.service.TlsSetupService) FlowParameters(com.sequenceiq.flow.core.FlowParameters) ClusterProxyRegistrationRequest(com.sequenceiq.freeipa.flow.stack.provision.event.clusterproxy.ClusterProxyRegistrationRequest) UpscaleStackResultToUpscaleFailureEventConverter(com.sequenceiq.freeipa.flow.freeipa.upscale.failure.UpscaleStackResultToUpscaleFailureEventConverter) InstallFreeIpaServicesRequest(com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesRequest) Collectors(java.util.stream.Collectors) String.format(java.lang.String.format) RegionAwareInternalCrnGeneratorFactory(com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGeneratorFactory) FAIL_HANDLED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.FAIL_HANDLED_EVENT) Objects(java.util.Objects) Configuration(org.springframework.context.annotation.Configuration) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) List(java.util.List) HostMetadataSetupFailedToUpscaleFailureEventConverter(com.sequenceiq.freeipa.flow.freeipa.upscale.failure.HostMetadataSetupFailedToUpscaleFailureEventConverter) StackUpdater(com.sequenceiq.freeipa.service.stack.StackUpdater) BootstrapMachinesFailedToUpscaleFailureEventConverter(com.sequenceiq.freeipa.flow.freeipa.upscale.failure.BootstrapMachinesFailedToUpscaleFailureEventConverter) UpscaleStackResult(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleStackResult) HashSet(java.util.HashSet) Inject(javax.inject.Inject) BootstrapMachinesSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.bootstrap.BootstrapMachinesSuccess) InstallFreeIpaServicesFailedToUpscaleFailureEventConverter(com.sequenceiq.freeipa.flow.freeipa.upscale.failure.InstallFreeIpaServicesFailedToUpscaleFailureEventConverter) Resource(com.sequenceiq.freeipa.entity.Resource) Logger(org.slf4j.Logger) UpscaleFlowEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent) ValidateInstancesHealthEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.ValidateInstancesHealthEvent) CollectMetadataResult(com.sequenceiq.cloudbreak.cloud.event.instance.CollectMetadataResult) CollectMetadataRequest(com.sequenceiq.cloudbreak.cloud.event.instance.CollectMetadataRequest) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) AdjustmentTypeWithThreshold(com.sequenceiq.common.api.adjustment.AdjustmentTypeWithThreshold) ClusterProxyUpdateRegistrationSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.clusterproxy.ClusterProxyUpdateRegistrationSuccess) ClusterProxyUpdateRegistrationFailedToUpscaleFailureEventConverter(com.sequenceiq.freeipa.flow.freeipa.upscale.failure.ClusterProxyUpdateRegistrationFailedToUpscaleFailureEventConverter) OperationService(com.sequenceiq.freeipa.service.operation.OperationService) OperationException(com.sequenceiq.cloudbreak.service.OperationException) MetadataSetupService(com.sequenceiq.freeipa.service.stack.instance.MetadataSetupService) InstanceGroup(com.sequenceiq.freeipa.entity.InstanceGroup) HostMetadataSetupSuccess(com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupSuccess) UPSCALE_VALIDATE_INSTANCES_FINISHED_EVENT(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleFlowEvent.UPSCALE_VALIDATE_INSTANCES_FINISHED_EVENT) Bean(org.springframework.context.annotation.Bean) Collections(java.util.Collections) UpscaleState(com.sequenceiq.freeipa.flow.freeipa.upscale.UpscaleState) ArrayList(java.util.ArrayList) CloudInstance(com.sequenceiq.cloudbreak.cloud.model.CloudInstance) AdjustmentTypeWithThreshold(com.sequenceiq.common.api.adjustment.AdjustmentTypeWithThreshold) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) EnvironmentEndpoint(com.sequenceiq.environment.api.v1.environment.endpoint.EnvironmentEndpoint) Stack(com.sequenceiq.freeipa.entity.Stack) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) InstanceGroup(com.sequenceiq.freeipa.entity.InstanceGroup) UpscaleStackResult(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleStackResult) StackEvent(com.sequenceiq.freeipa.flow.stack.StackEvent) StackContext(com.sequenceiq.freeipa.flow.stack.StackContext) CloudResourceStatus(com.sequenceiq.cloudbreak.cloud.model.CloudResourceStatus) UpscaleStackRequest(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleStackRequest) ArrayList(java.util.ArrayList) List(java.util.List) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) Map(java.util.Map) Bean(org.springframework.context.annotation.Bean)

Aggregations

InstanceGroup (com.sequenceiq.freeipa.entity.InstanceGroup)60 Stack (com.sequenceiq.freeipa.entity.Stack)32 InstanceMetaData (com.sequenceiq.freeipa.entity.InstanceMetaData)31 Test (org.junit.jupiter.api.Test)30 Template (com.sequenceiq.freeipa.entity.Template)18 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)16 FreeIpaServerRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.FreeIpaServerRequest)11 Json (com.sequenceiq.cloudbreak.common.json.Json)10 InstanceGroupRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceGroupRequest)10 NetworkRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.network.NetworkRequest)10 CloudInstance (com.sequenceiq.cloudbreak.cloud.model.CloudInstance)9 AwsInstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.instance.AwsInstanceTemplate)9 InstanceGroupNetwork (com.sequenceiq.freeipa.entity.InstanceGroupNetwork)9 HashSet (java.util.HashSet)9 AzureInstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.instance.AzureInstanceTemplate)8 FreeIpa (com.sequenceiq.freeipa.entity.FreeIpa)7 InstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.InstanceTemplate)6 InstanceTemplateRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.common.instance.InstanceTemplateRequest)6 HashMap (java.util.HashMap)6 CreateFreeIpaRequest (com.sequenceiq.freeipa.api.v1.freeipa.stack.model.create.CreateFreeIpaRequest)5