Search in sources :

Example 11 with OperationException

use of com.sequenceiq.cloudbreak.service.OperationException in project cloudbreak by hortonworks.

the class CredentialPrerequisiteService method getCloudbreakPrerequisites.

public CredentialPrerequisitesResponse getCloudbreakPrerequisites(String cloudPlatform, boolean govCloud, String deploymentAddress, CredentialType type) {
    CloudContext cloudContext = CloudContext.Builder.builder().withPlatform(cloudPlatform).withGovCloud(govCloud).withWorkspaceId(TEMP_WORKSPACE_ID).build();
    CredentialPrerequisitesRequest request = new CredentialPrerequisitesRequest(cloudContext, userPreferencesService.getExternalIdForCurrentUser(), userPreferencesService.getAuditExternalIdForCurrentUser(), deploymentAddress, type);
    LOGGER.debug("Triggering event: {}", request);
    eventBus.notify(request.selector(), eventFactory.createEvent(request));
    String message = String.format("Failed to get prerequisites for platform '%s': ", cloudPlatform);
    try {
        CredentialPrerequisitesResult res = request.await();
        LOGGER.debug("Result: {}", res);
        if (res.getStatus() != EventStatus.OK) {
            LOGGER.info(message, res.getErrorDetails());
            throw new BadRequestException(message + res.getErrorDetails(), res.getErrorDetails());
        }
        return res.getCredentialPrerequisitesResponse();
    } catch (InterruptedException e) {
        LOGGER.error(message, e);
        throw new OperationException(e);
    }
}
Also used : CredentialPrerequisitesRequest(com.sequenceiq.cloudbreak.cloud.event.credential.CredentialPrerequisitesRequest) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) BadRequestException(javax.ws.rs.BadRequestException) CredentialPrerequisitesResult(com.sequenceiq.cloudbreak.cloud.event.credential.CredentialPrerequisitesResult) CredentialOperationException(com.sequenceiq.environment.credential.exception.CredentialOperationException) OperationException(com.sequenceiq.cloudbreak.service.OperationException)

Example 12 with OperationException

use of com.sequenceiq.cloudbreak.service.OperationException in project cloudbreak by hortonworks.

the class ResourceDefinitionService method getResourceDefinition.

@Cacheable("resourceDefinitionCache")
public String getResourceDefinition(String cloudPlatform, String resource) {
    LOGGER.debug("Sending request for {} {} resource property definition", cloudPlatform, resource);
    CloudPlatformVariant platformVariant = new CloudPlatformVariant(Platform.platform(cloudPlatform), Variant.EMPTY);
    ResourceDefinitionRequest request = requestProvider.getResourceDefinitionRequest(platformVariant, resource);
    eventBus.notify(request.selector(), eventFactory.createEvent(request));
    try {
        ResourceDefinitionResult result = request.await();
        LOGGER.debug("Resource property definition: {}", result);
        return result.getDefinition();
    } catch (InterruptedException e) {
        LOGGER.info("Error while sending resource definition request", e);
        throw new OperationException(e);
    }
}
Also used : CloudPlatformVariant(com.sequenceiq.cloudbreak.cloud.model.CloudPlatformVariant) ResourceDefinitionResult(com.sequenceiq.cloudbreak.cloud.event.platform.ResourceDefinitionResult) ResourceDefinitionRequest(com.sequenceiq.cloudbreak.cloud.event.platform.ResourceDefinitionRequest) OperationException(com.sequenceiq.cloudbreak.service.OperationException) Cacheable(org.springframework.cache.annotation.Cacheable)

Example 13 with OperationException

use of com.sequenceiq.cloudbreak.service.OperationException in project cloudbreak by hortonworks.

the class FreeIpaUpscaleActions method validateInstancesAction.

