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