use of com.sequenceiq.common.api.telemetry.response.LoggingResponse in project cloudbreak by hortonworks.
the class CloudStorageManifester method addLogIdentity.
private void addLogIdentity(CloudStorageRequest cloudStorageRequest, DetailedEnvironmentResponse environment) {
if (containsIdentityType(CloudIdentityType.LOG, cloudStorageRequest)) {
LOGGER.debug("Cloud storage log identity already set. Skip fetching it from environment.");
} else {
StorageIdentityBase log = new StorageIdentityBase();
log.setType(CloudIdentityType.LOG);
LoggingResponse logging = environment.getTelemetry().getLogging();
if (logging.getS3() != null) {
log.setS3(logging.getS3());
} else if (logging.getAdlsGen2() != null) {
log.setAdlsGen2(logging.getAdlsGen2());
} else if (logging.getGcs() != null) {
log.setGcs(logging.getGcs());
} else if (logging.getCloudwatch() != null) {
LOGGER.debug("Cloudwatch will act as s3 storage identity!");
S3CloudStorageV1Parameters s3CloudwatchParams = new S3CloudStorageV1Parameters();
s3CloudwatchParams.setInstanceProfile(logging.getCloudwatch().getInstanceProfile());
log.setS3(s3CloudwatchParams);
}
cloudStorageRequest.getIdentities().add(log);
}
}
use of com.sequenceiq.common.api.telemetry.response.LoggingResponse in project cloudbreak by hortonworks.
the class TelemetryConverter method createLoggingResponseFromSource.
private LoggingResponse createLoggingResponseFromSource(Logging logging) {
LoggingResponse loggingResponse = null;
if (logging != null) {
loggingResponse = new LoggingResponse();
loggingResponse.setStorageLocation(logging.getStorageLocation());
if (logging.getS3() != null) {
S3CloudStorageV1Parameters s3Params = new S3CloudStorageV1Parameters();
s3Params.setInstanceProfile(logging.getS3().getInstanceProfile());
loggingResponse.setS3(s3Params);
} else if (logging.getAdlsGen2() != null) {
AdlsGen2CloudStorageV1Parameters adlsGen2Params = new AdlsGen2CloudStorageV1Parameters();
adlsGen2Params.setAccountKey(logging.getAdlsGen2().getAccountKey());
adlsGen2Params.setAccountName(logging.getAdlsGen2().getAccountName());
adlsGen2Params.setSecure(logging.getAdlsGen2().isSecure());
adlsGen2Params.setManagedIdentity(logging.getAdlsGen2().getManagedIdentity());
loggingResponse.setAdlsGen2(adlsGen2Params);
} else if (logging.getGcs() != null) {
GcsCloudStorageV1Parameters gcsCloudStorageV1Parameters = new GcsCloudStorageV1Parameters();
gcsCloudStorageV1Parameters.setServiceAccountEmail(logging.getGcs().getServiceAccountEmail());
loggingResponse.setGcs(gcsCloudStorageV1Parameters);
} else if (logging.getCloudwatch() != null) {
loggingResponse.setCloudwatch(CloudwatchParams.copy(logging.getCloudwatch()));
}
}
return loggingResponse;
}
Aggregations