private LoadBalancer createLoadBalancerWithPrivateIP(final String ipAddress) { FrontendIPConfigurationsProperties frontendProps = FrontendIPConfigurationsProperties.builder() .privateIPAddress(ipAddress).privateIPAllocationMethod("Static") .subnet(IdReference.create(api().get(virtualNetworkName).properties().subnets().get(0).id())).build(); FrontendIPConfigurations frontendIps = FrontendIPConfigurations.create("ipConfigs", null, frontendProps, null); LoadBalancerProperties props = LoadBalancerProperties.builder() .frontendIPConfigurations(ImmutableList.of(frontendIps)).build(); LoadBalancer lbCreated = lbApi().createOrUpdate("lbName", LOCATION, null, null, props); assertNotNull(lbCreated); return lbCreated; }
@SerializedNames({ "subnet", "privateIPAddress", "privateIPAllocationMethod", "publicIPAddress" }) public static FrontendIPConfigurationsProperties create(final IdReference subnet, final String privateIPAddress, final String privateIPAllocationMethod, final IdReference publicIPAddress) { return builder().subnet(subnet).publicIPAddress(publicIPAddress).privateIPAddress(privateIPAddress) .privateIPAllocationMethod(privateIPAllocationMethod).build(); }
@SerializedNames({ "subnet", "privateIPAddress", "privateIPAllocationMethod", "publicIPAddress" }) public static FrontendIPConfigurationsProperties create(final IdReference subnet, final String privateIPAddress, final String privateIPAllocationMethod, final IdReference publicIPAddress) { return builder().subnet(subnet).publicIPAddress(publicIPAddress).privateIPAddress(privateIPAddress) .privateIPAllocationMethod(privateIPAllocationMethod).build(); }