Search in sources :

Example 1 with AdlsGen2CloudStorageV1Parameters

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

the class CloudStorageConverter method adlsGen2IdentityToParameters.

private AdlsGen2CloudStorageV1Parameters adlsGen2IdentityToParameters(AdlsGen2Identity adlsGen2Identity) {
    AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2CloudStorageV1Parameters.setManagedIdentity(adlsGen2Identity.getManagedIdentity());
    return adlsGen2CloudStorageV1Parameters;
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)

Example 2 with AdlsGen2CloudStorageV1Parameters

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

the class CloudStorageParametersConverter method adlsGen2ToCloudView.

public CloudAdlsGen2View adlsGen2ToCloudView(StorageIdentityBase source) {
    CloudAdlsGen2View cloudAdlsGen2View = new CloudAdlsGen2View(source.getType());
    AdlsGen2CloudStorageV1Parameters adlsGen2 = source.getAdlsGen2();
    cloudAdlsGen2View.setAccountKey(adlsGen2.getAccountKey());
    cloudAdlsGen2View.setAccountName(adlsGen2.getAccountName());
    cloudAdlsGen2View.setSecure(adlsGen2.isSecure());
    cloudAdlsGen2View.setManagedIdentity(adlsGen2.getManagedIdentity());
    return cloudAdlsGen2View;
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) CloudAdlsGen2View(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudAdlsGen2View)

Example 3 with AdlsGen2CloudStorageV1Parameters

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

the class AdlsGen2FileSystemToAdlsGen2CloudStorageParametersConverterTest method testConvertCheckEveryParameterHasPassedProperly.

@Test
public void testConvertCheckEveryParameterHasPassedProperly() {
    AdlsGen2CloudStorageV1Parameters expected = new AdlsGen2CloudStorageV1Parameters();
    expected.setAccountKey(TEST_ACCOUNT_KEY);
    expected.setAccountName(TEST_ACCOUNT_NAME);
    AdlsGen2CloudStorageV1Parameters result = underTest.convert(createAdlsGen2FileSystem());
    assertEquals(expected, result);
}
Also used : AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Test(org.junit.Test)

Example 4 with AdlsGen2CloudStorageV1Parameters

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

the class StackToCloudStackConverter method buildFileSystemViewFromTelemetry.

private Optional<CloudFileSystemView> buildFileSystemViewFromTelemetry(Logging logging) {
    if (logging.getStorageLocation() != null) {
        if (logging.getS3() != null) {
            CloudS3View s3View = new CloudS3View(CloudIdentityType.LOG);
            s3View.setInstanceProfile(logging.getS3().getInstanceProfile());
            return Optional.of(s3View);
        } else if (logging.getAdlsGen2() != null) {
            CloudAdlsGen2View adlsGen2View = new CloudAdlsGen2View(CloudIdentityType.LOG);
            AdlsGen2CloudStorageV1Parameters adlsGen2Params = logging.getAdlsGen2();
            adlsGen2View.setAccountKey(adlsGen2Params.getAccountKey());
            adlsGen2View.setAccountName(adlsGen2Params.getAccountName());
            adlsGen2View.setSecure(adlsGen2Params.isSecure());
            adlsGen2View.setManagedIdentity(adlsGen2Params.getManagedIdentity());
            return Optional.of(adlsGen2View);
        } else if (logging.getGcs() != null) {
            CloudGcsView cloudGcsView = new CloudGcsView(CloudIdentityType.LOG);
            cloudGcsView.setServiceAccountEmail(logging.getGcs().getServiceAccountEmail());
            return Optional.of(cloudGcsView);
        } else if (logging.getCloudwatch() != null) {
            CloudS3View s3View = new CloudS3View(CloudIdentityType.LOG);
            s3View.setInstanceProfile(logging.getCloudwatch().getInstanceProfile());
            return Optional.of(s3View);
        }
    }
    return Optional.empty();
}
Also used : CloudGcsView(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudGcsView) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) CloudAdlsGen2View(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudAdlsGen2View) CloudS3View(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudS3View)

Example 5 with AdlsGen2CloudStorageV1Parameters

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

the class StackToCloudStackConverter method buildFileSystemViewFromBackup.

private Optional<CloudFileSystemView> buildFileSystemViewFromBackup(Backup backup) {
    if (backup.getStorageLocation() != null) {
        if (backup.getS3() != null) {
            CloudS3View s3View = new CloudS3View(CloudIdentityType.LOG);
            s3View.setInstanceProfile(backup.getS3().getInstanceProfile());
            return Optional.of(s3View);
        } else if (backup.getAdlsGen2() != null) {
            CloudAdlsGen2View adlsGen2View = new CloudAdlsGen2View(CloudIdentityType.LOG);
            AdlsGen2CloudStorageV1Parameters adlsGen2Params = backup.getAdlsGen2();
            adlsGen2View.setAccountKey(adlsGen2Params.getAccountKey());
            adlsGen2View.setAccountName(adlsGen2Params.getAccountName());
            adlsGen2View.setSecure(adlsGen2Params.isSecure());
            adlsGen2View.setManagedIdentity(adlsGen2Params.getManagedIdentity());
            return Optional.of(adlsGen2View);
        } else if (backup.getGcs() != null) {
            CloudGcsView cloudGcsView = new CloudGcsView(CloudIdentityType.LOG);
            cloudGcsView.setServiceAccountEmail(backup.getGcs().getServiceAccountEmail());
            return Optional.of(cloudGcsView);
        }
    }
    return Optional.empty();
}
Also used : CloudGcsView(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudGcsView) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) CloudAdlsGen2View(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudAdlsGen2View) CloudS3View(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudS3View)

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