use of com.sequenceiq.cloudbreak.core.flow2.cmdiagnostics.event.CmDiagnosticsCollectionEvent in project cloudbreak by hortonworks.
the class DiagnosticsService method startCmDiagnostics.
public FlowIdentifier startCmDiagnostics(BaseCmDiagnosticsCollectionRequest request, String stackCrn, String userCrn) {
Stack stack = stackService.getByCrn(stackCrn);
MDCBuilder.buildMdcContext(stack);
LOGGER.debug("Starting CM based diagnostics collection for Stack. Crn: '{}'", stack.getResourceCrn());
Telemetry telemetry = componentConfigProviderService.getTelemetry(stack.getId());
diagnosticsCollectionValidator.validate(request, stack, telemetry);
CmDiagnosticsParameters parameters = cmDiagnosticsDataToParameterConverter.convert(request, telemetry, stack.getName(), stack.getRegion());
CmDiagnosticsCollectionEvent diagnosticsCollectionEvent = CmDiagnosticsCollectionEvent.builder().withAccepted(new Promise<>()).withResourceId(stack.getId()).withResourceCrn(stack.getResourceCrn()).withSelector(CmDiagnosticsCollectionStateSelectors.START_CM_DIAGNOSTICS_INIT_EVENT.selector()).withParameters(parameters).build();
return reactorNotifier.notify(diagnosticsCollectionEvent, getFlowHeaders(userCrn));
}
Aggregations