use of com.sequenceiq.cloudbreak.cloud.azure.connector.resource.AzureDnsZoneDeploymentParameters in project cloudbreak by hortonworks.
the class AzureDnsZoneService method createDnsZonesAndNetworkLinks.
private void createDnsZonesAndNetworkLinks(AzureClient azureClient, String azureNetworkId, String resourceGroup, Map<String, String> tags, List<AzurePrivateDnsZoneServiceEnum> enabledPrivateEndpointServices) {
AzureDnsZoneDeploymentParameters parameters = new AzureDnsZoneDeploymentParameters(azureNetworkId, false, enabledPrivateEndpointServices, resourceGroup, tags);
azureResourceDeploymentHelperService.deployTemplate(azureClient, parameters);
}
use of com.sequenceiq.cloudbreak.cloud.azure.connector.resource.AzureDnsZoneDeploymentParameters in project cloudbreak by hortonworks.
the class AzureNetworkDnsZoneTemplateBuilderTest method whenBuildTemplateThenModelParametersAreSet.
@Test
public void whenBuildTemplateThenModelParametersAreSet() throws IOException, TemplateException {
AzureDnsZoneDeploymentParameters parameters = new AzureDnsZoneDeploymentParameters("networkId", false, List.of(AzurePrivateDnsZoneServiceEnum.STORAGE, AzurePrivateDnsZoneServiceEnum.POSTGRES), "resourceGroup", Collections.emptyMap());
when(freeMarkerTemplateUtils.processTemplateIntoString(any(), any())).thenCallRealMethod();
ObjectMapper objectMapper = new ObjectMapper();
JsonNode expectedJson = objectMapper.readTree(new File("src/test/resources/json/arm-network-dnszone.json"));
String actual = underTest.build(parameters);
JsonNode actualJson = objectMapper.readTree(actual);
assertEquals(expectedJson, actualJson);
}
use of com.sequenceiq.cloudbreak.cloud.azure.connector.resource.AzureDnsZoneDeploymentParameters in project cloudbreak by hortonworks.
the class AzureNetworkLinkService method createMissingNetworkLinks.
private void createMissingNetworkLinks(AzureClient azureClient, String azureNetworkId, String resourceGroup, Map<String, String> tags, List<AzurePrivateDnsZoneServiceEnum> enabledPrivateEndpointServices) {
for (AzurePrivateDnsZoneServiceEnum service : enabledPrivateEndpointServices) {
PagedList<VirtualNetworkLinkInner> networkLinks = azureClient.listNetworkLinksByPrivateDnsZoneName(resourceGroup, service.getDnsZoneName());
boolean networkLinkCreated = azureClient.isNetworkLinkCreated(StringUtils.substringAfterLast(azureNetworkId, "/"), networkLinks);
if (!networkLinkCreated) {
LOGGER.debug("Network links for service {} not yet created, creating them now", service.getSubResource());
AzureDnsZoneDeploymentParameters parameters = new AzureDnsZoneDeploymentParameters(azureNetworkId, true, enabledPrivateEndpointServices, resourceGroup, tags);
azureResourceDeploymentHelperService.deployTemplate(azureClient, parameters);
}
}
}
Aggregations