use of com.sequenceiq.common.api.cloudstorage.CloudStorageResponse in project cloudbreak by hortonworks.
the class CloudStorageManifester method initCloudStorageRequestFromExistingSdxCluster.
public CloudStorageRequest initCloudStorageRequestFromExistingSdxCluster(DetailedEnvironmentResponse environment, ClusterV4Response clusterV4Response, SdxCluster sdxCluster) {
boolean anyCloudStorageIsConfigured = !Strings.isNullOrEmpty(sdxCluster.getCloudStorageBaseLocation());
CloudStorageRequest cloudStorageRequest = new CloudStorageRequest();
if (anyCloudStorageIsConfigured) {
LOGGER.debug("Cloud storage configurations found in SDX cluster request.");
CloudStorageResponse cloudStorageResponse = clusterV4Response.getCloudStorage();
cloudStorageRequest.copy(cloudStorageResponse);
}
return cloudStorageRequest;
}
use of com.sequenceiq.common.api.cloudstorage.CloudStorageResponse in project cloudbreak by hortonworks.
the class CloudStorageConverter method fileSystemToResponse.
public CloudStorageResponse fileSystemToResponse(FileSystem fileSystem) {
CloudStorageResponse response = new CloudStorageResponse();
CloudStorage cloudStorage = fileSystem.getCloudStorage();
if (cloudStorage != null) {
if (StringUtils.isNotEmpty(cloudStorage.getS3GuardDynamoTableName())) {
AwsStorageParameters awsStorageParameters = new AwsStorageParameters();
S3Guard s3Guard = new S3Guard();
s3Guard.setDynamoTableName(cloudStorage.getS3GuardDynamoTableName());
awsStorageParameters.setS3Guard(s3Guard);
response.setAws(awsStorageParameters);
}
List<StorageIdentityBase> storageIdentities = cloudStorage.getCloudIdentities().stream().map(this::cloudIdentityToStorageIdentityBase).collect(Collectors.toList());
response.setIdentities(storageIdentities);
List<StorageLocationBase> storageLocations = cloudStorage.getLocations().stream().map(storageLocation -> {
StorageLocationBase storageLocationBase = new StorageLocationBase();
storageLocationBase.setType(storageLocation.getType());
storageLocationBase.setValue(storageLocation.getValue());
return storageLocationBase;
}).collect(Collectors.toList());
response.setLocations(storageLocations);
response.setAccountMapping(accountMappingToAccountMappingRequest(cloudStorage.getAccountMapping()));
}
return response;
}
use of com.sequenceiq.common.api.cloudstorage.CloudStorageResponse in project cloudbreak by hortonworks.
the class StackToDescribeFreeIpaResponseConverter method decorateWithCloudStorageAndTelemetry.
private void decorateWithCloudStorageAndTelemetry(Stack stack, DescribeFreeIpaResponse response) {
TelemetryResponse telemetryResponse = telemetryConverter.convert(stack.getTelemetry());
if (telemetryResponse != null) {
response.setTelemetry(telemetryResponse);
if (telemetryResponse.getLogging() != null) {
CloudStorageResponse cloudStorageResponse = new CloudStorageResponse();
List<StorageIdentityBase> identities = new ArrayList<>();
StorageIdentityBase logIdentity = new StorageIdentityBase();
logIdentity.setType(CloudIdentityType.LOG);
identities.add(logIdentity);
cloudStorageResponse.setIdentities(identities);
response.setCloudStorage(cloudStorageResponse);
}
}
}
Aggregations