use of com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudGcsView in project cloudbreak by hortonworks.
the class CloudStorageParametersConverter method gcsToCloudView.
public CloudGcsView gcsToCloudView(GcsCloudStorageV1Parameters source) {
CloudGcsView cloudGcsView = new CloudGcsView(CloudIdentityType.LOG);
cloudGcsView.setServiceAccountEmail(source.getServiceAccountEmail());
return cloudGcsView;
}
use of com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudGcsView 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.cloudbreak.cloud.model.filesystem.CloudGcsView 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();
}
use of com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudGcsView in project cloudbreak by hortonworks.
the class FileSystemConverter method convertGcsLegacy.
private CloudGcsView convertGcsLegacy(GcsFileSystem source) {
CloudGcsView cloudGcsView = new CloudGcsView(CloudIdentityType.LOG);
cloudGcsView.setServiceAccountEmail(source.getServiceAccountEmail());
return cloudGcsView;
}
use of com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudGcsView in project cloudbreak by hortonworks.
the class FileSystemConverter method cloudIdentityToGcsView.
private CloudGcsView cloudIdentityToGcsView(CloudIdentity cloudIdentity) {
CloudGcsView cloudGcsView = new CloudGcsView(cloudIdentity.getIdentityType());
GcsIdentity gcsIdentity = cloudIdentity.getGcsIdentity();
if (Objects.isNull(gcsIdentity)) {
LOGGER.warn("GCS identity is null. Identity type is {}", cloudIdentity.getIdentityType());
return null;
}
cloudGcsView.setServiceAccountEmail(gcsIdentity.getServiceAccountEmail());
return cloudGcsView;
}
Aggregations