use of com.sequenceiq.environment.api.v1.environment.model.request.azure.AzureEnvironmentParameters in project cloudbreak by hortonworks.
the class AzureCloudProvider method withResourceGroup.
@Override
public EnvironmentTestDto withResourceGroup(EnvironmentTestDto environmentTestDto, String resourceGroupUsageString, String resourceGroupName) {
ResourceGroupUsage resourceGroupUsage = ResourceGroupUsage.valueOf(resourceGroupUsageString);
if (environmentTestDto.getAzure() == null) {
environmentTestDto.setAzure(AzureEnvironmentParameters.builder().build());
}
AzureEnvironmentParameters azureEnvironmentParameters = environmentTestDto.getAzure();
azureEnvironmentParameters.setResourceGroup(AzureResourceGroup.builder().withResourceGroupUsage(resourceGroupUsage).withName(resourceGroupName).build());
environmentTestDto.setAzure(azureEnvironmentParameters);
return environmentTestDto;
}
use of com.sequenceiq.environment.api.v1.environment.model.request.azure.AzureEnvironmentParameters in project cloudbreak by hortonworks.
the class StackRequestManifester method setupInstanceVolumeEncryptionForAzure.
@VisibleForTesting
void setupInstanceVolumeEncryptionForAzure(StackV4Request stackRequest, DetailedEnvironmentResponse environmentResponse) {
Optional<String> encryptionKeyUrl = Optional.of(environmentResponse).map(DetailedEnvironmentResponse::getAzure).map(AzureEnvironmentParameters::getResourceEncryptionParameters).map(AzureResourceEncryptionParameters::getEncryptionKeyUrl);
Optional<String> diskEncryptionSetId = Optional.of(environmentResponse).map(DetailedEnvironmentResponse::getAzure).map(AzureEnvironmentParameters::getResourceEncryptionParameters).map(AzureResourceEncryptionParameters::getDiskEncryptionSetId);
stackRequest.getInstanceGroups().forEach(ig -> {
AzureInstanceTemplateV4Parameters azure = ig.getTemplate().createAzure();
AzureEncryptionV4Parameters encryption = azure.getEncryption();
if (encryption == null) {
encryption = new AzureEncryptionV4Parameters();
azure.setEncryption(encryption);
}
if (encryptionKeyUrl.isPresent() && diskEncryptionSetId.isPresent()) {
azure.getEncryption().setKey(encryptionKeyUrl.get());
azure.getEncryption().setType(EncryptionType.CUSTOM);
azure.getEncryption().setDiskEncryptionSetId(diskEncryptionSetId.get());
}
if (entitlementService.isAzureEncryptionAtHostEnabled(environmentResponse.getAccountId())) {
azure.getEncryption().setEncryptionAtHostEnabled(Boolean.TRUE);
}
});
}
Aggregations