/** * Return networks with a label value. * @param label The label to filter on * @param value The value of the label * @return ListNetworksParam * @since Docker 1.12, API version 1.24 */ public static ListNetworksParam withLabel(String label, String value) { return isNullOrEmpty(value) ? filter("label", label) : filter("label", label + "=" + value); }
List<Network> networks = docker.listNetworks(ListNetworksParam.byNetworkName(dockerNetworkName)); for (Network network : networks) { relevantNetIds2Networks.put(network.id(),network);
/** * Filter networks by network type. * There are two types of networks: those built-in into Docker * and custom networks created by users. * @param type The network type. * @return The ListNetworksParam for the given type. * @see #builtInNetworks() * @see #customNetworks() * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam withType(final Network.Type type) { return filter("type", type.getName()); }
/** * Filter networks by network driver. * @param driver The network driver name. * @return The ListNetworksParam for the given driver. * @since Docker 1.12, API version 1.24 */ public static ListNetworksParam withDriver(final String driver) { return filter("driver", driver); }
/** * Return networks with a label. * @param label The label to filter on * @return ListNetworksParam * @since Docker 1.12, API version 1.24 */ public static ListNetworksParam withLabel(String label) { return withLabel(label, null); } }
/** * Filter networks by ID. * @param id Matches all or part of a network ID. * @return The ListNetworksParam for the given ID. * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam byNetworkId(final String id) { return filter("id", id); }
/** * Return user-defined (custom) networks only. * @return The ListNetworksParam for user-defined networks. * @see #withType(com.spotify.docker.client.messages.Network.Type) * @see #builtInNetworks() * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam customNetworks() { return withType(CUSTOM); }
/** * Filter networks by name. * @param name Matches all or part of a network name. * @return The ListNetworksParam for the given name. * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam byNetworkName(final String name) { return filter("name", name); }
/** * Return networks with a label value. * @param label The label to filter on * @param value The value of the label * @return ListNetworksParam * @since Docker 1.12, API version 1.24 */ public static ListNetworksParam withLabel(String label, String value) { return isNullOrEmpty(value) ? filter("label", label) : filter("label", label + "=" + value); }
/** * Return built-in networks only. * @return The ListNetworksParam for built-in networks. * @see #withType(com.spotify.docker.client.messages.Network.Type) * @see #customNetworks() * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam builtInNetworks() { return withType(BUILTIN); }
/** * Filter networks by network type. * There are two types of networks: those built-in into Docker * and custom networks created by users. * @param type The network type. * @return The ListNetworksParam for the given type. * @see #builtInNetworks() * @see #customNetworks() * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam withType(final Network.Type type) { return filter("type", type.getName()); }
/** * Filter networks by network driver. * @param driver The network driver name. * @return The ListNetworksParam for the given driver. * @since Docker 1.12, API version 1.24 */ public static ListNetworksParam withDriver(final String driver) { return filter("driver", driver); }
/** * Return built-in networks only. * @return The ListNetworksParam for built-in networks. * @see #withType(com.spotify.docker.client.messages.Network.Type) * @see #customNetworks() * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam builtInNetworks() { return withType(BUILTIN); }
/** * Filter networks by ID. * @param id Matches all or part of a network ID. * @return The ListNetworksParam for the given ID. * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam byNetworkId(final String id) { return filter("id", id); }
/** * Filter networks by name. * @param name Matches all or part of a network name. * @return The ListNetworksParam for the given name. * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam byNetworkName(final String name) { return filter("name", name); }
/** * Return user-defined (custom) networks only. * @return The ListNetworksParam for user-defined networks. * @see #withType(com.spotify.docker.client.messages.Network.Type) * @see #builtInNetworks() * @since Docker 1.10, API version 1.22 */ public static ListNetworksParam customNetworks() { return withType(CUSTOM); }
/** * Return networks with a label. * @param label The label to filter on * @return ListNetworksParam * @since Docker 1.12, API version 1.24 */ public static ListNetworksParam withLabel(String label) { return withLabel(label, null); } }