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