@Test public void testSetupTelemetryForDatalake() throws ApiException { Stack stack = new Stack(); stack.setType(StackType.DATALAKE); WorkloadAnalytics wa = new WorkloadAnalytics(); Telemetry telemetry = new Telemetry(); telemetry.setWorkloadAnalytics(wa); underTest.setupTelemetryRole(stack, null, null, null, telemetry); verify(externalAccountService, times(0)).createExternalAccount(anyString(), anyString(), anyString(), anyMap(), any(ApiClient.class)); }
public void setupTelemetryRole(final Stack stack, final ApiClient client, final ApiHostRef cmHostRef, final ApiRoleList mgmtRoles, final Telemetry telemetry) throws ApiException { if (isWorkflowAnalyticsEnabled(stack, telemetry)) { WorkloadAnalytics workloadAnalytics = telemetry.getWorkloadAnalytics(); ClouderaManagerResourceApi cmResourceApi = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); ApiConfigList apiConfigList = buildTelemetryCMConfigList(workloadAnalytics); cmResourceApi.updateConfig("Adding telemetry settings.", apiConfigList); AltusCredential credentials = clouderaManagerDatabusService.getAltusCredential(stack); Map<String, String> accountConfigs = new HashMap<>(); accountConfigs.put(ALTUS_CREDENTIAL_ACCESS_KEY_NAME, credentials.getAccessKey()); accountConfigs.put(ALTUS_CREDENTIAL_PRIVATE_KEY_NAME, new String(credentials.getPrivateKey())); externalAccountService.createExternalAccount(ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_TYPE, accountConfigs, client); final ApiRole telemetryPublisher = new ApiRole(); telemetryPublisher.setName(TELEMETRYPUBLISHER); telemetryPublisher.setType(TELEMETRYPUBLISHER); telemetryPublisher.setHostRef(cmHostRef); mgmtRoles.addItemsItem(telemetryPublisher); } else { LOGGER.info("Telemetry WA is disabled"); } }
ClouderaManagerMgmtTelemetryService { public void setupTelemetryRole(final Stack stack, final ApiClient client, final ApiHostRef cmHostRef, final ApiRoleList mgmtRoles, final Telemetry telemetry) throws ApiException { if (isWorkflowAnalyticsEnabled(stack, telemetry)) { WorkloadAnalytics workloadAnalytics = telemetry.getWorkloadAnalytics(); ClouderaManagerResourceApi cmResourceApi = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); ApiConfigList apiConfigList = buildTelemetryCMConfigList(workloadAnalytics); cmResourceApi.updateConfig("Adding telemetry settings.", apiConfigList); AltusCredential credentials = clouderaManagerDatabusService.getAltusCredential(stack); Map<String, String> accountConfigs = new HashMap<>(); accountConfigs.put(ALTUS_CREDENTIAL_ACCESS_KEY_NAME, credentials.getAccessKey()); accountConfigs.put(ALTUS_CREDENTIAL_PRIVATE_KEY_NAME, new String(credentials.getPrivateKey())); externalAccountService.createExternalAccount(ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_TYPE, accountConfigs, client); final ApiRole telemetryPublisher = new ApiRole(); telemetryPublisher.setName(TELEMETRYPUBLISHER); telemetryPublisher.setType(TELEMETRYPUBLISHER); telemetryPublisher.setHostRef(cmHostRef); mgmtRoles.addItemsItem(telemetryPublisher); } else { LOGGER.info("Telemetry WA is disabled"); } } }
ClouderaManagerMgmtTelemetryService { public void setupTelemetryRole(final Stack stack, final ApiClient client, final ApiHostRef cmHostRef, final ApiRoleList mgmtRoles, final Telemetry telemetry) throws ApiException { if (isWorkflowAnalyticsEnabled(stack, telemetry)) { WorkloadAnalytics workloadAnalytics = telemetry.getWorkloadAnalytics(); ClouderaManagerResourceApi cmResourceApi = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); ApiConfigList apiConfigList = buildTelemetryCMConfigList(workloadAnalytics); cmResourceApi.updateConfig("Adding telemetry settings.", apiConfigList); AltusCredential credentials = clouderaManagerDatabusService.getAltusCredential(stack); Map<String, String> accountConfigs = new HashMap<>(); accountConfigs.put(ALTUS_CREDENTIAL_ACCESS_KEY_NAME, credentials.getAccessKey()); accountConfigs.put(ALTUS_CREDENTIAL_PRIVATE_KEY_NAME, new String(credentials.getPrivateKey())); externalAccountService.createExternalAccount(ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_TYPE, accountConfigs, client); final ApiRole telemetryPublisher = new ApiRole(); telemetryPublisher.setName(TELEMETRYPUBLISHER); telemetryPublisher.setType(TELEMETRYPUBLISHER); telemetryPublisher.setHostRef(cmHostRef); mgmtRoles.addItemsItem(telemetryPublisher); } else { LOGGER.info("Telemetry WA is disabled"); } }  }
ClouderaManagerMgmtTelemetryService { public void setupTelemetryRole(final Stack stack, final ApiClient client, final ApiHostRef cmHostRef, final ApiRoleList mgmtRoles, final Telemetry telemetry) throws ApiException { if (isWorkflowAnalyticsEnabled(stack, telemetry)) { WorkloadAnalytics workloadAnalytics = telemetry.getWorkloadAnalytics(); ClouderaManagerResourceApi cmResourceApi = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); ApiConfigList apiConfigList = buildTelemetryCMConfigList(workloadAnalytics); cmResourceApi.updateConfig("Adding telemetry settings.", apiConfigList); AltusCredential credentials = clouderaManagerDatabusService.getAltusCredential(stack); Map<String, String> accountConfigs = new HashMap<>(); accountConfigs.put(ALTUS_CREDENTIAL_ACCESS_KEY_NAME, credentials.getAccessKey()); accountConfigs.put(ALTUS_CREDENTIAL_PRIVATE_KEY_NAME, new String(credentials.getPrivateKey())); externalAccountService.createExternalAccount(ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_TYPE, accountConfigs, client); final ApiRole telemetryPublisher = new ApiRole(); telemetryPublisher.setName(TELEMETRYPUBLISHER); telemetryPublisher.setType(TELEMETRYPUBLISHER); telemetryPublisher.setHostRef(cmHostRef); mgmtRoles.addItemsItem(telemetryPublisher); } else { LOGGER.info("Telemetry WA is disabled"); } }  void setupTelemetryRole(final Stack stack, final ApiClient client, final ApiHostRef cmHostRef,
            final ApiRoleList mgmtRoles, final Telemetry telemetry); void updateTelemetryConfigs(final Stack stack, final ApiClient client,
            final Telemetry telemetry, final String sdxContextName,
            final String sdxStackCrn, final ProxyConfig proxyConfig); }