@Bean(name = "UPSCALE_VALIDATE_INSTANCES_STATE")
public Action<?, ?> validateInstancesAction() {
    return new AbstractUpscaleAction<>(UpscaleStackResult.class) {

        @Override
        protected void doExecute(StackContext context, UpscaleStackResult payload, Map<Object, Object> variables) {
            Stack stack = context.getStack();
            stackUpdater.updateStackStatus(stack.getId(), getInProgressStatus(variables), "Validating new instances");
            try {
                finishAddInstances(context, payload);
                sendEvent(context, UPSCALE_VALIDATE_INSTANCES_FINISHED_EVENT.selector(), new StackEvent(stack.getId()));
            } catch (Exception e) {
                LOGGER.error("Failed to validate the instances", e);
                sendEvent(context, UPSCALE_VALIDATE_INSTANCES_FAILED_EVENT.selector(), new UpscaleFailureEvent(stack.getId(), "Validating new instances", Set.of(), Map.of(), e));
            }
        }

        private void finishAddInstances(StackContext context, UpscaleStackResult payload) {
            LOGGER.debug("Upscale stack result: {}", payload);
            List<CloudResourceStatus> results = payload.getResults();
            validateResourceResults(context, payload.getErrorDetails(), results);
            Set<Resource> resourceSet = transformResults(results, context.getStack());
            if (resourceSet.isEmpty()) {
                metadataSetupService.cleanupRequestedInstances(context.getStack());
                throw new OperationException("Failed to upscale the cluster since all create request failed. Resource set is empty");
            }
            LOGGER.debug("Adding new instances to the stack is DONE");
        }

        private void validateResourceResults(StackContext context, Exception exception, List<CloudResourceStatus> results) {
            if (exception != null) {
                LOGGER.info(format("Failed to upscale stack: %s", context.getCloudContext()), exception);
                throw new OperationException(exception);
            }
            List<CloudResourceStatus> missingResources = results.stream().filter(result -> CommonResourceType.TEMPLATE == result.getCloudResource().getType().getCommonResourceType()).filter(status -> status.isFailed() || status.isDeleted()).collect(Collectors.toList());
            if (!missingResources.isEmpty()) {
                StringBuilder message = new StringBuilder("Failed to upscale the stack for ").append(context.getCloudContext()).append(" due to: ");
                missingResources.forEach(res -> message.append("[privateId: ").append(res.getPrivateId()).append(", statusReason: ").append(res.getStatusReason()).append("] "));
                LOGGER.warn(message.toString());
                throw new OperationException(message.toString());
            }
        }

        private Set<Resource> transformResults(Iterable<CloudResourceStatus> cloudResourceStatuses, Stack stack) {
            Set<Resource> retSet = new HashSet<>();
            for (CloudResourceStatus cloudResourceStatus : cloudResourceStatuses) {
                if (!cloudResourceStatus.isFailed()) {
                    CloudResource cloudResource = cloudResourceStatus.getCloudResource();
                    Resource resource = new Resource(cloudResource.getType(), cloudResource.getName(), cloudResource.getReference(), cloudResource.getStatus(), stack, null, cloudResource.getAvailabilityZone());
                    retSet.add(resource);
                }
            }
            return retSet;
        }
    };
}
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) Resource(com.sequenceiq.freeipa.entity.Resource) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) ClientErrorException(javax.ws.rs.ClientErrorException) OperationException(com.sequenceiq.cloudbreak.service.OperationException) Stack(com.sequenceiq.freeipa.entity.Stack) CloudStack(com.sequenceiq.cloudbreak.cloud.model.CloudStack) 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) UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent) ArrayList(java.util.ArrayList) List(java.util.List) CloudResource(com.sequenceiq.cloudbreak.cloud.model.CloudResource) Map(java.util.Map) OperationException(com.sequenceiq.cloudbreak.service.OperationException) HashSet(java.util.HashSet) Bean(org.springframework.context.annotation.Bean)

Example 14 with OperationException

use of com.sequenceiq.cloudbreak.service.OperationException in project cloudbreak by hortonworks.

the class UpgradeCcmOnDatalakeHandler method accept.

@Override
public void accept(Event<EnvironmentDto> environmentDtoEvent) {
    LOGGER.debug("In UpgradeCcmOnDatalakeHandler.accept");
    EnvironmentDto environmentDto = environmentDtoEvent.getData();
    try {
        LOGGER.debug("Calling Upgrade CCM endpoint on data lake service");
        SdxCcmUpgradeResponse ccmUpgradeResponse = sdxService.upgradeCcm(environmentDto.getResourceCrn());
        switch(ccmUpgradeResponse.getResponseType()) {
            case ERROR:
                String message = String.format("Upgrade CCM returned with reason: %s", ccmUpgradeResponse.getReason());
                LOGGER.warn(message);
                sendFailedEvent(environmentDtoEvent, environmentDto, new OperationException(message));
                return;
            case TRIGGERED:
                LOGGER.debug("Waiting for data lake Upgrade CCM flow to finish.");
                pollerService.waitForUpgradeCcm(environmentDto.getId(), ccmUpgradeResponse.getResourceCrn());
                break;
            case SKIP:
                LOGGER.debug("Upgrade CCM is skipped due to {}", ccmUpgradeResponse.getReason());
                break;
            default:
                message = String.format("Unknown response type: %s", ccmUpgradeResponse.getResponseType());
                LOGGER.warn(message);
                sendFailedEvent(environmentDtoEvent, environmentDto, new OperationException(message));
                return;
        }
        UpgradeCcmEvent upgradeCcmEvent = UpgradeCcmEvent.builder().withSelector(UpgradeCcmStateSelectors.UPGRADE_CCM_DATAHUB_EVENT.selector()).withResourceCrn(environmentDto.getResourceCrn()).withResourceId(environmentDto.getId()).withResourceName(environmentDto.getName()).build();
        eventSender().sendEvent(upgradeCcmEvent, environmentDtoEvent.getHeaders());
        LOGGER.debug("UPGRADE_CCM_DATAHUB_EVENT event sent");
    } catch (Exception e) {
        sendFailedEvent(environmentDtoEvent, environmentDto, e);
    }
}
Also used : SdxCcmUpgradeResponse(com.sequenceiq.sdx.api.model.SdxCcmUpgradeResponse) UpgradeCcmEvent(com.sequenceiq.environment.environment.flow.upgrade.ccm.event.UpgradeCcmEvent) EnvironmentDto(com.sequenceiq.environment.environment.dto.EnvironmentDto) OperationException(com.sequenceiq.cloudbreak.service.OperationException) OperationException(com.sequenceiq.cloudbreak.service.OperationException)

