use of com.microsoft.azure.management.network.NicIPConfiguration in project azure-sdk-for-java by Azure.
the class TestPublicIPAddress method printPIP.
public static void printPIP(PublicIPAddress resource) {
StringBuilder info = new StringBuilder().append("Public IP Address: ").append(resource.id()).append("\n\tName: ").append(resource.name()).append("\n\tResource group: ").append(resource.resourceGroupName()).append("\n\tRegion: ").append(resource.region()).append("\n\tTags: ").append(resource.tags()).append("\n\tIP Address: ").append(resource.ipAddress()).append("\n\tLeaf domain label: ").append(resource.leafDomainLabel()).append("\n\tFQDN: ").append(resource.fqdn()).append("\n\tReverse FQDN: ").append(resource.reverseFqdn()).append("\n\tIdle timeout (minutes): ").append(resource.idleTimeoutInMinutes()).append("\n\tIP allocation method: ").append(resource.ipAllocationMethod().toString()).append("\n\tIP version: ").append(resource.version().toString());
// Show the associated load balancer if any
info.append("\n\tLoad balancer association: ");
if (resource.hasAssignedLoadBalancer()) {
final LoadBalancerPublicFrontend frontend = resource.getAssignedLoadBalancerFrontend();
final LoadBalancer lb = frontend.parent();
info.append("\n\t\tLoad balancer ID: ").append(lb.id()).append("\n\t\tFrontend name: ").append(frontend.name());
} else {
info.append("(None)");
}
// Show the associated NIC if any
info.append("\n\tNetwork interface association: ");
if (resource.hasAssignedNetworkInterface()) {
final NicIPConfiguration nicIp = resource.getAssignedNetworkInterfaceIPConfiguration();
final NetworkInterface nic = nicIp.parent();
info.append("\n\t\tNetwork interface ID: ").append(nic.id()).append("\n\t\tIP config name: ").append(nicIp.name());
} else {
info.append("(None)");
}
System.out.println(info.toString());
}
use of com.microsoft.azure.management.network.NicIPConfiguration 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