// NETWORK public Network createNetwork(String networkName) throws RegionException, NeutronException { if (!checkNetworkNameExist(networkName)) { Network network = null; NetworkApi networkApi = neutronApi.getNetworkApi(getRegionOne()); network = networkApi.create(CreateNetwork.createBuilder(networkName).build()); return network; } else { throw new NeutronException("Network name exists on this tenant!"); } }
public boolean deleteNetwork(String networkId) throws RegionException { NetworkApi networkApi = neutronApi.getNetworkApi(getRegionOne()); return networkApi.delete(networkId); }
public ArrayList<Network> listNetworks() throws RegionException { NetworkApi networkApi = neutronApi.getNetworkApi(getRegionOne()); return Lists.newArrayList(networkApi.list().concat()); }