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());
}
Aggregations