Search in sources :

Example 31 with SubResource

use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.

the class SubnetImpl method withExistingNetworkSecurityGroup.

@Override
public SubnetImpl withExistingNetworkSecurityGroup(String resourceId) {
    // Workaround for REST API's expectation of an object rather than string ID - should be fixed in Swagger specs or REST
    SubResource reference = new SubResource().withId(resourceId);
    this.inner().withNetworkSecurityGroup(reference);
    return this;
}
Also used : SubResource(com.microsoft.azure.SubResource)

Example 32 with SubResource

use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.

the class LoadBalancerBackendImpl method loadBalancingRules.

@Override
public Map<String, LoadBalancingRule> loadBalancingRules() {
    final Map<String, LoadBalancingRule> rules = new TreeMap<>();
    if (this.inner().loadBalancingRules() != null) {
        for (SubResource inner : this.inner().loadBalancingRules()) {
            String name = ResourceUtils.nameFromResourceId(inner.id());
            LoadBalancingRule rule = this.parent().loadBalancingRules().get(name);
            if (rule != null) {
                rules.put(name, rule);
            }
        }
    }
    return Collections.unmodifiableMap(rules);
}
Also used : SubResource(com.microsoft.azure.SubResource) LoadBalancingRule(com.microsoft.azure.management.network.LoadBalancingRule) TreeMap(java.util.TreeMap)

Example 33 with SubResource

use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.

the class LoadBalancerFrontendImpl method withExistingPublicIPAddress.

@Override
public LoadBalancerFrontendImpl withExistingPublicIPAddress(String resourceId) {
    SubResource pipRef = new SubResource().withId(resourceId);
    this.inner().withPublicIPAddress(pipRef).withSubnet(null).withPrivateIPAddress(null).withPrivateIPAllocationMethod(null);
    return this;
}
Also used : SubResource(com.microsoft.azure.SubResource)

Example 34 with SubResource

use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.

the class LoadBalancerFrontendImpl method loadBalancingRules.

@Override
public Map<String, LoadBalancingRule> loadBalancingRules() {
    final Map<String, LoadBalancingRule> rules = new TreeMap<>();
    if (this.inner().loadBalancingRules() != null) {
        for (SubResource innerRef : this.inner().loadBalancingRules()) {
            String name = ResourceUtils.nameFromResourceId(innerRef.id());
            LoadBalancingRule rule = this.parent().loadBalancingRules().get(name);
            if (rule != null) {
                rules.put(name, rule);
            }
        }
    }
    return Collections.unmodifiableMap(rules);
}
Also used : SubResource(com.microsoft.azure.SubResource) LoadBalancingRule(com.microsoft.azure.management.network.LoadBalancingRule) TreeMap(java.util.TreeMap)

Example 35 with SubResource

use of com.microsoft.azure.SubResource in project azure-sdk-for-java by Azure.

the class LoadBalancerFrontendImpl method withExistingSubnet.

@Override
public LoadBalancerFrontendImpl withExistingSubnet(String parentNetworkResourceId, String subnetName) {
    SubResource subnetRef = new SubResource().withId(parentNetworkResourceId + "/subnets/" + subnetName);
    this.inner().withSubnet(subnetRef).withPublicIPAddress(// Ensure no conflicting public and private settings
    null);
    return this;
}
Also used : SubResource(com.microsoft.azure.SubResource)

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