Search in sources :

Example 6 with UpscaleFailureEvent

use of com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent in project cloudbreak by hortonworks.

the class CollectMetadataResultToUpscaleFailureEventConverter method convert.

@Override
public UpscaleFailureEvent convert(Object payload) {
    CollectMetadataResult result = (CollectMetadataResult) payload;
    UpscaleFailureEvent event = new UpscaleFailureEvent(result.getResourceId(), "Collecting metadata", Set.of(), Map.of(), new Exception("Payload failed: " + payload));
    return event;
}
Also used : UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent) CollectMetadataResult(com.sequenceiq.cloudbreak.cloud.event.instance.CollectMetadataResult)

Example 7 with UpscaleFailureEvent

use of com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent in project cloudbreak by hortonworks.

the class HostMetadataSetupFailedToUpscaleFailureEventConverter method convert.

@Override
public UpscaleFailureEvent convert(Object payload) {
    HostMetadataSetupFailed result = (HostMetadataSetupFailed) payload;
    UpscaleFailureEvent event = new UpscaleFailureEvent(result.getResourceId(), "Host metadata setup", Set.of(), Map.of(), new Exception("Payload failed: " + payload));
    return event;
}
Also used : HostMetadataSetupFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.hostmetadatasetup.HostMetadataSetupFailed) UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)

Example 8 with UpscaleFailureEvent

use of com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent in project cloudbreak by hortonworks.

the class InstallFreeIpaServicesFailedToUpscaleFailureEventConverter method convert.

@Override
public UpscaleFailureEvent convert(Object payload) {
    InstallFreeIpaServicesFailed result = (InstallFreeIpaServicesFailed) payload;
    UpscaleFailureEvent event = new UpscaleFailureEvent(result.getResourceId(), "Installing FreeIPA services", Set.of(), Map.of(), new Exception("Payload failed: " + payload));
    return event;
}
Also used : UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent) InstallFreeIpaServicesFailed(com.sequenceiq.freeipa.flow.freeipa.provision.event.services.InstallFreeIpaServicesFailed)

Example 9 with UpscaleFailureEvent

use of com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent in project cloudbreak by hortonworks.

the class UpscaleStackResultToUpscaleFailureEventConverter method convert.

@Override
public UpscaleFailureEvent convert(Object payload) {
    UpscaleStackResult result = (UpscaleStackResult) payload;
    UpscaleFailureEvent event = new UpscaleFailureEvent(result.getResourceId(), "Adding instances", Set.of(), Map.of(), new Exception("Payload failed: " + payload));
    return event;
}
Also used : UpscaleStackResult(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleStackResult) UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)

Example 10 with UpscaleFailureEvent

use of com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent in project cloudbreak by hortonworks.

the class ValidateInstancesHealthHandler method handleUnhealthyInstancesPresent.

private UpscaleFailureEvent handleUnhealthyInstancesPresent(HandlerEvent<ValidateInstancesHealthEvent> event, List<NodeHealthDetails> healthDetails, List<NodeHealthDetails> notHealthyNodes) {
    LOGGER.warn("Non healthy instances found: {}", notHealthyNodes);
    Set<String> healthyInstances = collectHealthyInstanceIds(healthDetails);
    Map<String, String> failureDetails = constructFailureDetails(notHealthyNodes);
    Exception exceptionForFailureEvent = new Exception("Unhealthy instances found: " + failureDetails.keySet());
    return new UpscaleFailureEvent(event.getData().getResourceId(), PHASE, healthyInstances, failureDetails, exceptionForFailureEvent);
}
Also used : UpscaleFailureEvent(com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent) FreeIpaClientException(com.sequenceiq.freeipa.client.FreeIpaClientException)

Aggregations

UpscaleFailureEvent (com.sequenceiq.freeipa.flow.freeipa.upscale.event.UpscaleFailureEvent)16 Stack (com.sequenceiq.freeipa.entity.Stack)7 CloudStack (com.sequenceiq.cloudbreak.cloud.model.CloudStack)5 StackContext (com.sequenceiq.freeipa.flow.stack.StackContext)5 StackEvent (com.sequenceiq.freeipa.flow.stack.StackEvent)5 Map (java.util.Map)5 Bean (org.springframework.context.annotation.Bean)5 OperationException (com.sequenceiq.cloudbreak.service.OperationException)4 InstanceMetaData (com.sequenceiq.freeipa.entity.InstanceMetaData)4 ValidateInstancesHealthEvent (com.sequenceiq.freeipa.flow.freeipa.upscale.event.ValidateInstancesHealthEvent)4 ClientErrorException (javax.ws.rs.ClientErrorException)4 FreeIpaClientException (com.sequenceiq.freeipa.client.FreeIpaClientException)3 CollectMetadataResult (com.sequenceiq.cloudbreak.cloud.event.instance.CollectMetadataResult)2 WebApplicationExceptionMessageExtractor (com.sequenceiq.cloudbreak.common.exception.WebApplicationExceptionMessageExtractor)2 EnvironmentEndpoint (com.sequenceiq.environment.api.v1.environment.endpoint.EnvironmentEndpoint)2 Flow (com.sequenceiq.flow.core.Flow)2 FlowParameters (com.sequenceiq.flow.core.FlowParameters)2 HandlerEvent (com.sequenceiq.flow.reactor.api.handler.HandlerEvent)2 FailureDetails (com.sequenceiq.freeipa.api.v1.freeipa.user.model.FailureDetails)2 SuccessDetails (com.sequenceiq.freeipa.api.v1.freeipa.user.model.SuccessDetails)2