public class Link
extends java.lang.Object
implements java.io.Serializable
getName() is made available in the target
container with the aliased name getAlias(). This involves creating an entry in /etc/hosts and some environment
variables in the target container as well as creating a network bridge between both containers.| Constructor and Description |
|---|
Link(java.lang.String name,
java.lang.String alias)
Creates a
Link for the container with the given name and an aliased name for use in the target container. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getAlias() |
java.lang.String |
getName() |
static Link |
parse(java.lang.String serialized)
Parses a textual link specification (as used by the Docker CLI) to a
Link. |
java.lang.String |
toString()
Returns a string representation of this
Link suitable for inclusion in a JSON message. |
public Link(java.lang.String name,
java.lang.String alias)
Link for the container with the given name and an aliased name for use in the target container.name - the name of the container that you want to link into the target containeralias - the aliased name under which the linked container will be available in the target containerpublic java.lang.String getName()
public java.lang.String getAlias()
public static Link parse(java.lang.String serialized) throws java.lang.IllegalArgumentException
Link.serialized - the specification, e.g. name:alias or /name1:/name2/aliasLink matching the specificationjava.lang.IllegalArgumentException - if the specification cannot be parsedpublic java.lang.String toString()
Link suitable for inclusion in a JSON message. The format is name:alias,
like the argument in parse(String).toString in class java.lang.ObjectLinkCopyright © 2019. All Rights Reserved.