Search in sources :

Example 31 with Logging

use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.

the class FluentConfigServiceTest method testCreateFluentConfigWithDoublePath.

@Test(expected = CloudbreakServiceException.class)
public void testCreateFluentConfigWithDoublePath() {
    // GIVEN
    Logging logging = new Logging();
    logging.setStorageLocation("abfs://mycontainer/my/custom/path@myaccount.dfs.core.windows.net/my/custom/path");
    AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
    parameters.setAccountKey("myAccountKey");
    logging.setAdlsGen2(parameters);
    Telemetry telemetry = new Telemetry();
    telemetry.setLogging(logging);
    // WHEN
    underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Example 32 with Logging

use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.

the class CloudStorageFolderResolverServiceTest method createTelemetry.

private Telemetry createTelemetry() {
    Telemetry telemetry = new Telemetry();
    Logging logging = new Logging();
    logging.setStorageLocation("s3://mybucket");
    logging.setS3(new S3CloudStorageV1Parameters());
    telemetry.setLogging(logging);
    return telemetry;
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) S3CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry)

Example 33 with Logging

use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.

the class DiiagnosticsCollectionValidatorTest method testValidateWithCloudStorageWithEmptyTelemetryLoggingSetting.

@Test
void testValidateWithCloudStorageWithEmptyTelemetryLoggingSetting() {
    BaseDiagnosticsCollectionRequest request = new BaseDiagnosticsCollectionRequest();
    request.setDestination(DiagnosticsDestination.CLOUD_STORAGE);
    Telemetry telemetry = new Telemetry();
    telemetry.setLogging(new Logging());
    BadRequestException thrown = assertThrows(BadRequestException.class, () -> underTest.validate(request, createStackWithTelemetry(telemetry)));
    assertTrue(thrown.getMessage().contains("S3, ABFS or GCS cloud storage logging setting should be enabled for FreeIPA"));
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) BaseDiagnosticsCollectionRequest(com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest) BadRequestException(com.sequenceiq.cloudbreak.common.exception.BadRequestException) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.jupiter.api.Test)

Example 34 with Logging

use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.

the class StackToCloudStackConverterTest method testBuildFileSystemViewDifferentGCPEmail.

@Test
public void testBuildFileSystemViewDifferentGCPEmail() throws Exception {
    Telemetry telemetry = mock(Telemetry.class);
    Backup backup = mock(Backup.class);
    Logging logging = mock(Logging.class);
    GcsCloudStorageV1Parameters gcsLogging = new GcsCloudStorageV1Parameters();
    gcsLogging.setServiceAccountEmail("myaccount1@myprojectid.iam.gserviceaccount.com");
    GcsCloudStorageV1Parameters gcsBackup = new GcsCloudStorageV1Parameters();
    gcsBackup.setServiceAccountEmail("myaccount2@myprojectid.iam.gserviceaccount.com");
    when(stack.getTelemetry()).thenReturn(telemetry);
    when(telemetry.getLogging()).thenReturn(logging);
    when(stack.getBackup()).thenReturn(backup);
    when(backup.getGcs()).thenReturn(gcsBackup);
    when(logging.getGcs()).thenReturn(gcsLogging);
    expectedException.expect(BadRequestException.class);
    underTest.buildFileSystemView(stack);
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) Backup(com.sequenceiq.freeipa.api.model.Backup) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) GcsCloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters) Test(org.junit.Test)

Example 35 with Logging

use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.

the class StackToCloudStackConverterTest method testBuildFileSystemViewDifferentAzureManagedIdentity.

@Test
public void testBuildFileSystemViewDifferentAzureManagedIdentity() throws Exception {
    Telemetry telemetry = mock(Telemetry.class);
    Backup backup = mock(Backup.class);
    Logging logging = mock(Logging.class);
    AdlsGen2CloudStorageV1Parameters adlsGen2Logging = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2Logging.setManagedIdentity("/subscriptions/id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity1");
    AdlsGen2CloudStorageV1Parameters adlsGen2Backup = new AdlsGen2CloudStorageV1Parameters();
    adlsGen2Backup.setManagedIdentity("/subscriptions/id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity2");
    when(stack.getTelemetry()).thenReturn(telemetry);
    when(telemetry.getLogging()).thenReturn(logging);
    when(stack.getBackup()).thenReturn(backup);
    when(backup.getAdlsGen2()).thenReturn(adlsGen2Logging);
    when(logging.getAdlsGen2()).thenReturn(adlsGen2Backup);
    expectedException.expect(BadRequestException.class);
    underTest.buildFileSystemView(stack);
}
Also used : Logging(com.sequenceiq.common.api.telemetry.model.Logging) AdlsGen2CloudStorageV1Parameters(com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters) Backup(com.sequenceiq.freeipa.api.model.Backup) Telemetry(com.sequenceiq.common.api.telemetry.model.Telemetry) Test(org.junit.Test)

Aggregations

Logging (com.sequenceiq.common.api.telemetry.model.Logging)38 Telemetry (com.sequenceiq.common.api.telemetry.model.Telemetry)30 Test (org.junit.Test)21 S3CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.S3CloudStorageV1Parameters)15 AdlsGen2CloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.AdlsGen2CloudStorageV1Parameters)10 GcsCloudStorageV1Parameters (com.sequenceiq.common.api.cloudstorage.old.GcsCloudStorageV1Parameters)7 Backup (com.sequenceiq.freeipa.api.model.Backup)7 Test (org.junit.jupiter.api.Test)7 BaseDiagnosticsCollectionRequest (com.sequenceiq.common.api.diagnostics.BaseDiagnosticsCollectionRequest)4 Features (com.sequenceiq.common.api.telemetry.model.Features)4 TelemetryResponse (com.sequenceiq.common.api.telemetry.response.TelemetryResponse)4 CloudFileSystemView (com.sequenceiq.cloudbreak.cloud.model.filesystem.CloudFileSystemView)3 Monitoring (com.sequenceiq.common.api.telemetry.model.Monitoring)3 WorkloadAnalytics (com.sequenceiq.common.api.telemetry.model.WorkloadAnalytics)3 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)2 LoggingRequest (com.sequenceiq.common.api.telemetry.request.LoggingRequest)2 TelemetryRequest (com.sequenceiq.common.api.telemetry.request.TelemetryRequest)2 StackTags (com.sequenceiq.cloudbreak.cloud.model.StackTags)1 AwsInstanceTemplate (com.sequenceiq.cloudbreak.cloud.model.instance.AwsInstanceTemplate)1 Json (com.sequenceiq.cloudbreak.common.json.Json)1