Search in sources :

Example 1 with FileSystemParameterV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses in project cloudbreak by hortonworks.

the class CloudStorageManifesterTest method mockFileSystemResponseForCloudbreakClient.

private void mockFileSystemResponseForCloudbreakClient() {
    FileSystemParameterV4Responses dummyResponses = new FileSystemParameterV4Responses();
    List<FileSystemParameterV4Response> responses = new ArrayList<>();
    FileSystemParameterV4Response resp = new FileSystemParameterV4Response();
    resp.setType(CloudStorageCdpService.RANGER_AUDIT.name());
    resp.setDefaultPath("ranger/example-path");
    resp.setDescription("Rangerpath");
    resp.setPropertyFile("dummyFile");
    resp.setPropertyName("dummyPropertyName");
    responses.add(resp);
    dummyResponses.setResponses(responses);
    when(fileSystemV4Endpoint.getFileSystemParametersInternal(anyLong(), anyString(), anyString(), anyString(), anyString(), anyString(), anyBoolean(), anyBoolean(), anyString())).thenReturn(dummyResponses);
}
Also used : FileSystemParameterV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Response) ArrayList(java.util.ArrayList) FileSystemParameterV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses)

Example 2 with FileSystemParameterV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses in project cloudbreak by hortonworks.

the class CloudStorageManifester method setStorageLocations.

private void setStorageLocations(FileSystemParameterV4Responses fileSystemRecommendations, CloudStorageRequest cloudStorageRequest) {
    List<StorageLocationBase> storageLocations = fileSystemRecommendations.getResponses().stream().map(response -> {
        StorageLocationBase storageLocation = new StorageLocationBase();
        storageLocation.setValue(response.getDefaultPath());
        storageLocation.setType(CloudStorageCdpService.valueOf(response.getType()));
        return storageLocation;
    }).collect(Collectors.toList());
    cloudStorageRequest.setLocations(storageLocations);
}
Also used : SdxCluster(com.sequenceiq.datalake.entity.SdxCluster) AwsStorageParameters(com.sequenceiq.common.api.cloudstorage.AwsStorageParameters) FileSystemParameterV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses) LoggerFactory(org.slf4j.LoggerFactory) ClusterV4Request(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request) StringUtils(org.apache.commons.lang3.StringUtils) Inject(javax.inject.Inject) Strings(com.google.common.base.Strings) ThreadBasedUserCrnProvider(com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider) Service(org.springframework.stereotype.Service) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) LoggingResponse(com.sequenceiq.common.api.telemetry.response.LoggingResponse) CloudStorageCdpService(com.sequenceiq.common.model.CloudStorageCdpService) Logger(org.slf4j.Logger) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase) StorageLocationBase(com.sequenceiq.common.api.cloudstorage.StorageLocationBase) CloudStorageResponse(com.sequenceiq.common.api.cloudstorage.CloudStorageResponse) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Collectors(java.util.stream.Collectors) FileSystemV4Endpoint(com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.FileSystemV4Endpoint) RegionAwareInternalCrnGeneratorFactory(com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGeneratorFactory) SdxClusterRequest(com.sequenceiq.sdx.api.model.SdxClusterRequest) List(java.util.List) CollectionUtils(org.springframework.util.CollectionUtils) CloudStorageRequest(com.sequenceiq.common.api.cloudstorage.CloudStorageRequest) FileSystemType(com.sequenceiq.common.model.FileSystemType) ClusterV4Response(com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.cluster.ClusterV4Response) S3Guard(com.sequenceiq.common.api.cloudstorage.S3Guard) CloudIdentityType(com.sequenceiq.common.model.CloudIdentityType) StorageLocationBase(com.sequenceiq.common.api.cloudstorage.StorageLocationBase)

Example 3 with FileSystemParameterV4Responses

use of com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses in project cloudbreak by hortonworks.

the class CloudStorageManifester method initSdxCloudStorageRequest.

public CloudStorageRequest initSdxCloudStorageRequest(String cloudPlatform, String blueprint, String clusterName, SdxCloudStorageRequest cloudStorage) {
    CloudStorageRequest cloudStorageRequest = new CloudStorageRequest();
    normalizeCloudStorageRequest(cloudStorage);
    storageValidationService.validateCloudStorage(cloudPlatform, cloudStorage);
    FileSystemParameterV4Responses fileSystemRecommendations = getFileSystemRecommendations(blueprint, clusterName, cloudStorage);
    LOGGER.info("File recommendations {}", fileSystemRecommendations);
    setStorageLocations(fileSystemRecommendations, cloudStorageRequest);
    addIdBrokerIdentity(cloudStorage, cloudStorageRequest);
    return cloudStorageRequest;
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) CloudStorageRequest(com.sequenceiq.common.api.cloudstorage.CloudStorageRequest) FileSystemParameterV4Responses(com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses)

Aggregations

FileSystemParameterV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses)3 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)2 SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)2 Strings (com.google.common.base.Strings)1 FileSystemV4Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.FileSystemV4Endpoint)1 FileSystemParameterV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Response)1 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)1 ClusterV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.response.cluster.ClusterV4Response)1 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)1 RegionAwareInternalCrnGeneratorFactory (com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGeneratorFactory)1 AwsStorageParameters (com.sequenceiq.common.api.cloudstorage.AwsStorageParameters)1 CloudStorageResponse (com.sequenceiq.common.api.cloudstorage.CloudStorageResponse)1 S3Guard (com.sequenceiq.common.api.cloudstorage.S3Guard)1 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)1 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)1 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)1 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)1 CloudIdentityType (com.sequenceiq.common.model.CloudIdentityType)1 CloudStorageCdpService (com.sequenceiq.common.model.CloudStorageCdpService)1 FileSystemType (com.sequenceiq.common.model.FileSystemType)1