Search in sources :

Example 1 with DiagnosticParameters

use of com.sequenceiq.common.model.diagnostics.DiagnosticParameters in project cloudbreak by hortonworks.

the class CloudStorageValidationService method executeValidation.

private void executeValidation(Stack stack, List<GatewayConfig> allGateways, Set<Node> allNodes, DetailedEnvironmentResponse environment, ExitCriteriaModel exitCriteriaModel, Set<String> targetHostNames) throws CloudbreakOrchestratorException {
    CloudStorageDiagnosticsParameters cloudStorageParameters = diagnosticCloudStorageConverter.loggingResponseToCloudStorageDiagnosticsParameters(environment.getTelemetry().getLogging(), stack.getRegion());
    DiagnosticParameters parameters = new DiagnosticParameters();
    parameters.setRoot(DiagnosticParameters.TELEMETRY_ROOT);
    parameters.setCloudStorageDiagnosticsParameters(cloudStorageParameters);
    telemetryOrchestrator.validateCloudStorage(allGateways, allNodes, targetHostNames, parameters.toMap(), exitCriteriaModel);
}
Also used : CloudStorageDiagnosticsParameters(com.sequenceiq.common.model.diagnostics.CloudStorageDiagnosticsParameters) DiagnosticParameters(com.sequenceiq.common.model.diagnostics.DiagnosticParameters)

Example 2 with DiagnosticParameters

use of com.sequenceiq.common.model.diagnostics.DiagnosticParameters in project cloudbreak by hortonworks.

the class DiagnosticsCollectionActions method failedAction.

@Bean(name = "DIAGNOSTICS_COLLECTION_FAILED_STATE")
public Action<?, ?> failedAction() {
    return new AbstractDiagnosticsCollectionActions<>(DiagnosticsCollectionFailureEvent.class) {

        @Override
        protected void doExecute(CommonContext context, DiagnosticsCollectionFailureEvent payload, Map<Object, Object> variables) {
            Long resourceId = payload.getResourceId();
            String resourceCrn = payload.getResourceCrn();
            LOGGER.debug("Flow entered into DIAGNOSTICS_COLLECTION_FAILED_STATE. resourceCrn: '{}'", resourceCrn);
            cloudbreakEventService.fireCloudbreakEvent(resourceId, UPDATE_FAILED.name(), ResourceEvent.STACK_DIAGNOSTICS_COLLECTION_FAILED, List.of(payload.getException().getMessage()));
            InMemoryStateStore.deleteStack(resourceId);
            DiagnosticParameters parameters = payload.getParameters();
            if (payload.getException() != null) {
                parameters.setStatusReason(payload.getException().getMessage());
            }
            DiagnosticsCollectionEvent event = DiagnosticsCollectionEvent.builder().withResourceId(resourceId).withResourceCrn(payload.getResourceCrn()).withSelector(DiagnosticsCollectionStateSelectors.HANDLED_FAILED_DIAGNOSTICS_COLLECTION_EVENT.selector()).withParameters(payload.getParameters()).withHosts(payload.getHosts()).withHostGroups(payload.getHostGroups()).withExcludeHosts(payload.getExcludeHosts()).build();
            diagnosticsOperationsService.vmDiagnosticsReport(resourceCrn, payload.getParameters(), UsageProto.CDPVMDiagnosticsFailureType.Value.valueOf(payload.getFailureType()), payload.getException());
            sendEvent(context, event);
        }
    };
}
Also used : DiagnosticsCollectionFailureEvent(com.sequenceiq.cloudbreak.core.flow2.diagnostics.event.DiagnosticsCollectionFailureEvent) CommonContext(com.sequenceiq.flow.core.CommonContext) AwsDiagnosticParameters(com.sequenceiq.common.model.diagnostics.AwsDiagnosticParameters) DiagnosticParameters(com.sequenceiq.common.model.diagnostics.DiagnosticParameters) AzureDiagnosticParameters(com.sequenceiq.common.model.diagnostics.AzureDiagnosticParameters) Map(java.util.Map) DiagnosticsCollectionEvent(com.sequenceiq.cloudbreak.core.flow2.diagnostics.event.DiagnosticsCollectionEvent) Bean(org.springframework.context.annotation.Bean)

Example 3 with DiagnosticParameters

use of com.sequenceiq.common.model.diagnostics.DiagnosticParameters in project cloudbreak by hortonworks.

the class DiagnosticsPreFlightCheckHandler method executeOperation.

@Override
public Selectable executeOperation(HandlerEvent<DiagnosticsCollectionEvent> event) throws Exception {
    DiagnosticsCollectionEvent data = event.getData();
    Long resourceId = data.getResourceId();
    String resourceCrn = data.getResourceCrn();
    DiagnosticParameters parameters = data.getParameters();
    diagnosticsFlowService.nodeStatusNetworkReport(resourceId);
    return DiagnosticsCollectionEvent.builder().withResourceCrn(resourceCrn).withResourceId(resourceId).withSelector(START_DIAGNOSTICS_INIT_EVENT.selector()).withParameters(parameters).withHosts(parameters.getHosts()).withHostGroups(parameters.getHostGroups()).withExcludeHosts(parameters.getExcludeHosts()).build();
}
Also used : DiagnosticParameters(com.sequenceiq.common.model.diagnostics.DiagnosticParameters) DiagnosticsCollectionEvent(com.sequenceiq.cloudbreak.core.flow2.diagnostics.event.DiagnosticsCollectionEvent)

