use of org.eclipse.jkube.kit.build.api.model.Network in project jkube by eclipse.
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