use of com.microsoft.azure.management.network.LoadBalancerPublicFrontend in project azure-sdk-for-java by Azure.
the class PublicIPAddressImpl method getAssignedLoadBalancerFrontend.
@Override
public LoadBalancerPublicFrontend getAssignedLoadBalancerFrontend() {
if (this.hasAssignedLoadBalancer()) {
final String refId = this.inner().ipConfiguration().id();
final String loadBalancerId = ResourceUtils.parentResourceIdFromResourceId(refId);
final LoadBalancer lb = this.myManager.loadBalancers().getById(loadBalancerId);
final String frontendName = ResourceUtils.nameFromResourceId(refId);
return (LoadBalancerPublicFrontend) lb.frontends().get(frontendName);
} else {
return null;
}
}
use of com.microsoft.azure.management.network.LoadBalancerPublicFrontend in project azure-sdk-for-java by Azure.
the class LoadBalancerImpl method publicIPAddressIds.
@Override
public List<String> publicIPAddressIds() {
List<String> publicIPAddressIds = new ArrayList<>();
for (LoadBalancerFrontend frontend : this.frontends().values()) {
if (frontend.isPublic()) {
String pipId = ((LoadBalancerPublicFrontend) frontend).publicIPAddressId();
publicIPAddressIds.add(pipId);
}
}
return Collections.unmodifiableList(publicIPAddressIds);
}
use of com.microsoft.azure.management.network.LoadBalancerPublicFrontend 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());
}
Aggregations