public Iterable<Network> listLocations() {
Builder<Network> builder = ImmutableSet.builder();
for (Resource org1 : api.listOrgs()) {
Org org = api.getBrowsingApi().getOrg(org1.getId());
for (Resource vdc : org.getVDCs()) {
VDC VDC = api.getBrowsingApi().getVDCInOrg(org.getId(), vdc.getId());
// optionally constrain locations
if (email != null && VDC.getDescription().indexOf(email) != -1)
continue;
for (Resource network : VDC.getAvailableNetworks()) {
builder.add(api.getBrowsingApi().getNetworkInVDC(org.getId(), vdc.getId(), network.getId()));
}
}
}
return builder.build();