Search in sources :

Example 36 with AdlsGen2CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters 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 37 with AdlsGen2CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters 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 38 with AdlsGen2CloudStorageV1Parameters

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

the class AzureCloudProvider method adlsGen2CloudStorageParameters.

public AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageParameters() {
    AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2CloudStorageV1Parameters.setSecure(getSecure());
    adlsGen2CloudStorageV1Parameters.setManagedIdentity(getAssumerIdentity());
    return adlsGen2CloudStorageV1Parameters;
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)

Example 39 with AdlsGen2CloudStorageV1Parameters

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

the class AzureCloudProvider method loggingRequest.

@Override
public LoggingRequest loggingRequest(TelemetryTestDto dto) {
    LoggingRequest loggingRequest = new LoggingRequest();
    AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2CloudStorageV1Parameters.setManagedIdentity(getLoggerIdentity());
    adlsGen2CloudStorageV1Parameters.setSecure(getSecure());
    loggingRequest.setAdlsGen2(adlsGen2CloudStorageV1Parameters);
    loggingRequest.setStorageLocation(getBaseLocation());
    return loggingRequest;
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) LoggingRequest(com.sequenceiq.common.api.telemetry.request.LoggingRequest)

Example 40 with AdlsGen2CloudStorageV1Parameters

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

the class AzureAdlsGen2Tests method adlsGen2CloudStorageV4RequestWithoutStorageLocations.

private CloudStorageRequest adlsGen2CloudStorageV4RequestWithoutStorageLocations() {
    CloudStorageRequest request = new CloudStorageRequest();
    AdlsGen2CloudStorageV1Parameters adlsGen2 = new AdlsGen2CloudStorageV1Parameters();
    String accountName = azureProperties.getCloudStorage().getAccountName();
    String accountKey = azureProperties.getCloudStorage().getAccountKey();
    adlsGen2.setAccountKey(accountKey);
    adlsGen2.setAccountName(accountName);
    StorageLocationBase storageLocationBase = new StorageLocationBase();
    storageLocationBase.setType(CloudStorageCdpService.RANGER_AUDIT);
    storageLocationBase.setValue("somePath");
    request.setLocations(List.of(storageLocationBase));
    StorageIdentityBase storageIdentityBase = new StorageIdentityBase();
    storageIdentityBase.setAdlsGen2(adlsGen2);
    request.setIdentities(List.of(storageIdentityBase));
    return request;
}
Also used : CloudStorageRequest(com.sequenceiq.common.api.cloudstorage.CloudStorageRequest) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) StorageLocationBase(com.sequenceiq.common.api.cloudstorage.StorageLocationBase) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)

Aggregations

AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)42 Test (org.junit.Test)15 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)12 Logging (com.sequenceiq.common.api.telemetry.model.Logging)10 Test (org.junit.jupiter.api.Test)9 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)7 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)7 Backup (com.sequenceiq.freeipa.api.model.Backup)6 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)5 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)4 CloudAdlsGen2View (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudAdlsGen2View)3 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)3 WasbCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters)3 CloudGcsView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudGcsView)2 CloudS3View (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudS3View)2 BackupRequest (com.sequenceiq.common.api.backup.request.BackupRequest)2 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)2 StackTags (com.sequenceiq.cloudbreak.cloud.model.StackTags)1 CloudFileSystemView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView)1 AwsInstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.instance.AwsInstanceTemplate)1