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(); }
.macAddress("") .networks(ImmutableMap.<String, NetworkSettings.Details> of( "bridge", NetworkSettings.Details.create("", "", "", 0, "", "", 0, ""))) .build()) .path("/bin/sh")
.macAddress("02:42:ac:11:00:02") .networks(ImmutableMap.of( "JCLOUDS_NETWORK", NetworkSettings.Details.create( "04268fbb4dc368b5a53bb1c3f89294a4f0c72095deb944db3c4efc6d6a439304", "172.19.0.1", "02:42:ac:13:00:02" ), "bridge", NetworkSettings.Details.create( "9e8dcc0c8288938a923018fee0728cee8e6de7c01a5150738ee6e51c1caf8cf6", "172.17.0.1",
"02:42:ac:11:00:02", // MacAddress ImmutableMap.of( "bridge", NetworkSettings.Details.create( "9e8dcc0c8288938a923018fee0728cee8e6de7c01a5150738ee6e51c1caf8cf6", // EndpointID "172.17.0.1", // Gateway
.networkSettings(container.networkSettings().toBuilder() .networks(ImmutableMap.<String, NetworkSettings.Details>builder() .put("JCLOUDS_NETWORK", NetworkSettings.Details.builder() .endpoint("1a10519f808faf1181cfdf3d1d6dd93e19ede2d1c8fed82562a4c17c297c4db3") .gateway("172.19.0.1") .macAddress("02:42:ac:13:00:02") .build()) .put("bridge", NetworkSettings.Details.builder() .endpoint("9e8dcc0c8288938a923018fee0728cee8e6de7c01a5150738ee6e51c1caf8cf6") .gateway("172.17.0.1")
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(); }
@SerializedNames({ "EndpointID", "Gateway", "IPAddress", "IPPrefixLen", "IPv6Gateway", "GlobalIPv6Address", "GlobalIPv6PrefixLen", "MacAddress" }) public static Details create(String endpointId, String gateway, String ipAddress, int ipPrefixLen, String ipv6Gateway, String globalIPv6Address, int globalIPv6PrefixLen, String macAddress) { return builder().endpoint(endpointId).gateway(gateway).ipAddress(ipAddress).ipPrefixLen(ipPrefixLen) .ipv6Gateway(ipv6Gateway).globalIPv6Address(globalIPv6Address) .globalIPv6PrefixLen(globalIPv6PrefixLen).macAddress(macAddress) .build(); }
@SerializedNames({ "EndpointID", "Gateway", "IPAddress", "IPPrefixLen", "IPv6Gateway", "GlobalIPv6Address", "GlobalIPv6PrefixLen", "MacAddress" }) public static Details create(String endpointId, String gateway, String ipAddress, int ipPrefixLen, String ipv6Gateway, String globalIPv6Address, int globalIPv6PrefixLen, String macAddress) { return builder().endpoint(endpointId).gateway(gateway).ipAddress(ipAddress).ipPrefixLen(ipPrefixLen) .ipv6Gateway(ipv6Gateway).globalIPv6Address(globalIPv6Address) .globalIPv6PrefixLen(globalIPv6PrefixLen).macAddress(macAddress) .build(); }
@SerializedNames({ "EndpointID", "Gateway", "IPAddress", "IPPrefixLen", "IPv6Gateway", "GlobalIPv6Address", "GlobalIPv6PrefixLen", "MacAddress" }) public static Details create(String endpointId, String gateway, String ipAddress, int ipPrefixLen, String ipv6Gateway, String globalIPv6Address, int globalIPv6PrefixLen, String macAddress) { return builder().endpoint(endpointId).gateway(gateway).ipAddress(ipAddress).ipPrefixLen(ipPrefixLen) .ipv6Gateway(ipv6Gateway).globalIPv6Address(globalIPv6Address) .globalIPv6PrefixLen(globalIPv6PrefixLen).macAddress(macAddress) .build(); }
@SerializedNames({ "EndpointID", "Gateway", "IPAddress", "IPPrefixLen", "IPv6Gateway", "GlobalIPv6Address", "GlobalIPv6PrefixLen", "MacAddress" }) public static Details create(String endpointId, String gateway, String ipAddress, int ipPrefixLen, String ipv6Gateway, String globalIPv6Address, int globalIPv6PrefixLen, String macAddress) { return builder().endpoint(endpointId).gateway(gateway).ipAddress(ipAddress).ipPrefixLen(ipPrefixLen) .ipv6Gateway(ipv6Gateway).globalIPv6Address(globalIPv6Address) .globalIPv6PrefixLen(globalIPv6PrefixLen).macAddress(macAddress) .build(); }