use of com.sequenceiq.cloudbreak.domain.cloudstorage.GcsIdentity in project cloudbreak by hortonworks.
the class CloudStorageConverter method identityRequestToGcs.
private GcsIdentity identityRequestToGcs(StorageIdentityBase storageIdentityRequest) {
GcsIdentity gcsIdentity = new GcsIdentity();
gcsIdentity.setServiceAccountEmail(storageIdentityRequest.getGcs().getServiceAccountEmail());
return gcsIdentity;
}
use of com.sequenceiq.cloudbreak.domain.cloudstorage.GcsIdentity 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;
}
use of com.sequenceiq.cloudbreak.domain.cloudstorage.GcsIdentity 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;
}
Aggregations