Class Network<C extends CommandWithArgumentList>
- java.lang.Object
-
- com.oracle.bedrock.runtime.docker.commands.AbstractDockerCommand<C>
-
- com.oracle.bedrock.runtime.docker.commands.CommandWithArgumentList<C>
-
- com.oracle.bedrock.runtime.docker.commands.Network<C>
-
- All Implemented Interfaces:
com.oracle.bedrock.runtime.MetaClass<com.oracle.bedrock.runtime.Application>
- Direct Known Subclasses:
Network.Connect,Network.Create,Network.Disconnect,Network.Inspect,Network.LS,Network.Remove
public abstract class Network<C extends CommandWithArgumentList> extends CommandWithArgumentList<C>
A representation of the Docker Network commands.Copyright (c) 2016. All Rights Reserved. Oracle Corporation.
Oracle is a registered trademark of Oracle Corporation and/or its affiliates.- Author:
- Jonathan Knight
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classNetwork.ConnectA representation of the Docker Network Connect command.static classNetwork.CreateA representation of the Docker Network Create command.static classNetwork.DisconnectA representation of the Docker Network Disconnect command.static classNetwork.InspectA representation of the Docker Network Inspect command.static classNetwork.LSA representation of the Docker Network LS command.static classNetwork.RemoveA representation of the Docker Network rm command.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Network.Connectconnect(String network, String container)Connect a container to a Docker network.static Network.Createcreate(String name, String driver)Create a Docker network using the specified driver.static Network.CreatecreateBridge(String name)Create a Docker network using the bridge driver.static Network.CreatecreateOverlay(String name)Create a Docker network using the overlay driver.static Network.Disconnectdisconnect(String network, String container)Connect a container to a Docker network.static javax.json.JsonValueinspect(com.oracle.bedrock.runtime.Platform platform, Docker environment, String... networks)Execute anNetwork.Inspectcommand on the specifiedPlatformusing the specifiedDockerenvironment.static Network.Inspectinspect(String... names)Inspect the specified networks.static Network.Inspectinspect(List<String> names)Inspect the specified networks.static Network.LSlist()List the available Docker networks,static Network.Removeremove(String... names)Remove one or more Docker networks.static Network.Removeremove(List<String> names)Remove one or more Docker networks.-
Methods inherited from class com.oracle.bedrock.runtime.docker.commands.CommandWithArgumentList
onLaunch, withCommandArguments, withCommandArguments, withoutCommandArguments, withoutCommandArguments
-
Methods inherited from class com.oracle.bedrock.runtime.docker.commands.AbstractDockerCommand
getCommandArguments, getImplementationClass, getTimeout, onLaunched, onLaunching, timeoutAfter, timeoutAfter
-
-
-
-
Method Detail
-
createBridge
public static Network.Create createBridge(String name)
Create a Docker network using the bridge driver.- Parameters:
name- the name of the network to create- Returns:
- a new
Network.Createcommand.
-
createOverlay
public static Network.Create createOverlay(String name)
Create a Docker network using the overlay driver.- Parameters:
name- the name of the network to create- Returns:
- a new
Network.Createcommand.
-
create
public static Network.Create create(String name, String driver)
Create a Docker network using the specified driver.- Parameters:
name- the name of the network to createdriver- the name of the network driver to use- Returns:
- a new
Network.Createcommand.
-
connect
public static Network.Connect connect(String network, String container)
Connect a container to a Docker network.- Parameters:
network- the name of the network to connect tocontainer- the name of the container to connect to the network- Returns:
- a new
Network.Connectcommand.
-
disconnect
public static Network.Disconnect disconnect(String network, String container)
Connect a container to a Docker network.- Parameters:
network- the name of the network to connect tocontainer- the name of the container to connect to the network- Returns:
- a new
Network.Connectcommand.
-
inspect
public static Network.Inspect inspect(String... names)
Inspect the specified networks.- Parameters:
names- the names of the networks to inspect- Returns:
- a new
Network.Inspect
-
inspect
public static Network.Inspect inspect(List<String> names)
Inspect the specified networks.- Parameters:
names- the names of the networks to inspect- Returns:
- a new
Network.Inspect
-
inspect
public static javax.json.JsonValue inspect(com.oracle.bedrock.runtime.Platform platform, Docker environment, String... networks)Execute anNetwork.Inspectcommand on the specifiedPlatformusing the specifiedDockerenvironment.- Parameters:
platform- thePlatformto use to execute the commandenvironment- theDockerenvironment to usenetworks- the names of the networks to inspect- Returns:
- a
JsonArraycontaining the results of the inspect command
-
list
public static Network.LS list()
List the available Docker networks,- Returns:
- a new
Network.LScommand.
-
remove
public static Network.Remove remove(String... names)
Remove one or more Docker networks.- Parameters:
names- the names of the network to remove- Returns:
- a new
Network.Removecommand.
-
remove
public static Network.Remove remove(List<String> names)
Remove one or more Docker networks.- Parameters:
names- the names of the network to remove- Returns:
- a new
Network.Removecommand.
-
-