Example 15 with OperationException

use of com.sequenceiq.cloudbreak.service.OperationException in project cloudbreak by hortonworks.

the class ServiceProviderCredentialAdapter method verify.

public CredentialVerification verify(Credential credential, String accountId, boolean creationVerification) {
    boolean changed = false;
    credential = credentialPrerequisiteService.decorateCredential(credential);
    CloudContext cloudContext = CloudContext.Builder.builder().withId(credential.getId()).withName(credential.getName()).withCrn(credential.getResourceCrn()).withPlatform(credential.getCloudPlatform()).withVariant(credential.getCloudPlatform()).withAccountId(accountId).build();
    CloudCredential cloudCredential = credentialConverter.convert(credential);
    CredentialVerificationRequest request = requestProvider.getCredentialVerificationRequest(cloudContext, cloudCredential, creationVerification);
    LOGGER.debug("Triggering event: {}", request);
    eventBus.notify(request.selector(), eventFactory.createEvent(request));
    try {
        CredentialVerificationResult res = request.await();
        String message = FAILED_CREDETIAL_VERIFICATION_MESSAGE;
        LOGGER.debug("Result: {}", res);
        if (res.getStatus() != EventStatus.OK) {
            LOGGER.info(message, res.getErrorDetails());
            throw new CredentialVerificationException(message + res.getErrorDetails(), res.getErrorDetails());
        }
        CloudCredentialStatus cloudCredentialStatus = res.getCloudCredentialStatus();
        if (CredentialStatus.FAILED.equals(cloudCredentialStatus.getStatus())) {
            return new CredentialVerification(credential, setNewStatusText(credential, cloudCredentialStatus));
        }
        changed = setNewStatusText(credential, cloudCredentialStatus);
        CloudCredential cloudCredentialResponse = cloudCredentialStatus.getCloudCredential();
        if (cloudCredentialStatus.isDefaultRegionChanged()) {
            changed = mergeCloudProviderParameters(credential, cloudCredentialResponse, Collections.singleton(SMART_SENSE_ID));
        }
        changed = changed || mergeCloudProviderParameters(credential, cloudCredentialResponse, Collections.singleton(SMART_SENSE_ID));
    } catch (InterruptedException e) {
        LOGGER.error("Error while executing credential verification", e);
        throw new OperationException(e);
    }
    return new CredentialVerification(credential, changed);
}
Also used : CredentialVerificationRequest(com.sequenceiq.cloudbreak.cloud.event.credential.CredentialVerificationRequest) CredentialVerificationResult(com.sequenceiq.cloudbreak.cloud.event.credential.CredentialVerificationResult) ExtendedCloudCredential(com.sequenceiq.cloudbreak.cloud.model.ExtendedCloudCredential) CloudCredential(com.sequenceiq.cloudbreak.cloud.model.CloudCredential) CloudContext(com.sequenceiq.cloudbreak.cloud.context.CloudContext) CredentialVerification(com.sequenceiq.environment.credential.verification.CredentialVerification) CredentialVerificationException(com.sequenceiq.environment.credential.exception.CredentialVerificationException) OperationException(com.sequenceiq.cloudbreak.service.OperationException) CloudCredentialStatus(com.sequenceiq.cloudbreak.cloud.model.CloudCredentialStatus)

Aggregations

OperationException (com.sequenceiq.cloudbreak.service.OperationException)47 Retryable (org.springframework.retry.annotation.Retryable)19 CloudContext (com.sequenceiq.cloudbreak.cloud.context.CloudContext)16 CloudCredential (com.sequenceiq.cloudbreak.cloud.model.CloudCredential)11 Location (com.sequenceiq.cloudbreak.cloud.model.Location)6 GetPlatformTemplateResult (com.sequenceiq.cloudbreak.cloud.event.platform.GetPlatformTemplateResult)5 Credential (com.sequenceiq.cloudbreak.dto.credential.Credential)5 BadRequestException (javax.ws.rs.BadRequestException)5 PlatformParameterRequest (com.sequenceiq.cloudbreak.cloud.event.platform.PlatformParameterRequest)4 PlatformParameterResult (com.sequenceiq.cloudbreak.cloud.event.platform.PlatformParameterResult)4 CloudInstance (com.sequenceiq.cloudbreak.cloud.model.CloudInstance)4 Stack (com.sequenceiq.cloudbreak.domain.stack.Stack)4 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)3 RegionAwareInternalCrnGeneratorFactory (com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGeneratorFactory)3 EventStatus (com.sequenceiq.cloudbreak.cloud.event.model.EventStatus)3 CloudResource (com.sequenceiq.cloudbreak.cloud.model.CloudResource)3 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)3 ExtendedCloudCredential (com.sequenceiq.cloudbreak.cloud.model.ExtendedCloudCredential)3 List (java.util.List)3 Collectors (java.util.stream.Collectors)3