Search in sources :

Example 1 with IDockerNetwork

use of org.eclipse.linuxtools.docker.core.IDockerNetwork in project linuxtools by eclipse.

the class DockerConnection method listNetworks.

@Override
public List<IDockerNetwork> listNetworks() throws DockerException, InterruptedException {
    try {
        List<Network> networkList = client.listNetworks();
        ArrayList<IDockerNetwork> networks = new ArrayList<>();
        for (Network n : networkList) {
            networks.add(new DockerNetwork(n));
        }
        return networks;
    } catch (com.spotify.docker.client.exceptions.DockerException e) {
        throw new DockerException(e.getMessage(), e.getCause());
    }
}
Also used : DockerException(org.eclipse.linuxtools.docker.core.DockerException) IDockerNetwork(org.eclipse.linuxtools.docker.core.IDockerNetwork) Network(com.spotify.docker.client.messages.Network) IDockerNetwork(org.eclipse.linuxtools.docker.core.IDockerNetwork) ArrayList(java.util.ArrayList) IDockerNetwork(org.eclipse.linuxtools.docker.core.IDockerNetwork)

Aggregations

Network (com.spotify.docker.client.messages.Network)1 ArrayList (java.util.ArrayList)1 DockerException (org.eclipse.linuxtools.docker.core.DockerException)1 IDockerNetwork (org.eclipse.linuxtools.docker.core.IDockerNetwork)1