Search in sources :

Example 26 with SubResource

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

the class LoadBalancingRuleImpl method withFrontend.

@Override
public LoadBalancingRuleImpl withFrontend(String frontendName) {
    SubResource frontendRef = new SubResource().withId(this.parent().futureResourceId() + "/frontendIPConfigurations/" + frontendName);
    this.inner().withFrontendIPConfiguration(frontendRef);
    return this;
}
Also used : SubResource(com.microsoft.azure.SubResource)

Example 27 with SubResource

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

the class NetworkInterfaceImpl method beforeCreating.

@Override
protected void beforeCreating() {
    NetworkSecurityGroup networkSecurityGroup = null;
    if (creatableNetworkSecurityGroupKey != null) {
        networkSecurityGroup = (NetworkSecurityGroup) this.createdResource(creatableNetworkSecurityGroupKey);
    } else if (existingNetworkSecurityGroupToAssociate != null) {
        networkSecurityGroup = existingNetworkSecurityGroupToAssociate;
    }
    // Associate an NSG if needed
    if (networkSecurityGroup != null) {
        this.inner().withNetworkSecurityGroup(new SubResource().withId(networkSecurityGroup.id()));
    }
    NicIPConfigurationImpl.ensureConfigurations(this.nicIPConfigurations.values());
    // Reset and update IP configs
    this.inner().withIpConfigurations(innersFromWrappers(this.nicIPConfigurations.values()));
}
Also used : SubResource(com.microsoft.azure.SubResource) NetworkSecurityGroup(com.microsoft.azure.management.network.NetworkSecurityGroup)

Example 28 with SubResource

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

the class LoadBalancerFrontendImpl method inboundNatRules.

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

Example 29 with SubResource

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

the class LoadBalancerInboundNatRuleImpl method withFrontend.

@Override
public LoadBalancerInboundNatRuleImpl withFrontend(String frontendName) {
    SubResource frontendRef = new SubResource().withId(this.parent().futureResourceId() + "/frontendIPConfigurations/" + frontendName);
    this.inner().withFrontendIPConfiguration(frontendRef);
    return this;
}
Also used : SubResource(com.microsoft.azure.SubResource)

Example 30 with SubResource

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

the class SubnetImpl method withExistingRouteTable.

@Override
public SubnetImpl withExistingRouteTable(String resourceId) {
    SubResource reference = new SubResource().withId(resourceId);
    this.inner().withRouteTable(reference);
    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