Search in sources :

Example 46 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class S3FileSystemToConverterS3CloudStorageV4Parameters method convert.

public S3CloudStorageV1Parameters convert(S3FileSystem source) {
    S3CloudStorageV1Parameters fileSystemConfigurations = new S3CloudStorageV1Parameters();
    fileSystemConfigurations.setInstanceProfile(source.getInstanceProfile());
    return fileSystemConfigurations;
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)

Example 47 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class FluentConfigServiceTest method testCreateFluentConfig.

@Test
public void testCreateFluentConfig() {
    // GIVEN
    Logging logging = new Logging();
    logging.setStorageLocation("mybucket/cluster-logs/datahub/cl1");
    logging.setS3(new S3CloudStorageV1Parameters());
    Telemetry telemetry = new Telemetry();
    telemetry.setLogging(logging);
    // WHEN
    FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
    // THEN
    assertTrue(result.isEnabled());
    assertTrue(result.isCloudStorageLoggingEnabled());
    assertEquals("cluster-logs/datahub/cl1", result.getLogFolderName());
    assertEquals("mybucket", result.getS3LogArchiveBucketName());
    assertEquals(Crn.Region.EU_1.getName(), result.toMap().get("environmentRegion"));
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 48 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class CloudStorageFolderResolverServiceTest method createTelemetry.

private Telemetry createTelemetry() {
    Telemetry telemetry = new Telemetry();
    Logging logging = new Logging();
    logging.setStorageLocation("s3://mybucket");
    logging.setS3(new S3CloudStorageV1Parameters());
    telemetry.setLogging(logging);
    return telemetry;
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry)

Example 49 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class CloudStorageManifester method addLogIdentity.

private void addLogIdentity(CloudStorageRequest cloudStorageRequest, DetailedEnvironmentResponse environment) {
    if (containsIdentityType(CloudIdentityType.LOG, cloudStorageRequest)) {
        LOGGER.debug("Cloud storage log identity already set. Skip fetching it from environment.");
    } else {
        StorageIdentityBase log = new StorageIdentityBase();
        log.setType(CloudIdentityType.LOG);
        LoggingResponse logging = environment.getTelemetry().getLogging();
        if (logging.getS3() != null) {
            log.setS3(logging.getS3());
        } else if (logging.getAdlsGen2() != null) {
            log.setAdlsGen2(logging.getAdlsGen2());
        } else if (logging.getGcs() != null) {
            log.setGcs(logging.getGcs());
        } else if (logging.getCloudwatch() != null) {
            LOGGER.debug("Cloudwatch will act as s3 storage identity!");
            S3CloudStorageV1Parameters s3CloudwatchParams = new S3CloudStorageV1Parameters();
            s3CloudwatchParams.setInstanceProfile(logging.getCloudwatch().getInstanceProfile());
            log.setS3(s3CloudwatchParams);
        }
        cloudStorageRequest.getIdentities().add(log);
    }
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) LoggingResponse(com.sequenceiq.common.api.telemetry.response.LoggingResponse) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)

Example 50 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class TelemetryApiConverter method convertS3.

private S3CloudStorageV1Parameters convertS3(S3CloudStorageParameters s3) {
    S3CloudStorageV1Parameters s3CloudStorageV1Parameters = null;
    if (s3 != null) {
        s3CloudStorageV1Parameters = new S3CloudStorageV1Parameters();
        s3CloudStorageV1Parameters.setInstanceProfile(s3.getInstanceProfile());
        return s3CloudStorageV1Parameters;
    }
    return s3CloudStorageV1Parameters;
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)

Aggregations

S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)59 Test (org.junit.jupiter.api.Test)27 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)16 Logging (com.sequenceiq.common.api.telemetry.model.Logging)15 LoggingRequest (com.sequenceiq.common.api.telemetry.request.LoggingRequest)12 Test (org.junit.Test)12 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)10 SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)10 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)8 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)8 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)7 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)7 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)7 Backup (com.sequenceiq.freeipa.api.model.Backup)7 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)5 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)5 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)5 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)4 Features (com.sequenceiq.common.api.telemetry.model.Features)4 SdxClusterRequest (com.sequenceiq.sdx.api.model.SdxClusterRequest)4