Search in sources :

Example 16 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest in project cloudbreak by hortonworks.

the class StorageValidationServiceTest method whenAwsConfiguredWithoutRoleShouldThrowException.

@Test
public void whenAwsConfiguredWithoutRoleShouldThrowException() {
    SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
    cloudStorageRequest.setBaseLocation("s3a://example-path");
    cloudStorageRequest.setFileSystemType(FileSystemType.S3);
    S3CloudStorageV1Parameters s3 = new S3CloudStorageV1Parameters();
    s3.setInstanceProfile(null);
    cloudStorageRequest.setS3(s3);
    Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage("AWS", cloudStorageRequest));
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Test(org.junit.jupiter.api.Test)

Example 17 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest in project cloudbreak by hortonworks.

the class StorageValidationServiceTest method whenInvalidConfigIsProvidedThrowBadRequest.

@Test
public void whenInvalidConfigIsProvidedThrowBadRequest() {
    SdxClusterRequest sdxClusterRequest = new SdxClusterRequest();
    SdxCloudStorageRequest sdxCloudStorageRequest = new SdxCloudStorageRequest();
    sdxCloudStorageRequest.setBaseLocation("s3a://example-path");
    sdxClusterRequest.setCloudStorage(sdxCloudStorageRequest);
    DetailedEnvironmentResponse environment = new DetailedEnvironmentResponse();
    environment.setCloudPlatform("AWS");
    BadRequestException exception = Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage(CloudPlatform.AWS.toString(), sdxCloudStorageRequest));
    assertEquals(exception.getMessage(), "instance profile must be defined for S3");
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) SdxClusterRequest(com.sequenceiq.sdx.api.model.SdxClusterRequest) DetailedEnvironmentResponse(com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Test(org.junit.jupiter.api.Test)

Example 18 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest in project cloudbreak by hortonworks.

the class StorageValidationServiceTest method whenAzureConfiguredWithManagedIdentityShouldNotThrowException.

@Test
public void whenAzureConfiguredWithManagedIdentityShouldNotThrowException() {
    SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
    cloudStorageRequest.setBaseLocation("abfs://example-path");
    cloudStorageRequest.setFileSystemType(FileSystemType.ADLS_GEN_2);
    AdlsGen2CloudStorageV1Parameters adlsGen2 = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2.setManagedIdentity("managedidentity");
    cloudStorageRequest.setAdlsGen2(adlsGen2);
    underTest.validateCloudStorage("AZURE", cloudStorageRequest);
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Test(org.junit.jupiter.api.Test)

Example 19 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest 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)

Example 20 with SdxCloudStorageRequest

use of com.sequenceiq.sdx.api.model.SdxCloudStorageRequest in project cloudbreak by hortonworks.

the class DistroXClusterCreationTest method testStorage.

private SdxCloudStorageRequest testStorage() {
    SdxCloudStorageRequest cloudStorage = new SdxCloudStorageRequest();
    cloudStorage.setBaseLocation(getS3Location());
    cloudStorage.setFileSystemType(FileSystemType.S3);
    cloudStorage.setS3(getS3Params());
    return cloudStorage;
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)

Aggregations

SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)20 Test (org.junit.jupiter.api.Test)16 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)9 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)5 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)4 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)4 SdxClusterRequest (com.sequenceiq.sdx.api.model.SdxClusterRequest)4 FileSystemParameterV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses)3 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)3 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)3 SdxCluster (com.sequenceiq.datalake.entity.SdxCluster)3 ArgumentMatchers.anyString (org.mockito.ArgumentMatchers.anyString)3 FileSystemV4Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.FileSystemV4Endpoint)2 FileSystemParameterV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Response)2 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)2 RegionAwareInternalCrnGenerator (com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGenerator)2 RegionAwareInternalCrnGeneratorFactory (com.sequenceiq.cloudbreak.auth.crn.RegionAwareInternalCrnGeneratorFactory)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)2 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)2 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)2