Search in sources :

Example 1 with S3Identity

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;
}
Also used : CloudIdentity(com.sequenceiq.cloudbreak.domain.cloudstorage.CloudIdentity) ArrayList(java.util.ArrayList) S3Identity(com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity)

Example 2 with S3Identity

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;
}
Also used : S3Identity(com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity) CloudS3View(com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudS3View)

Example 3 with S3Identity

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;
}
Also used : AdlsGen2Identity(com.sequenceiq.cloudbreak.domain.cloudstorage.AdlsGen2Identity) GcsIdentity(com.sequenceiq.cloudbreak.domain.cloudstorage.GcsIdentity) CloudIdentity(com.sequenceiq.cloudbreak.domain.cloudstorage.CloudIdentity) EfsIdentity(com.sequenceiq.cloudbreak.domain.cloudstorage.EfsIdentity) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) S3Identity(com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity) WasbIdentity(com.sequenceiq.cloudbreak.domain.cloudstorage.WasbIdentity)

Example 4 with S3Identity

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;
}
Also used : S3Identity(com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity)

Example 5 with 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;
}
Also used : S3Identity(com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity)

Aggregations

S3Identity (com.sequenceiq.cloudbreak.domain.cloudstorage.S3Identity)5 CloudIdentity (com.sequenceiq.cloudbreak.domain.cloudstorage.CloudIdentity)2 CloudS3View (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudS3View)1 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)1 AdlsGen2Identity (com.sequenceiq.cloudbreak.domain.cloudstorage.AdlsGen2Identity)1 EfsIdentity (com.sequenceiq.cloudbreak.domain.cloudstorage.EfsIdentity)1 GcsIdentity (com.sequenceiq.cloudbreak.domain.cloudstorage.GcsIdentity)1 WasbIdentity (com.sequenceiq.cloudbreak.domain.cloudstorage.WasbIdentity)1 ArrayList (java.util.ArrayList)1