Search in sources :

Example 1 with S3Config

use of com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3Config in project cloudbreak by hortonworks.

the class CmDiagnosticsDataToParameterConverter method convert.

public CmDiagnosticsParameters convert(BaseCmDiagnosticsCollectionRequest request, Telemetry telemetry, String clusterName, String region) {
    Logging logging = telemetry.getLogging();
    CmDiagnosticsParameters.CmDiagnosticsParametersBuilder builder = CmDiagnosticsParameters.builder();
    if (logging.getS3() != null) {
        S3Config s3Config = s3ConfigGenerator.generateStorageConfig(logging.getStorageLocation());
        builder.withS3Bucket(s3Config.getBucket());
        builder.withS3Location(Paths.get(s3Config.getFolderPrefix(), DIAGNOSTICS_SUFFIX_PATH).toString());
        builder.withS3Region(region);
    } else if (logging.getAdlsGen2() != null) {
        AdlsGen2Config adlsGen2Config = adlsGen2ConfigGenerator.generateStorageConfig(logging.getStorageLocation());
        builder.withAdlsv2StorageAccount(adlsGen2Config.getAccount());
        builder.withAdlsv2StorageContainer(adlsGen2Config.getFileSystem());
        builder.withAdlsv2StorageLocation(Paths.get(adlsGen2Config.getFolderPrefix(), DIAGNOSTICS_SUFFIX_PATH).toString());
    } else if (logging.getGcs() != null) {
        GcsConfig gcsConfig = gcsConfigGenerator.generateStorageConfig(logging.getStorageLocation());
        builder.withGcsBucket(gcsConfig.getBucket());
        builder.withGcsLocation(Paths.get(gcsConfig.getFolderPrefix(), DIAGNOSTICS_SUFFIX_PATH).toString());
    }
    builder.withComments(request.getComments()).withDestination(request.getDestination()).withClusterName(clusterName).withStartTime(request.getStartTime()).withEndTime(request.getEndTime()).withTicketNumber(request.getTicket()).withRoles(request.getRoles()).withBundleSizeBytes(request.getBundleSizeBytes()).withEnableMonitorMetricsCollection(request.getEnableMonitorMetricsCollection()).withUpdatePackage(request.getUpdatePackage()).withSkipValidation(request.getSkipValidation());
    return builder.build();
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) S3Config(com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3Config) AdlsGen2Config(com.sequenceiq.cloudbreak.telemetry.fluent.cloud.AdlsGen2Config) GcsConfig(com.sequenceiq.cloudbreak.telemetry.fluent.cloud.GcsConfig) CmDiagnosticsParameters(com.sequenceiq.common.model.diagnostics.CmDiagnosticsParameters)

Example 2 with S3Config

use of com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3Config in project cloudbreak by hortonworks.

the class DiagnosticCloudStorageConverter method loggingToS3.

public AwsDiagnosticParameters loggingToS3(Logging logging, String region) {
    AwsDiagnosticParameters.AwsDiagnosticParametersBuilder awsBuilder = AwsDiagnosticParameters.builder();
    S3Config s3Config = s3ConfigGenerator.generateStorageConfig(logging.getStorageLocation());
    return awsBuilder.withS3Bucket(s3Config.getBucket()).withS3Location(Paths.get(s3Config.getFolderPrefix(), DIAGNOSTICS_SUFFIX_PATH).toString()).withS3Region(region).build();
}
Also used : AwsDiagnosticParameters(com.sequenceiq.common.model.diagnostics.AwsDiagnosticParameters) S3Config(com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3Config)

Example 3 with S3Config

use of com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3Config in project cloudbreak by hortonworks.

the class FluentConfigService method fillS3Configs.

private void fillS3Configs(FluentConfigView.Builder builder, String storageLocation) {
    S3Config s3Config = s3ConfigGenerator.generateStorageConfig(storageLocation);
    builder.withProviderPrefix(S3_PROVIDER_PREFIX).withS3LogArchiveBucketName(s3Config.getBucket()).withLogFolderName(s3Config.getFolderPrefix());
}
Also used : S3Config(com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3Config)

Example 4 with S3Config

use of com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3Config in project cloudbreak by hortonworks.

the class DiagnosticCloudStorageConverter method loggingResponseToS3.

public AwsDiagnosticParameters loggingResponseToS3(LoggingResponse logging, String region) {
    AwsDiagnosticParameters.AwsDiagnosticParametersBuilder awsBuilder = AwsDiagnosticParameters.builder();
    S3Config s3Config = s3ConfigGenerator.generateStorageConfig(logging.getStorageLocation());
    return awsBuilder.withS3Bucket(s3Config.getBucket()).withS3Location(Paths.get(s3Config.getFolderPrefix(), DIAGNOSTICS_SUFFIX_PATH).toString()).withS3Region(region).build();
}
Also used : AwsDiagnosticParameters(com.sequenceiq.common.model.diagnostics.AwsDiagnosticParameters) S3Config(com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3Config)

Aggregations

S3Config (com.sequenceiq.cloudbreak.telemetry.fluent.cloud.S3Config)4 AwsDiagnosticParameters (com.sequenceiq.common.model.diagnostics.AwsDiagnosticParameters)2 AdlsGen2Config (com.sequenceiq.cloudbreak.telemetry.fluent.cloud.AdlsGen2Config)1 GcsConfig (com.sequenceiq.cloudbreak.telemetry.fluent.cloud.GcsConfig)1 Logging (com.sequenceiq.common.api.telemetry.model.Logging)1 CmDiagnosticsParameters (com.sequenceiq.common.model.diagnostics.CmDiagnosticsParameters)1