use of com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity in project cloudbreak by hortonworks.
the class CloudFileSystemViewProviderTest method getCloudIdentities.
private List<CloudIdentity> getCloudIdentities() {
List<CloudIdentity> cloudIdentities = new ArrayList<>();
CloudIdentity idBroker = new CloudIdentity();
idBroker.setIdentityType(CloudIdentityType.ID_BROKER);
S3Identity idBrokerS3Identity = new S3Identity();
idBrokerS3Identity.setInstanceProfile(ID_BROKER_INSTANCE_PROFILE);
idBroker.setS3Identity(idBrokerS3Identity);
cloudIdentities.add(idBroker);
CloudIdentity log = new CloudIdentity();
log.setIdentityType(CloudIdentityType.LOG);
S3Identity logS3Identity = new S3Identity();
logS3Identity.setInstanceProfile(LOG_INSTANCE_PROFILE);
log.setS3Identity(logS3Identity);
cloudIdentities.add(log);
return cloudIdentities;
}
use of com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity in project cloudbreak by hortonworks.
the class FileSystemConverter method cloudIdentityToS3View.
private CloudS3View cloudIdentityToS3View(CloudIdentity cloudIdentity) {
CloudS3View cloudS3View = new CloudS3View(cloudIdentity.getIdentityType());
S3Identity s3Identity = cloudIdentity.getS3Identity();
if (Objects.isNull(s3Identity)) {
LOGGER.warn("S3 identity is null. Identity type is {}", cloudIdentity.getIdentityType());
return null;
}
cloudS3View.setInstanceProfile(s3Identity.getInstanceProfile());
return cloudS3View;
}
use of com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity in project cloudbreak by hortonworks.
the class CloudStorageConverter method identityRequestToCloudIdentity.
private CloudIdentity identityRequestToCloudIdentity(StorageIdentityBase storageIdentityRequest) {
CloudIdentity cloudIdentity = new CloudIdentity();
cloudIdentity.setIdentityType(storageIdentityRequest.getType());
if (storageIdentityRequest.getS3() != null) {
S3Identity s3Identity = identityRequestToS3(storageIdentityRequest);
cloudIdentity.setS3Identity(s3Identity);
}
if (storageIdentityRequest.getEfs() != null) {
EfsIdentity efsIdentity = identityRequestToEfs(storageIdentityRequest);
cloudIdentity.setEfsIdentity(efsIdentity);
}
if (storageIdentityRequest.getWasb() != null) {
WasbIdentity wasbIdentity = identityRequestToWasb(storageIdentityRequest);
cloudIdentity.setWasbIdentity(wasbIdentity);
}
if (storageIdentityRequest.getAdlsGen2() != null) {
AdlsGen2Identity identity = identityRequestToAdlsGen2(storageIdentityRequest);
cloudIdentity.setAdlsGen2Identity(identity);
}
if (storageIdentityRequest.getGcs() != null) {
GcsIdentity identity = identityRequestToGcs(storageIdentityRequest);
cloudIdentity.setGcsIdentity(identity);
}
if (storageIdentityRequest.getAdls() != null) {
throw new BadRequestException("ADLS cloud storage is not (yet) supported.");
}
return cloudIdentity;
}
use of com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity in project cloudbreak by hortonworks.
the class CloudStorageConverter method s3ParametersToIdentity.
private S3Identity s3ParametersToIdentity(S3CloudStorageV1Parameters s3CloudStorageV1Parameters) {
S3Identity s3Identity = new S3Identity();
s3Identity.setInstanceProfile(s3CloudStorageV1Parameters.getInstanceProfile());
return s3Identity;
}
use of com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity in project cloudbreak by hortonworks.
the class CloudStorageConverter method identityRequestToS3.
private S3Identity identityRequestToS3(StorageIdentityBase storageIdentityRequest) {
S3Identity s3Identity = new S3Identity();
s3Identity.setInstanceProfile(storageIdentityRequest.getS3().getInstanceProfile());
return s3Identity;
}
Aggregations