use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class LoadBalancingRuleImpl method withBackend.
@Override
public LoadBalancingRuleImpl withBackend(String backendName) {
SubResource backendRef = new SubResource().withId(this.parent().futureResourceId() + "/backendAddressPools/" + backendName);
this.inner().withBackendAddressPool(backendRef);
return this;
}
use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class ApplicationGatewayFrontendImpl method withExistingSubnet.
@Override
public ApplicationGatewayFrontendImpl withExistingSubnet(String parentNetworkResourceId, String subnetName) {
SubResource subnetRef = new SubResource().withId(parentNetworkResourceId + "/subnets/" + subnetName);
this.inner().withSubnet(subnetRef);
// Ensure this frontend is not public
this.withoutPublicIPAddress();
return this;
}
use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class ApplicationGatewayBackendHttpConfigurationImpl method withProbe.
@Override
public ApplicationGatewayBackendHttpConfigurationImpl withProbe(String name) {
if (name == null) {
return this.withoutProbe();
} else {
SubResource probeRef = new SubResource().withId(this.parent().futureResourceId() + "/probes/" + name);
this.inner().withProbe(probeRef);
return this;
}
}
use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class ApplicationGatewayFrontendImpl method withExistingPublicIPAddress.
@Override
public ApplicationGatewayFrontendImpl withExistingPublicIPAddress(String resourceId) {
SubResource pipRef = new SubResource().withId(resourceId);
this.inner().withPublicIPAddress(pipRef);
// Ensure no conflicting public and private settings
this.withoutSubnet();
return this;
}
use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.
the class VirtualMachineScaleSetImpl method getBackendsAssociatedWithIpConfiguration.
private static Map<String, LoadBalancerBackend> getBackendsAssociatedWithIpConfiguration(LoadBalancer loadBalancer, VirtualMachineScaleSetIPConfigurationInner ipConfig) {
String loadBalancerId = loadBalancer.id();
Map<String, LoadBalancerBackend> attachedBackends = new HashMap<>();
Map<String, LoadBalancerBackend> lbBackends = loadBalancer.backends();
for (LoadBalancerBackend lbBackend : lbBackends.values()) {
String backendId = mergePath(loadBalancerId, "backendAddressPools", lbBackend.name());
for (SubResource subResource : ipConfig.loadBalancerBackendAddressPools()) {
if (subResource.id().equalsIgnoreCase(backendId)) {
attachedBackends.put(lbBackend.name(), lbBackend);
}
}
}
return attachedBackends;
}
Aggregations