Search in sources :

Example 11 with SubResource

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;
}
Also used : SubResource(com.microsoft.azure.SubResource)

Example 12 with SubResource

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;
}
Also used : SubResource(com.microsoft.azure.SubResource)

Example 13 with SubResource

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;
    }
}
Also used : SubResource(com.microsoft.azure.SubResource)

Example 14 with SubResource

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;
}
Also used : SubResource(com.microsoft.azure.SubResource)

Example 15 with SubResource

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;
}
Also used : SubResource(com.microsoft.azure.SubResource) HashMap(java.util.HashMap) LoadBalancerBackend(com.microsoft.azure.management.network.LoadBalancerBackend)

Aggregations

SubResource (com.microsoft.azure.SubResource)38 ArrayList (java.util.ArrayList)5 TreeMap (java.util.TreeMap)5 LoadBalancingRule (com.microsoft.azure.management.network.LoadBalancingRule)4 LoadBalancerInboundNatPool (com.microsoft.azure.management.network.LoadBalancerInboundNatPool)3 HashMap (java.util.HashMap)3 IPAllocationMethod (com.microsoft.azure.management.network.IPAllocationMethod)2 PublicIPAddressInner (com.microsoft.azure.management.network.implementation.PublicIPAddressInner)2 SubnetInner (com.microsoft.azure.management.network.implementation.SubnetInner)2 CloudError (com.microsoft.azure.CloudError)1 CloudException (com.microsoft.azure.CloudException)1 ApplicationTokenCredentials (com.microsoft.azure.credentials.ApplicationTokenCredentials)1 AvailabilitySet (com.microsoft.azure.management.compute.AvailabilitySet)1 AvailabilitySetSkuTypes (com.microsoft.azure.management.compute.AvailabilitySetSkuTypes)1 CachingTypes (com.microsoft.azure.management.compute.CachingTypes)1 DataDisk (com.microsoft.azure.management.compute.DataDisk)1 Disk (com.microsoft.azure.management.compute.Disk)1 DiskCreateOptionTypes (com.microsoft.azure.management.compute.DiskCreateOptionTypes)1 HardwareProfile (com.microsoft.azure.management.compute.HardwareProfile)1 NetworkProfile (com.microsoft.azure.management.compute.NetworkProfile)1