Search in sources :

Example 1 with DiagnosticParametersBuilder

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

the class DiagnosticsDataToParameterConverter method convert.

public DiagnosticParameters convert(BaseDiagnosticsCollectionRequest request, Telemetry telemetry, String clusterType, String clusterVersion, String accountId, String region, String databusEndpoint) {
    Logging logging = telemetry.getLogging();
    DiagnosticParametersBuilder builder = DiagnosticParameters.builder().withCloudStorageDiagnosticsParameters(diagnosticCloudStorageConverter.loggingToCloudStorageDiagnosticsParameters(logging, region)).withDestination(request.getDestination()).withDescription(request.getDescription()).withClusterType(clusterType).withClusterVersion(clusterVersion).withAccountId(accountId).withIssue(request.getIssue()).withLabels(request.getLabels()).withStartTime(request.getStartTime()).withEndTime(request.getEndTime()).withHostGroups(Optional.ofNullable(request.getHostGroups()).orElse(new HashSet<>())).withHosts(Optional.ofNullable(request.getHosts()).orElse(new HashSet<>())).withExcludeHosts(Optional.ofNullable(request.getExcludeHosts()).orElse(new HashSet<>())).withIncludeSaltLogs(request.getIncludeSaltLogs()).withIncludeSarOutput(request.getIncludeSarOutput()).withIncludeNginxReport(request.getIncludeNginxReport()).withUpdatePackage(request.getUpdatePackage()).withSkipValidation(request.getSkipValidation()).withSkipWorkspaceCleanupOnStartup(request.getSkipWorkspaceCleanupOnStartup()).withSkipUnresponsiveHosts(request.getSkipUnresponsiveHosts()).withAdditionalLogs(request.getAdditionalLogs());
    if (supportBundleConfiguration.isEnabled()) {
        builder.withDbusUrl(databusEndpoint).withDbusS3Url(dataBusEndpointProvider.getDatabusS3Endpoint(databusEndpoint)).withSupportBundleDbusStreamName(supportBundleConfiguration.getDbusStreamName()).withSupportBundleDbusAppName(supportBundleConfiguration.getDbusAppName());
    }
    return builder.build();
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) DiagnosticParametersBuilder(com.sequenceiq.common.model.diagnostics.DiagnosticParameters.DiagnosticParametersBuilder) HashSet(java.util.HashSet)

Aggregations

Logging (com.sequenceiq.common.api.telemetry.model.Logging)1 DiagnosticParametersBuilder (com.sequenceiq.common.model.diagnostics.DiagnosticParameters.DiagnosticParametersBuilder)1 HashSet (java.util.HashSet)1