use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class StackToCloudStackConverterTest method testBuildFileSystemViewSameAzureManagedIdentity.
@Test
public void testBuildFileSystemViewSameAzureManagedIdentity() 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/identity");
AdlsGen2CloudStorageV1Parameters adlsGen2Backup = new AdlsGen2CloudStorageV1Parameters();
adlsGen2Backup.setManagedIdentity("/subscriptions/id/resourceGroups/rg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identity");
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);
Optional<CloudFileSystemView> fileSystemView = underTest.buildFileSystemView(stack);
assertEquals(Optional.empty(), fileSystemView);
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithoutScheme.
@Test
public void testCreateFluentConfigWithoutScheme() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("mycontainer/cluster-logs/datahub/cl1@myaccount.dfs.core.windows.net");
AdlsGen2CloudStorageV1Parameters parameters = new AdlsGen2CloudStorageV1Parameters();
parameters.setAccountKey("myAccountKey");
logging.setAdlsGen2(parameters);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertEquals("myAccountKey", result.getAzureStorageAccessKey());
assertEquals("/cluster-logs/datahub/cl1", result.getLogFolderName());
assertEquals("mycontainer", result.getAzureContainer());
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithoutLocation.
@Test(expected = CloudbreakServiceException.class)
public void testCreateFluentConfigWithoutLocation() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation(null);
logging.setAdlsGen2(new AdlsGen2CloudStorageV1Parameters());
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWitGcsPath.
@Test
public void testCreateFluentConfigWitGcsPath() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("gs://mybucket/cluster-logs/datahub/cl1");
GcsCloudStorageV1Parameters gcsParams = new GcsCloudStorageV1Parameters();
gcsParams.setServiceAccountEmail("myaccount@myprojectid.iam.gserviceaccount.com");
logging.setGcs(gcsParams);
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertTrue(result.isCloudStorageLoggingEnabled());
assertEquals("cluster-logs/datahub/cl1", result.getLogFolderName());
assertEquals("mybucket", result.getGcsBucket());
assertEquals("myprojectid", result.getGcsProjectId());
}
use of com.sequenceiq.common.api.telemetry.model.Logging in project cloudbreak by hortonworks.
the class FluentConfigServiceTest method testCreateFluentConfigWithS3Path.
@Test
public void testCreateFluentConfigWithS3Path() {
// GIVEN
Logging logging = new Logging();
logging.setStorageLocation("s3://mybucket/cluster-logs/datahub/cl1");
logging.setS3(new S3CloudStorageV1Parameters());
Telemetry telemetry = new Telemetry();
telemetry.setLogging(logging);
// WHEN
FluentConfigView result = underTest.createFluentConfigs(DEFAULT_FLUENT_CLUSTER_DETAILS, false, false, REGION_SAMPLE, telemetry);
// THEN
assertTrue(result.isEnabled());
assertTrue(result.isCloudStorageLoggingEnabled());
assertEquals("cluster-logs/datahub/cl1", result.getLogFolderName());
assertEquals("mybucket", result.getS3LogArchiveBucketName());
}
Aggregations