Search in sources :

Example 16 with GcsCloudStorageV1Parameters

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

the class GcsFileSystemToGcsCloudStorageParametersConverterTest method testConvertCheckEveryParamPassedProperly.

@Test
public void testConvertCheckEveryParamPassedProperly() {
    GcsCloudStorageV1Parameters expected = new GcsCloudStorageV1Parameters();
    expected.setServiceAccountEmail(TEST_SERVICE_ACCOUNT_EMAIL);
    GcsCloudStorageV1Parameters result = underTest.convert(createGcsFileSystem());
    assertEquals(result, expected);
}
Also used : GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters) Test(org.junit.Test)

Example 17 with GcsCloudStorageV1Parameters

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

the class CloudStorageConverter method cloudIdentityToStorageIdentityBase.

private StorageIdentityBase cloudIdentityToStorageIdentityBase(CloudIdentity cloudIdentity) {
    StorageIdentityBase storageIdentityBase = new StorageIdentityBase();
    storageIdentityBase.setType(cloudIdentity.getIdentityType());
    if (cloudIdentity.getWasbIdentity() != null) {
        WasbCloudStorageV1Parameters parameters = wasbIdentityToParameters(cloudIdentity.getWasbIdentity());
        storageIdentityBase.setWasb(parameters);
    } else if (cloudIdentity.getS3Identity() != null) {
        S3CloudStorageV1Parameters parameters = s3IdentityToParameters(cloudIdentity.getS3Identity());
        storageIdentityBase.setS3(parameters);
    } else if (cloudIdentity.getAdlsGen2Identity() != null) {
        AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = adlsGen2IdentityToParameters(cloudIdentity.getAdlsGen2Identity());
        storageIdentityBase.setAdlsGen2(adlsGen2CloudStorageV1Parameters);
    } else if (cloudIdentity.getGcsIdentity() != null) {
        GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = gcsIdentityToParameters(cloudIdentity.getGcsIdentity());
        storageIdentityBase.setGcs(gcsCloudStorageV1Parameters);
    }
    return storageIdentityBase;
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) WasbCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)

Example 18 with GcsCloudStorageV1Parameters

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

the class CloudStorageConverter method gcsIdentityToParameters.

private GcsCloudStorageV1Parameters gcsIdentityToParameters(GcsIdentity gcsIdentity) {
    GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = new GcsCloudStorageV1Parameters();
    gcsCloudStorageV1Parameters.setServiceAccountEmail(gcsIdentity.getServiceAccountEmail());
    return gcsCloudStorageV1Parameters;
}
Also used : GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)

Example 19 with GcsCloudStorageV1Parameters

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

the class CloudStorageConverter method cloudIdentityToRequest.

private StorageIdentityBase cloudIdentityToRequest(CloudIdentity cloudIdentity) {
    StorageIdentityBase storageIdentityRequest = new StorageIdentityBase();
    storageIdentityRequest.setType(cloudIdentity.getIdentityType());
    if (cloudIdentity.getS3Identity() != null) {
        S3CloudStorageV1Parameters s3Parameters = s3IdentityToParameters(cloudIdentity.getS3Identity());
        storageIdentityRequest.setS3(s3Parameters);
    } else if (cloudIdentity.getWasbIdentity() != null) {
        WasbCloudStorageV1Parameters wasbParameters = wasbIdentityToParameters(cloudIdentity.getWasbIdentity());
        storageIdentityRequest.setWasb(wasbParameters);
    } else if (cloudIdentity.getAdlsGen2Identity() != null) {
        AdlsGen2CloudStorageV1Parameters adlsGen2CloudStorageV1Parameters = adlsGen2IdentityToParameters(cloudIdentity.getAdlsGen2Identity());
        storageIdentityRequest.setAdlsGen2(adlsGen2CloudStorageV1Parameters);
    } else if (cloudIdentity.getGcsIdentity() != null) {
        GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = gcsIdentityToParameters(cloudIdentity.getGcsIdentity());
        storageIdentityRequest.setGcs(gcsCloudStorageV1Parameters);
    }
    return storageIdentityRequest;
}
Also used : S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) WasbCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.WasbCloudStorageV1Parameters) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters) StorageIdentityBase(com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)

Example 20 with GcsCloudStorageV1Parameters

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

the class GcsFileSystemToGcsCloudStorageParametersV4Converter method convert.

public GcsCloudStorageV1Parameters convert(GcsFileSystem source) {
    GcsCloudStorageV1Parameters fileSystemConfigurations = new GcsCloudStorageV1Parameters();
    fileSystemConfigurations.setServiceAccountEmail(source.getServiceAccountEmail());
    return fileSystemConfigurations;
}
Also used : GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)

Aggregations

GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)31 Test (org.junit.jupiter.api.Test)12 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)10 Logging (com.sequenceiq.common.api.telemetry.model.Logging)7 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)7 Test (org.junit.Test)7 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)6 SdxCloudStorageRequest (com.sequenceiq.sdx.api.model.SdxCloudStorageRequest)4 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)3 CloudStorageRequest (com.sequenceiq.common.api.cloudstorage.CloudStorageRequest)3 StorageIdentityBase (com.sequenceiq.common.api.cloudstorage.StorageIdentityBase)3 StorageLocationBase (com.sequenceiq.common.api.cloudstorage.StorageLocationBase)3 LoggingResponse (com.sequenceiq.common.api.telemetry.response.LoggingResponse)3 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)3 Backup (com.sequenceiq.freeipa.api.model.Backup)3 FileSystemV4Endpoint (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.FileSystemV4Endpoint)2 FileSystemParameterV4Response (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Response)2 FileSystemParameterV4Responses (com.sequenceiq.cloudbreak.api.endpoint.v4.filesystems.responses.FileSystemParameterV4Responses)2 ClusterV4Request (com.sequenceiq.cloudbreak.api.endpoint.v4.stacks.request.cluster.ClusterV4Request)2 ThreadBasedUserCrnProvider (com.sequenceiq.cloudbreak.auth.ThreadBasedUserCrnProvider)2