ClouderaManagerMgmtTelemetryService { public void setupTelemetryRole(final Stack stack, final ApiClient client, final ApiHostRef cmHostRef, final ApiRoleList mgmtRoles, final Telemetry telemetry) throws ApiException { if (isWorkflowAnalyticsEnabled(stack, telemetry)) { WorkloadAnalytics workloadAnalytics = telemetry.getWorkloadAnalytics(); ClouderaManagerResourceApi cmResourceApi = clouderaManagerApiFactory.getClouderaManagerResourceApi(client); ApiConfigList apiConfigList = buildTelemetryCMConfigList(workloadAnalytics); cmResourceApi.updateConfig("Adding telemetry settings.", apiConfigList); AltusCredential credentials = clouderaManagerDatabusService.getAltusCredential(stack); Map<String, String> accountConfigs = new HashMap<>(); accountConfigs.put(ALTUS_CREDENTIAL_ACCESS_KEY_NAME, credentials.getAccessKey()); accountConfigs.put(ALTUS_CREDENTIAL_PRIVATE_KEY_NAME, new String(credentials.getPrivateKey())); externalAccountService.createExternalAccount(ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_NAME, ALTUS_CREDENTIAL_TYPE, accountConfigs, client); final ApiRole telemetryPublisher = new ApiRole(); telemetryPublisher.setName(TELEMETRYPUBLISHER); telemetryPublisher.setType(TELEMETRYPUBLISHER); telemetryPublisher.setHostRef(cmHostRef); mgmtRoles.addItemsItem(telemetryPublisher); } else { LOGGER.info("Telemetry WA is disabled"); } }  void setupTelemetryRole(final Stack stack, final ApiClient client, final ApiHostRef cmHostRef,
            final ApiRoleList mgmtRoles, final Telemetry telemetry); void updateTelemetryConfigs(final Stack stack, final ApiClient client,
            final Telemetry telemetry, final String sdxContextName,
            final String sdxStackCrn, final ProxyConfig proxyConfig);  }