use of io.fabric8.maven.docker.model.NetworksListElement in project docker-maven-plugin by fabric8io.
the class DockerAccessWithHcClient method listNetworks.
@Override
public List<Network> listNetworks() throws DockerAccessException {
String url = urlBuilder.listNetworks();
try {
String response = delegate.get(url, HTTP_OK);
JsonArray array = JsonFactory.newJsonArray(response);
List<Network> networks = new ArrayList<>(array.size());
for (int i = 0; i < array.size(); i++) {
networks.add(new NetworksListElement(array.get(i).getAsJsonObject()));
}
return networks;
} catch (IOException e) {
throw new DockerAccessException(e.getMessage());
}
}
Aggregations