Example 4 with DiagnosticParameters

use of com.sequenceiq.common.model.diagnostics.DiagnosticParameters in project cloudbreak by hortonworks.

the class DiagnosticsSaltStateUpdateHandler method executeOperation.

@Override
public Selectable executeOperation(HandlerEvent<DiagnosticsCollectionEvent> event) throws Exception {
    DiagnosticsCollectionEvent data = event.getData();
    Long resourceId = data.getResourceId();
    String resourceCrn = data.getResourceCrn();
    DiagnosticParameters parameters = data.getParameters();
    telemetryUpgradeService.upgradeTelemetrySaltStates(resourceId, Set.of(TelemetryComponentType.CDP_TELEMETRY));
    return DiagnosticsCollectionEvent.builder().withResourceCrn(resourceCrn).withResourceId(resourceId).withSelector(START_DIAGNOSTICS_PREFLIGHT_CHECK_EVENT.selector()).withParameters(parameters).build();
}
Also used : DiagnosticParameters(com.sequenceiq.common.model.diagnostics.DiagnosticParameters) DiagnosticsCollectionEvent(com.sequenceiq.cloudbreak.core.flow2.diagnostics.event.DiagnosticsCollectionEvent)

Example 5 with DiagnosticParameters

use of com.sequenceiq.common.model.diagnostics.DiagnosticParameters in project cloudbreak by hortonworks.

the class DiagnosticsSaltValidationHandler method executeOperation.

@Override
public Selectable executeOperation(HandlerEvent<DiagnosticsCollectionEvent> event) throws Exception {
    DiagnosticsCollectionEvent data = event.getData();
    Long resourceId = data.getResourceId();
    String resourceCrn = data.getResourceCrn();
    DiagnosticParameters parameters = diagnosticsOperationsService.applyUnresponsiveHosts(resourceId, data.getParameters());
    return DiagnosticsCollectionEvent.builder().withResourceCrn(resourceCrn).withResourceId(resourceId).withSelector(START_DIAGNOSTICS_SALT_PILLAR_UPDATE_EVENT.selector()).withParameters(parameters).withHosts(parameters.getHosts()).withHostGroups(parameters.getHostGroups()).withExcludeHosts(parameters.getExcludeHosts()).build();
}
Also used : DiagnosticParameters(com.sequenceiq.common.model.diagnostics.DiagnosticParameters) DiagnosticsCollectionEvent(com.sequenceiq.cloudbreak.core.flow2.diagnostics.event.DiagnosticsCollectionEvent)

Aggregations

DiagnosticParameters (com.sequenceiq.common.model.diagnostics.DiagnosticParameters)97 Test (org.junit.jupiter.api.Test)67 DiagnosticsCollectionEvent (com.sequenceiq.cloudbreak.core.flow2.diagnostics.event.DiagnosticsCollectionEvent)47 DiagnosticsCollectionEvent (com.sequenceiq.freeipa.flow.freeipa.diagnostics.event.DiagnosticsCollectionEvent)46 HandlerEvent (com.sequenceiq.flow.reactor.api.handler.HandlerEvent)45 Selectable (com.sequenceiq.cloudbreak.common.event.Selectable)23 Event (reactor.bus.Event)23 CloudbreakOrchestratorFailedException (com.sequenceiq.cloudbreak.orchestrator.exception.CloudbreakOrchestratorFailedException)19 DiagnosticsFlowException (com.sequenceiq.cloudbreak.core.flow2.diagnostics.DiagnosticsFlowException)11 DiagnosticsFlowException (com.sequenceiq.freeipa.flow.freeipa.diagnostics.DiagnosticsFlowException)10 DataBusCredential (com.sequenceiq.common.api.telemetry.model.DataBusCredential)4 Stack (com.sequenceiq.freeipa.entity.Stack)4 CloudStorageDiagnosticsParameters (com.sequenceiq.common.model.diagnostics.CloudStorageDiagnosticsParameters)3 CommonContext (com.sequenceiq.flow.core.CommonContext)3 Map (java.util.Map)3 Bean (org.springframework.context.annotation.Bean)3 OrchestratorMetadataFilter (com.sequenceiq.cloudbreak.orchestrator.metadata.OrchestratorMetadataFilter)2 AwsDiagnosticParameters (com.sequenceiq.common.model.diagnostics.AwsDiagnosticParameters)2 AzureDiagnosticParameters (com.sequenceiq.common.model.diagnostics.AzureDiagnosticParameters)2 FreeIpaClientException (com.sequenceiq.freeipa.client.FreeIpaClientException)2