Search in sources :

Example 6 with LoadBalancerBackend

use of com.microsoft.azure.management.network.LoadBalancerBackend in project azure-sdk-for-java by Azure.

the class TestNetworkInterface method printNic.

public static void printNic(NetworkInterface resource) {
    StringBuilder info = new StringBuilder();
    info.append("NetworkInterface: ").append(resource.id()).append("Name: ").append(resource.name()).append("\n\tResource group: ").append(resource.resourceGroupName()).append("\n\tRegion: ").append(resource.region()).append("\n\tTags: ").append(resource.tags()).append("\n\tInternal DNS name label: ").append(resource.internalDnsNameLabel()).append("\n\tInternal FQDN: ").append(resource.internalFqdn()).append("\n\tInternal domain name suffix: ").append(resource.internalDomainNameSuffix()).append("\n\tVirtual machine ID: ").append(resource.virtualMachineId()).append("\n\tApplied DNS servers: ").append(resource.appliedDnsServers().toString()).append("\n\tDNS server IPs: ");
    // Output dns servers
    for (String dnsServerIp : resource.dnsServers()) {
        info.append("\n\t\t").append(dnsServerIp);
    }
    info.append("\n\tIP forwarding enabled: ").append(resource.isIPForwardingEnabled()).append("\n\tMAC Address:").append(resource.macAddress()).append("\n\tPrivate IP:").append(resource.primaryPrivateIP()).append("\n\tPrivate allocation method:").append(resource.primaryPrivateIPAllocationMethod()).append("\n\tPrimary virtual network ID: ").append(resource.primaryIPConfiguration().networkId()).append("\n\tPrimary subnet name: ").append(resource.primaryIPConfiguration().subnetName()).append("\n\tIP configurations: ");
    // Output IP configs
    for (NicIPConfiguration ipConfig : resource.ipConfigurations().values()) {
        info.append("\n\t\tName: ").append(ipConfig.name()).append("\n\t\tPrivate IP: ").append(ipConfig.privateIPAddress()).append("\n\t\tPrivate IP allocation method: ").append(ipConfig.privateIPAllocationMethod().toString()).append("\n\t\tPrivate IP version: ").append(ipConfig.privateIPAddressVersion().toString()).append("\n\t\tPIP id: ").append(ipConfig.publicIPAddressId()).append("\n\t\tAssociated network ID: ").append(ipConfig.networkId()).append("\n\t\tAssociated subnet name: ").append(ipConfig.subnetName());
        // Show associated load balancer backends
        final List<LoadBalancerBackend> backends = ipConfig.listAssociatedLoadBalancerBackends();
        info.append("\n\t\tAssociated load balancer backends: ").append(backends.size());
        for (LoadBalancerBackend backend : backends) {
            info.append("\n\t\t\tLoad balancer ID: ").append(backend.parent().id()).append("\n\t\t\t\tBackend name: ").append(backend.name());
        }
        // Show associated load balancer inbound NAT rules
        final List<LoadBalancerInboundNatRule> natRules = ipConfig.listAssociatedLoadBalancerInboundNatRules();
        info.append("\n\t\tAssociated load balancer inbound NAT rules: ").append(natRules.size());
        for (LoadBalancerInboundNatRule natRule : natRules) {
            info.append("\n\t\t\tLoad balancer ID: ").append(natRule.parent().id()).append("\n\t\t\tInbound NAT rule name: ").append(natRule.name());
        }
    }
    System.out.println(info.toString());
}
Also used : NicIPConfiguration(com.microsoft.azure.management.network.NicIPConfiguration) LoadBalancerInboundNatRule(com.microsoft.azure.management.network.LoadBalancerInboundNatRule) LoadBalancerBackend(com.microsoft.azure.management.network.LoadBalancerBackend)

Aggregations

LoadBalancerBackend (com.microsoft.azure.management.network.LoadBalancerBackend)6 LoadBalancerInboundNatPool (com.microsoft.azure.management.network.LoadBalancerInboundNatPool)3 LoadBalancerInboundNatRule (com.microsoft.azure.management.network.LoadBalancerInboundNatRule)3 LoadBalancerFrontend (com.microsoft.azure.management.network.LoadBalancerFrontend)2 LoadBalancerHttpProbe (com.microsoft.azure.management.network.LoadBalancerHttpProbe)2 LoadBalancerProbe (com.microsoft.azure.management.network.LoadBalancerProbe)2 LoadBalancerTcpProbe (com.microsoft.azure.management.network.LoadBalancerTcpProbe)2 LoadBalancingRule (com.microsoft.azure.management.network.LoadBalancingRule)2 HashMap (java.util.HashMap)2 SubResource (com.microsoft.azure.SubResource)1 ConnectionString (com.microsoft.azure.management.appservice.ConnectionString)1 LoadBalancer (com.microsoft.azure.management.network.LoadBalancer)1 NicIPConfiguration (com.microsoft.azure.management.network.NicIPConfiguration)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1