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);
}
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);
}
};
}
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();
}
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();
}
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();
}
Aggregations