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));
}
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");
}
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);
}
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;
}
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;
}
Aggregations