Search in sources :

Example 6 with AzureParametersDto

use of com.sequenceiq.environment.parameter.dto.AzureParametersDto in project cloudbreak by hortonworks.

the class EnvironmentDetailsToCDPEnvironmentDetailsConverter method convertAzureDetails.

private UsageProto.CDPEnvironmentAzureDetails convertAzureDetails(ParametersDto parametersDto) {
    UsageProto.CDPEnvironmentAzureDetails.Builder builder = UsageProto.CDPEnvironmentAzureDetails.newBuilder();
    if (parametersDto != null) {
        AzureParametersDto azureParametersDto = parametersDto.getAzureParametersDto();
        if (azureParametersDto != null) {
            builder.setSingleResourceGroup(azureParametersDto.getAzureResourceGroupDto().getResourceGroupUsagePattern().isSingleResourceGroup());
            Optional<String> encryptionKeyUrl = Optional.of(azureParametersDto).map(AzureParametersDto::getAzureResourceEncryptionParametersDto).map(AzureResourceEncryptionParametersDto::getEncryptionKeyUrl);
            builder.setResourceEncryptionEnabled(encryptionKeyUrl.isPresent());
        }
    }
    return builder.build();
}
Also used : AzureResourceEncryptionParametersDto(com.sequenceiq.environment.parameter.dto.AzureResourceEncryptionParametersDto) AzureParametersDto(com.sequenceiq.environment.parameter.dto.AzureParametersDto)

Aggregations

AzureParametersDto (com.sequenceiq.environment.parameter.dto.AzureParametersDto)6 EnvironmentDto (com.sequenceiq.environment.environment.dto.EnvironmentDto)4 AzureResourceEncryptionParametersDto (com.sequenceiq.environment.parameter.dto.AzureResourceEncryptionParametersDto)4 AzureResourceGroupDto (com.sequenceiq.environment.parameter.dto.AzureResourceGroupDto)3 CloudbreakServiceException (com.sequenceiq.cloudbreak.common.exception.CloudbreakServiceException)2 ParametersDto (com.sequenceiq.environment.parameter.dto.ParametersDto)2 BadRequestException (com.sequenceiq.cloudbreak.common.exception.BadRequestException)1 NullUtil (com.sequenceiq.cloudbreak.util.NullUtil)1 NullUtil.getIfNotNull (com.sequenceiq.cloudbreak.util.NullUtil.getIfNotNull)1 SecurityGroupSeparator.getSecurityGroupIds (com.sequenceiq.cloudbreak.util.SecurityGroupSeparator.getSecurityGroupIds)1 ValidationResult (com.sequenceiq.cloudbreak.validation.ValidationResult)1 Tunnel (com.sequenceiq.common.api.type.Tunnel)1 AwsDiskEncryptionParameters (com.sequenceiq.environment.api.v1.environment.model.request.aws.AwsDiskEncryptionParameters)1 AwsEnvironmentParameters (com.sequenceiq.environment.api.v1.environment.model.request.aws.AwsEnvironmentParameters)1 S3GuardRequestParameters (com.sequenceiq.environment.api.v1.environment.model.request.aws.S3GuardRequestParameters)1 AzureEnvironmentParameters (com.sequenceiq.environment.api.v1.environment.model.request.azure.AzureEnvironmentParameters)1 AzureResourceEncryptionParameters (com.sequenceiq.environment.api.v1.environment.model.request.azure.AzureResourceEncryptionParameters)1 AzureResourceGroup (com.sequenceiq.environment.api.v1.environment.model.request.azure.AzureResourceGroup)1 ResourceGroupUsage (com.sequenceiq.environment.api.v1.environment.model.request.azure.ResourceGroupUsage)1 GcpEnvironmentParameters (com.sequenceiq.environment.api.v1.environment.model.request.gcp.GcpEnvironmentParameters)1