use of com.sequenceiq.common.api.cloudstorage.StorageLocationBase in project cloudbreak by hortonworks.
the class CloudStorageDecorator method createStorageLocationBaseByTypeAndDefaultPath.
private StorageLocationBase createStorageLocationBaseByTypeAndDefaultPath(CloudStorageCdpService type, String defaultPath) {
StorageLocationBase storageLocationBase = new StorageLocationBase();
storageLocationBase.setType(type);
storageLocationBase.setValue(defaultPath);
return storageLocationBase;
}
use of com.sequenceiq.common.api.cloudstorage.StorageLocationBase in project cloudbreak by hortonworks.
the class CloudStorageManifesterTest method whenCloudStorageEnabledFromInternalRequestWithLogging.
@Test
public void whenCloudStorageEnabledFromInternalRequestWithLogging() {
ClusterV4Request clusterV4Request = new ClusterV4Request();
clusterV4Request.setBlueprintName(exampleBlueprintName);
CloudStorageRequest cloudStorageRequest = new CloudStorageRequest();
StorageLocationBase storageLocationBase = new StorageLocationBase();
storageLocationBase.setType(CloudStorageCdpService.RANGER_AUDIT);
storageLocationBase.setValue("s3a://ranger-audit");
cloudStorageRequest.setLocations(List.of(storageLocationBase));
clusterV4Request.setCloudStorage(cloudStorageRequest);
DetailedEnvironmentResponse environment = new DetailedEnvironmentResponse();
environment.setCloudPlatform("AWS");
TelemetryResponse telemetryResponse = new TelemetryResponse();
LoggingResponse loggingResponse = new LoggingResponse();
S3CloudStorageV1Parameters s3CloudStorageV1Parameters = new S3CloudStorageV1Parameters();
s3CloudStorageV1Parameters.setInstanceProfile("logprofile");
loggingResponse.setS3(s3CloudStorageV1Parameters);
telemetryResponse.setLogging(loggingResponse);
environment.setTelemetry(telemetryResponse);
CloudStorageRequest cloudStorageConfigReq = underTest.initCloudStorageRequest(environment, clusterV4Request, null, new SdxClusterRequest());
assertEquals(CloudStorageCdpService.RANGER_AUDIT, cloudStorageConfigReq.getLocations().get(0).getType());
assertEquals(CloudIdentityType.LOG, cloudStorageConfigReq.getIdentities().get(0).getType());
}
use of com.sequenceiq.common.api.cloudstorage.StorageLocationBase in project cloudbreak by hortonworks.
the class CloudStorageValidationUtilTest method testIsCloudStorageConfiguredWhenGcsNotNull.
@Test
public void testIsCloudStorageConfiguredWhenGcsNotNull() {
CloudStorageRequest cloudStorageRequest = new CloudStorageRequest();
StorageIdentityBase storageIdentityBase = new StorageIdentityBase();
storageIdentityBase.setGcs(new GcsCloudStorageV1Parameters());
cloudStorageRequest.setIdentities(List.of(storageIdentityBase));
cloudStorageRequest.setLocations(List.of(new StorageLocationBase()));
boolean actual = underTest.isCloudStorageConfigured(cloudStorageRequest);
Assert.assertTrue(actual);
}
use of com.sequenceiq.common.api.cloudstorage.StorageLocationBase in project cloudbreak by hortonworks.
the class CloudStorageValidationUtilTest method testIsCloudStorageConfiguredWhenAdlsGen2NotNull.
@Test
public void testIsCloudStorageConfiguredWhenAdlsGen2NotNull() {
CloudStorageRequest cloudStorageRequest = new CloudStorageRequest();
StorageIdentityBase storageIdentityBase = new StorageIdentityBase();
storageIdentityBase.setAdlsGen2(new AdlsGen2CloudStorageV1Parameters());
cloudStorageRequest.setIdentities(List.of(storageIdentityBase));
cloudStorageRequest.setLocations(List.of(new StorageLocationBase()));
boolean actual = underTest.isCloudStorageConfigured(cloudStorageRequest);
Assert.assertTrue(actual);
}
use of com.sequenceiq.common.api.cloudstorage.StorageLocationBase in project cloudbreak by hortonworks.
the class CloudStorageValidationUtilTest method testIsCloudStorageConfiguredWhenWasbNotNull.
@Test
public void testIsCloudStorageConfiguredWhenWasbNotNull() {
CloudStorageRequest cloudStorageRequest = new CloudStorageRequest();
StorageIdentityBase storageIdentityBase = new StorageIdentityBase();
storageIdentityBase.setWasb(new WasbCloudStorageV1Parameters());
cloudStorageRequest.setIdentities(List.of(storageIdentityBase));
cloudStorageRequest.setLocations(List.of(new StorageLocationBase()));
boolean actual = underTest.isCloudStorageConfigured(cloudStorageRequest);
Assert.assertTrue(actual);
}
Aggregations