Search in sources :

Example 26 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class StorageIdentityValidatorTest method testCloudStorageValidation.

@Test
void testCloudStorageValidation() {
    StorageIdentityBase storage = new StorageIdentityBase();
    S3CloudStorageV1Parameters s3 = new S3CloudStorageV1Parameters();
    s3.setInstanceProfile("instace::profile");
    storage.setS3(s3);
    storage.setType(CloudIdentityType.LOG);
    Set<ConstraintViolation<StorageIdentityBase>> constraintViolations = validator.validate(storage);
    assertTrue(constraintViolations.isEmpty());
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) ConstraintViolation(javax.validation.ConstraintViolation) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase) Test(org.junit.jupiter.api.Test)

Example 27 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class SdxServiceTest method withCloudStorage.

private void withCloudStorage(SdxClusterRequestBase sdxClusterRequest) {
    SdxCloudStorageRequest cloudStorage = new SdxCloudStorageRequest();
    cloudStorage.setFileSystemType(FileSystemType.S3);
    cloudStorage.setBaseLocation("s3a://some/dir/");
    cloudStorage.setS3(new S3CloudStorageV1Parameters());
    sdxClusterRequest.setCloudStorage(cloudStorage);
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)

Example 28 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class StorageValidationServiceTest method throwErrorWhenS3LocationInvalid.

@Test
public void throwErrorWhenS3LocationInvalid() {
    SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
    cloudStorageRequest.setBaseLocation("cloudbreakbucket/something");
    S3CloudStorageV1Parameters params = new S3CloudStorageV1Parameters();
    params.setInstanceProfile("instanceProfile");
    cloudStorageRequest.setS3(params);
    BadRequestException exception = Assertions.assertThrows(BadRequestException.class, () -> underTest.validateCloudStorage(CloudPlatform.AWS.toString(), cloudStorageRequest));
    assertEquals(exception.getMessage(), "AWS baselocation missing protocol. please specify s3a://");
}
Also used : SdxCloudStorageRequest(com.sequenceiq.sdx.api.model.SdxCloudStorageRequest) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Test(org.junit.jupiter.api.Test)

Example 29 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters in project cloudbreak by hortonworks.

the class StorageValidationServiceTest method okWhenS3LocationIsValid.

@Test
public void okWhenS3LocationIsValid() {
    SdxCloudStorageRequest cloudStorageRequest = new SdxCloudStorageRequest();
    cloudStorageRequest.setBaseLocation("s3a://cloudbreakbucket/something");
    S3CloudStorageV1Parameters params = new S3CloudStorageV1Parameters();
    params.setInstanceProfile("instanceProfile");
    cloudStorageRequest.setS3(params);
    underTest.validateCloudStorage(CloudPlatform.AWS.toString(), 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 30 with S3CloudStorageV1Parameters

use of com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters 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)

Aggregations

S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)59 Test (org.junit.jupiter.api.Test)27 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)16 Logging (com.sequenceiq.common.api.telemetry.model.Logging)15 LoggingRequest (com.sequenceiq.common.api.telemetry.request.LoggingRequest)12 Test (org.junit.Test)12 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)10 SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)10 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)8 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)8 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)7 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)7 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)7 Backup (com.sequenceiq.freeipa.api.model.Backup)7 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)5 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)5 DetailedEnvironmentResponse (com.sequenceiq.environment.api.v1.environment.model.response.DetailedEnvironmentResponse)5 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)4 Features (com.sequenceiq.common.api.telemetry.model.Features)4 SdxClusterRequest (com.sequenceiq.sdx.api.model.SdxClusterRequest)4