Search in sources :

Example 26 with GcsCloudStorageV1Parameters

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

the class TelemetryConverterTest method testConvertToResponseForGcs.

@Test
public void testConvertToResponseForGcs() {
    Logging logging = new Logging();
    GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = new GcsCloudStorageV1Parameters();
    gcsCloudStorageV1Parameters.setServiceAccountEmail(EMAIL);
    logging.setGcs(gcsCloudStorageV1Parameters);
    Telemetry telemetry = new Telemetry();
    telemetry.setLogging(logging);
    // WHEN
    TelemetryResponse result = underTest.convert(telemetry);
    // THEN
    assertThat(result.getLogging().getGcs(), notNullValue());
    assertThat(result.getLogging().getGcs().getServiceAccountEmail(), is(EMAIL));
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) TelemetryResponse(com.sequenceiq.common.api.telemetry.response.TelemetryResponse) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters) Test(org.junit.jupiter.api.Test)

Example 27 with GcsCloudStorageV1Parameters

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

the class TelemetryConverter method createLoggingFromRequest.

private Logging createLoggingFromRequest(LoggingRequest loggingRequest) {
    Logging logging = null;
    if (loggingRequest != null) {
        logging = new Logging();
        logging.setStorageLocation(loggingRequest.getStorageLocation());
        if (loggingRequest.getS3() != null) {
            S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
            s3Params.setInstanceProfile(loggingRequest.getS3().getInstanceProfile());
            logging.setS3(s3Params);
        } else if (loggingRequest.getAdlsGen2() != null) {
            AdlsGen2CloudStorageV1Parameters adlsGen2Params = new AdlsGen2CloudStorageV1Parameters();
            AdlsGen2CloudStorageV1Parameters adlsGen2FromRequest = loggingRequest.getAdlsGen2();
            adlsGen2Params.setAccountKey(adlsGen2FromRequest.getAccountKey());
            adlsGen2Params.setAccountName(adlsGen2FromRequest.getAccountName());
            adlsGen2Params.setSecure(adlsGen2FromRequest.isSecure());
            adlsGen2Params.setManagedIdentity(adlsGen2FromRequest.getManagedIdentity());
            logging.setAdlsGen2(adlsGen2Params);
        } else if (loggingRequest.getGcs() != null) {
            GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = new GcsCloudStorageV1Parameters();
            gcsCloudStorageV1Parameters.setServiceAccountEmail(loggingRequest.getGcs().getServiceAccountEmail());
            logging.setGcs(gcsCloudStorageV1Parameters);
        } else if (loggingRequest.getCloudwatch() != null) {
            logging.setCloudwatch(CloudwatchParams.copy(loggingRequest.getCloudwatch()));
        }
    }
    return logging;
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)

Example 28 with GcsCloudStorageV1Parameters

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

the class TelemetryConverter method createLoggingResponseFromSource.

private LoggingResponse createLoggingResponseFromSource(Logging logging) {
    LoggingResponse loggingResponse = null;
    if (logging != null) {
        loggingResponse = new LoggingResponse();
        loggingResponse.setStorageLocation(logging.getStorageLocation());
        if (logging.getS3() != null) {
            S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
            s3Params.setInstanceProfile(logging.getS3().getInstanceProfile());
            loggingResponse.setS3(s3Params);
        } else if (logging.getAdlsGen2() != null) {
            AdlsGen2CloudStorageV1Parameters adlsGen2Params = new AdlsGen2CloudStorageV1Parameters();
            adlsGen2Params.setAccountKey(logging.getAdlsGen2().getAccountKey());
            adlsGen2Params.setAccountName(logging.getAdlsGen2().getAccountName());
            adlsGen2Params.setSecure(logging.getAdlsGen2().isSecure());
            adlsGen2Params.setManagedIdentity(logging.getAdlsGen2().getManagedIdentity());
            loggingResponse.setAdlsGen2(adlsGen2Params);
        } else if (logging.getGcs() != null) {
            GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = new GcsCloudStorageV1Parameters();
            gcsCloudStorageV1Parameters.setServiceAccountEmail(logging.getGcs().getServiceAccountEmail());
            loggingResponse.setGcs(gcsCloudStorageV1Parameters);
        } else if (logging.getCloudwatch() != null) {
            loggingResponse.setCloudwatch(CloudwatchParams.copy(logging.getCloudwatch()));
        }
    }
    return loggingResponse;
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) LoggingResponse(com.sequenceiq.common.api.telemetry.response.LoggingResponse) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)

Example 29 with GcsCloudStorageV1Parameters

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

the class GcpCloudProvider method gcsCloudStorageParameters.

public GcsCloudStorageV1Parameters gcsCloudStorageParameters() {
    GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = new GcsCloudStorageV1Parameters();
    gcsCloudStorageV1Parameters.setServiceAccountEmail(gcpProperties.getCloudStorage().getGcs().getServiceAccountEmail());
    return gcsCloudStorageV1Parameters;
}
Also used : GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)

Example 30 with GcsCloudStorageV1Parameters

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

the class BackupConverter method decorateBackupFromBackupRequest.

private void decorateBackupFromBackupRequest(Backup backup, BackupRequest backupRequest) {
    if (backup != null && backupRequest != null) {
        backup.setStorageLocation(backupRequest.getStorageLocation());
        if (backupRequest.getS3() != null) {
            S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
            s3Params.setInstanceProfile(backupRequest.getS3().getInstanceProfile());
            backup.setS3(s3Params);
        } else if (backupRequest.getAdlsGen2() != null) {
            AdlsGen2CloudStorageV1Parameters adlsGen2Params = new AdlsGen2CloudStorageV1Parameters();
            AdlsGen2CloudStorageV1Parameters adlsGen2FromRequest = backupRequest.getAdlsGen2();
            adlsGen2Params.setAccountKey(adlsGen2FromRequest.getAccountKey());
            adlsGen2Params.setAccountName(adlsGen2FromRequest.getAccountName());
            adlsGen2Params.setSecure(adlsGen2FromRequest.isSecure());
            adlsGen2Params.setManagedIdentity(adlsGen2FromRequest.getManagedIdentity());
            backup.setAdlsGen2(adlsGen2Params);
        } else if (backupRequest.getGcs() != null) {
            GcsCloudStorageV1Parameters gcsParams = new GcsCloudStorageV1Parameters();
            GcsCloudStorageV1Parameters gcsFromRequest = backupRequest.getGcs();
            gcsParams.setServiceAccountEmail(gcsFromRequest.getServiceAccountEmail());
            backup.setGcs(gcsParams);
        }
    }
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)

Aggregations

GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)31 Test (org.junit.jupiter.api.Test)12 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)10 Logging (com.sequenceiq.common.api.telemetry.model.Logging)7 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)7 Test (org.junit.Test)7 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)6 SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)4 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)3 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)3 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)3 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)3 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)3 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)3 Backup (com.sequenceiq.freeipa.api.model.Backup)3 FileSystemV4Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.FileSystemV4Endpoint)2 FileSystemParameterV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Response)2 FileSystemParameterV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses)2 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)2 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)2