private Iterable<String> getPrivateIpAddresses(Container container) { // A container can be attached to multiple networks. It can therefore have multiple private // IPs. The NetworkSettings.ipAddress might in fact be blank, with the only IP being on // network objects. if (container.networkSettings() == null) return ImmutableList.of(); ImmutableSet.Builder<String> builder = ImmutableSet.<String>builder(); NetworkSettings settings = container.networkSettings(); if (settings.ipAddress() != null && settings.ipAddress().length() > 0) { builder.add(settings.ipAddress()); } if (settings.networks() != null) { for (Map.Entry<String, NetworkSettings.Details> entry : settings.networks().entrySet()) { String ipAddress = entry.getValue().ipAddress(); if (ipAddress != null && ipAddress.length() > 0) { builder.add(ipAddress); } } } return builder.build(); }
private Iterable<String> getPrivateIpAddresses(Container container) { // A container can be attached to multiple networks. It can therefore have multiple private // IPs. The NetworkSettings.ipAddress might in fact be blank, with the only IP being on // network objects. if (container.networkSettings() == null) return ImmutableList.of(); ImmutableSet.Builder<String> builder = ImmutableSet.<String>builder(); NetworkSettings settings = container.networkSettings(); if (settings.ipAddress() != null && settings.ipAddress().length() > 0) { builder.add(settings.ipAddress()); } if (settings.networks() != null) { for (Map.Entry<String, NetworkSettings.Details> entry : settings.networks().entrySet()) { String ipAddress = entry.getValue().ipAddress(); if (ipAddress != null && ipAddress.length() > 0) { builder.add(ipAddress); } } } return builder.build(); }
private Iterable<String> getPrivateIpAddresses(Container container) { // A container can be attached to multiple networks. It can therefore have multiple private // IPs. The NetworkSettings.ipAddress might in fact be blank, with the only IP being on // network objects. if (container.networkSettings() == null) return ImmutableList.of(); ImmutableSet.Builder<String> builder = ImmutableSet.<String>builder(); NetworkSettings settings = container.networkSettings(); if (settings.ipAddress() != null && settings.ipAddress().length() > 0) { builder.add(settings.ipAddress()); } if (settings.networks() != null) { for (Map.Entry<String, NetworkSettings.Details> entry : settings.networks().entrySet()) { String ipAddress = entry.getValue().ipAddress(); if (ipAddress != null && ipAddress.length() > 0) { builder.add(ipAddress); } } } return builder.build(); }
private Iterable<String> getPrivateIpAddresses(Container container) { // A container can be attached to multiple networks. It can therefore have multiple private // IPs. The NetworkSettings.ipAddress might in fact be blank, with the only IP being on // network objects. if (container.networkSettings() == null) return ImmutableList.of(); ImmutableSet.Builder<String> builder = ImmutableSet.<String>builder(); NetworkSettings settings = container.networkSettings(); if (settings.ipAddress() != null && settings.ipAddress().length() > 0) { builder.add(settings.ipAddress()); } if (settings.networks() != null) { for (Map.Entry<String, NetworkSettings.Details> entry : settings.networks().entrySet()) { String ipAddress = entry.getValue().ipAddress(); if (ipAddress != null && ipAddress.length() > 0) { builder.add(ipAddress); } } } return builder.build(); }
public Builder fromNetworkSettings(NetworkSettings in) { return this.ipAddress(in.ipAddress()).ipPrefixLen(in.ipPrefixLen()).gateway(in.gateway()).bridge(in.bridge()) .portMapping(in.portMapping()).ports(in.ports()).sandboxId(in.sandboxId()).hairpinMode(in.hairpinMode()).linkLocalIPv6Address(in .linkLocalIPv6Address()).linkLocalIPv6PrefixLen(in.linkLocalIPv6PrefixLen()).sandboxKey(in.sandboxKey()).secondaryIPAddresses(in .secondaryIPAddresses()).secondaryIPv6Addresses(in.secondaryIPv6Addresses()).endpointId(in.endpointId()).globalIPv6Address(in .globalIPv6Address()).globalIPv6PrefixLen(in.globalIPv6PrefixLen()).ipv6Gateway(in.ipv6Gateway()).macAddress(in.macAddress()) .networks(in.networks()); } }
public Builder fromNetworkSettings(NetworkSettings in) { return this.ipAddress(in.ipAddress()).ipPrefixLen(in.ipPrefixLen()).gateway(in.gateway()).bridge(in.bridge()) .portMapping(in.portMapping()).ports(in.ports()).sandboxId(in.sandboxId()).hairpinMode(in.hairpinMode()).linkLocalIPv6Address(in .linkLocalIPv6Address()).linkLocalIPv6PrefixLen(in.linkLocalIPv6PrefixLen()).sandboxKey(in.sandboxKey()).secondaryIPAddresses(in .secondaryIPAddresses()).secondaryIPv6Addresses(in.secondaryIPv6Addresses()).endpointId(in.endpointId()).globalIPv6Address(in .globalIPv6Address()).globalIPv6PrefixLen(in.globalIPv6PrefixLen()).ipv6Gateway(in.ipv6Gateway()).macAddress(in.macAddress()) .networks(in.networks()); } }
public Builder fromNetworkSettings(NetworkSettings in) { return this.ipAddress(in.ipAddress()).ipPrefixLen(in.ipPrefixLen()).gateway(in.gateway()).bridge(in.bridge()) .portMapping(in.portMapping()).ports(in.ports()).sandboxId(in.sandboxId()).hairpinMode(in.hairpinMode()).linkLocalIPv6Address(in .linkLocalIPv6Address()).linkLocalIPv6PrefixLen(in.linkLocalIPv6PrefixLen()).sandboxKey(in.sandboxKey()).secondaryIPAddresses(in .secondaryIPAddresses()).secondaryIPv6Addresses(in.secondaryIPv6Addresses()).endpointId(in.endpointId()).globalIPv6Address(in .globalIPv6Address()).globalIPv6PrefixLen(in.globalIPv6PrefixLen()).ipv6Gateway(in.ipv6Gateway()).macAddress(in.macAddress()) .networks(in.networks()); } }
public Builder fromNetworkSettings(NetworkSettings in) { return this.ipAddress(in.ipAddress()).ipPrefixLen(in.ipPrefixLen()).gateway(in.gateway()).bridge(in.bridge()) .portMapping(in.portMapping()).ports(in.ports()).sandboxId(in.sandboxId()).hairpinMode(in.hairpinMode()).linkLocalIPv6Address(in .linkLocalIPv6Address()).linkLocalIPv6PrefixLen(in.linkLocalIPv6PrefixLen()).sandboxKey(in.sandboxKey()).secondaryIPAddresses(in .secondaryIPAddresses()).secondaryIPv6Addresses(in.secondaryIPv6Addresses()).endpointId(in.endpointId()).globalIPv6Address(in .globalIPv6Address()).globalIPv6PrefixLen(in.globalIPv6PrefixLen()).ipv6Gateway(in.ipv6Gateway()).macAddress(in.macAddress()) .networks(in.networks()); } }