@Test public void whenCloudStorageEnabledFromInternalRequestWithLogging() { ClusterV4Request clusterV4Request = new ClusterV4Request(); clusterV4Request.setBlueprintName(exampleBlueprintName); CloudStorageRequest cloudStorageRequest = new CloudStorageRequest(); StorageLocationBase storageLocationBase = new StorageLocationBase(); storageLocationBase.setType(CloudStorageCdpService.RANGER_AUDIT); storageLocationBase.setValue("s3a: cloudStorageRequest.setLocations(List.of(storageLocationBase)); clusterV4Request.setCloudStorage(cloudStorageRequest); DetailedEnvironmentResponse environment = new DetailedEnvironmentResponse(); environment.setCloudPlatform("AWS"); TelemetryResponse telemetryResponse = new TelemetryResponse(); LoggingResponse loggingResponse = new LoggingResponse(); S3CloudStorageV1Parameters s3CloudStorageV1Parameters = new S3CloudStorageV1Parameters(); s3CloudStorageV1Parameters.setInstanceProfile("logprofile"); loggingResponse.setS3(s3CloudStorageV1Parameters); telemetryResponse.setLogging(loggingResponse); environment.setTelemetry(telemetryResponse); CloudStorageRequest cloudStorageConfigReq = underTest.initCloudStorageRequest( environment, clusterV4Request, null, new SdxClusterRequest()); assertEquals(CloudStorageCdpService.RANGER_AUDIT, cloudStorageConfigReq.getLocations().get(0).getType()); assertEquals(CloudIdentityType.LOG, cloudStorageConfigReq.getIdentities().get(0).getType()); }
public CloudStorageRequest initCloudStorageRequest(DetailedEnvironmentResponse environment, ClusterV4Request clusterRequest, SdxCluster sdxCluster, SdxClusterRequest sdxClusterRequest) { CloudStorageRequest cloudStorageRequest = null; boolean anyCloudStorageIsConfigured = isCloudStorageConfigured(sdxClusterRequest) || isInternalCloudStorageConfigured(clusterRequest); boolean loggingConfigured = isLoggingConfigured(environment); if (isCloudStorageConfigured(sdxClusterRequest)) { LOGGER.debug("Cloud storage configurations found in SDX cluster request."); cloudStorageRequest = initSdxCloudStorageRequest(environment, clusterRequest.getBlueprintName(), sdxCluster, sdxClusterRequest); } else if (isInternalCloudStorageConfigured(clusterRequest)) { LOGGER.debug("Cloud storage configurations found in internal SDX stack request."); cloudStorageRequest = clusterRequest.getCloudStorage(); } if (loggingConfigured) { LOGGER.debug("Cloud storage logging is enabled."); if (!anyCloudStorageIsConfigured) { LOGGER.debug("Creating cloud storage request only for logging identity."); cloudStorageRequest = new CloudStorageRequest(); } addLogIdentity(cloudStorageRequest, environment); } if (loggingConfigured || anyCloudStorageIsConfigured) { addS3Guard(cloudStorageRequest, environment); } return cloudStorageRequest; }
CloudStorageManifester { public CloudStorageRequest initCloudStorageRequest(DetailedEnvironmentResponse environment, ClusterV4Request clusterRequest, SdxCluster sdxCluster, SdxClusterRequest sdxClusterRequest) { CloudStorageRequest cloudStorageRequest = null; boolean anyCloudStorageIsConfigured = isCloudStorageConfigured(sdxClusterRequest) || isInternalCloudStorageConfigured(clusterRequest); boolean loggingConfigured = isLoggingConfigured(environment); if (isCloudStorageConfigured(sdxClusterRequest)) { LOGGER.debug("Cloud storage configurations found in SDX cluster request."); cloudStorageRequest = initSdxCloudStorageRequest(environment, clusterRequest.getBlueprintName(), sdxCluster, sdxClusterRequest); } else if (isInternalCloudStorageConfigured(clusterRequest)) { LOGGER.debug("Cloud storage configurations found in internal SDX stack request."); cloudStorageRequest = clusterRequest.getCloudStorage(); } if (loggingConfigured) { LOGGER.debug("Cloud storage logging is enabled."); if (!anyCloudStorageIsConfigured) { LOGGER.debug("Creating cloud storage request only for logging identity."); cloudStorageRequest = new CloudStorageRequest(); } addLogIdentity(cloudStorageRequest, environment); } if (loggingConfigured || anyCloudStorageIsConfigured) { addS3Guard(cloudStorageRequest, environment); } return cloudStorageRequest; } }
CloudStorageManifester { public CloudStorageRequest initCloudStorageRequest(DetailedEnvironmentResponse environment, ClusterV4Request clusterRequest, SdxCluster sdxCluster, SdxClusterRequest sdxClusterRequest) { CloudStorageRequest cloudStorageRequest = null; boolean anyCloudStorageIsConfigured = isCloudStorageConfigured(sdxClusterRequest) || isInternalCloudStorageConfigured(clusterRequest); boolean loggingConfigured = isLoggingConfigured(environment); if (isCloudStorageConfigured(sdxClusterRequest)) { LOGGER.debug("Cloud storage configurations found in SDX cluster request."); cloudStorageRequest = initSdxCloudStorageRequest(environment, clusterRequest.getBlueprintName(), sdxCluster, sdxClusterRequest); } else if (isInternalCloudStorageConfigured(clusterRequest)) { LOGGER.debug("Cloud storage configurations found in internal SDX stack request."); cloudStorageRequest = clusterRequest.getCloudStorage(); } if (loggingConfigured) { LOGGER.debug("Cloud storage logging is enabled."); if (!anyCloudStorageIsConfigured) { LOGGER.debug("Creating cloud storage request only for logging identity."); cloudStorageRequest = new CloudStorageRequest(); } addLogIdentity(cloudStorageRequest, environment); } if (loggingConfigured || anyCloudStorageIsConfigured) { addS3Guard(cloudStorageRequest, environment); } return cloudStorageRequest; }  }
CloudStorageManifester { public CloudStorageRequest initCloudStorageRequest(DetailedEnvironmentResponse environment, ClusterV4Request clusterRequest, SdxCluster sdxCluster, SdxClusterRequest sdxClusterRequest) { CloudStorageRequest cloudStorageRequest = null; boolean anyCloudStorageIsConfigured = isCloudStorageConfigured(sdxClusterRequest) || isInternalCloudStorageConfigured(clusterRequest); boolean loggingConfigured = isLoggingConfigured(environment); if (isCloudStorageConfigured(sdxClusterRequest)) { LOGGER.debug("Cloud storage configurations found in SDX cluster request."); cloudStorageRequest = initSdxCloudStorageRequest(environment, clusterRequest.getBlueprintName(), sdxCluster, sdxClusterRequest); } else if (isInternalCloudStorageConfigured(clusterRequest)) { LOGGER.debug("Cloud storage configurations found in internal SDX stack request."); cloudStorageRequest = clusterRequest.getCloudStorage(); } if (loggingConfigured) { LOGGER.debug("Cloud storage logging is enabled."); if (!anyCloudStorageIsConfigured) { LOGGER.debug("Creating cloud storage request only for logging identity."); cloudStorageRequest = new CloudStorageRequest(); } addLogIdentity(cloudStorageRequest, environment); } if (loggingConfigured || anyCloudStorageIsConfigured) { addS3Guard(cloudStorageRequest, environment); } return cloudStorageRequest; }  CloudStorageRequest initCloudStorageRequest(DetailedEnvironmentResponse environment,
            ClusterV4Request clusterRequest, SdxCluster sdxCluster, SdxClusterRequest sdxClusterRequest); }
CloudStorageManifester { public CloudStorageRequest initCloudStorageRequest(DetailedEnvironmentResponse environment, ClusterV4Request clusterRequest, SdxCluster sdxCluster, SdxClusterRequest sdxClusterRequest) { CloudStorageRequest cloudStorageRequest = null; boolean anyCloudStorageIsConfigured = isCloudStorageConfigured(sdxClusterRequest) || isInternalCloudStorageConfigured(clusterRequest); boolean loggingConfigured = isLoggingConfigured(environment); if (isCloudStorageConfigured(sdxClusterRequest)) { LOGGER.debug("Cloud storage configurations found in SDX cluster request."); cloudStorageRequest = initSdxCloudStorageRequest(environment, clusterRequest.getBlueprintName(), sdxCluster, sdxClusterRequest); } else if (isInternalCloudStorageConfigured(clusterRequest)) { LOGGER.debug("Cloud storage configurations found in internal SDX stack request."); cloudStorageRequest = clusterRequest.getCloudStorage(); } if (loggingConfigured) { LOGGER.debug("Cloud storage logging is enabled."); if (!anyCloudStorageIsConfigured) { LOGGER.debug("Creating cloud storage request only for logging identity."); cloudStorageRequest = new CloudStorageRequest(); } addLogIdentity(cloudStorageRequest, environment); } if (loggingConfigured || anyCloudStorageIsConfigured) { addS3Guard(cloudStorageRequest, environment); } return cloudStorageRequest; }  CloudStorageRequest initCloudStorageRequest(DetailedEnvironmentResponse environment,
            ClusterV4Request clusterRequest, SdxCluster sdxCluster, SdxClusterRequest sdxClusterRequest);  }