if (!subnetInterface.subnetExists(subnetUUID)) { throw new ResourceNotFoundException("subnet UUID does not exist."); if (subnetInterface.subnetInUse(subnetUUID)) { return Response.status(409).build(); NeutronSubnet singleton = subnetInterface.getSubnet(subnetUUID); Object[] instances = ServiceHelper.getGlobalInstances(INeutronSubnetAware.class, this, null); if (instances != null) { subnetInterface.removeSubnet(subnetUUID); if (instances != null) { for (Object instance : instances) {
+ RestMessages.SERVICEUNAVAILABLE.toString()); List<NeutronSubnet> allNetworks = subnetInterface.getAllSubnets(); List<NeutronSubnet> ans = new ArrayList<NeutronSubnet>(); Iterator<NeutronSubnet> i = allNetworks.iterator();
if (!subnetInterface.subnetExists(subnetUUID)) { throw new ResourceNotFoundException("subnet UUID does not exist."); NeutronSubnet original = subnetInterface.getSubnet(subnetUUID); subnetInterface.updateSubnet(subnetUUID, delta); NeutronSubnet updatedSubnet = subnetInterface.getSubnet(subnetUUID); if (instances != null) { for (Object instance : instances) { new NeutronSubnetRequest(subnetInterface.getSubnet(subnetUUID))).build();
+ RestMessages.SERVICEUNAVAILABLE.toString()); if (!subnetInterface.subnetExists(subnetUUID)) { throw new ResourceNotFoundException("subnet UUID does not exist."); NeutronSubnet ans = subnetInterface.getSubnet(subnetUUID); return Response.status(200).entity( new NeutronSubnetRequest(extractFields(ans, fields))).build(); } else { return Response.status(200).entity( new NeutronSubnetRequest(subnetInterface.getSubnet(subnetUUID))).build();
public int canAttachInterface(NeutronRouter router, NeutronRouter_Interface routerInterface) { //See if a EGW will need to be configured //If so, and there aren't GWs available, return BADREQUEST with a message INeutronSubnetCRUD neutronSubnetIf = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this); NeutronSubnet neutronSubnet = neutronSubnetIf.getSubnet(routerInterface.getSubnetUUID()); INeutronNetworkCRUD neutronNetworkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this); NeutronNetwork neutronNetwork = neutronNetworkIf.getNetwork(neutronSubnet.getNetworkUUID()); if (neutronNetwork.isRouterExternal()) { IfOpenDoveServiceApplianceCRUD serviceApplianceDB = OpenDoveCRUDInterfaces.getIfDoveServiceApplianceCRUD(this); List<OpenDoveServiceAppliance> oDSAs = serviceApplianceDB.getAppliances(); Iterator<OpenDoveServiceAppliance> iterator = oDSAs.iterator(); while (iterator.hasNext()) { if (iterator.next().get_isDGW()) { return 200; } } return 400; } return 200; }
if (subnetInterface.subnetExists(singleton.getID())) { throw new BadRequestException("subnet UUID already exists"); throw new ServiceUnavailableException("Couldn't get providers list. Please try again later"); subnetInterface.addSubnet(singleton); if (instances != null) { for (Object instance : instances) { throw new InternalServerErrorException("subnet object could not be initialized properly"); if (subnetInterface.subnetExists(test.getID())) { throw new BadRequestException("subnet UUID already exists"); while (i.hasNext()) { NeutronSubnet test = i.next(); subnetInterface.addSubnet(test); if (instances != null) { for (Object instance : instances) {
public void neutronRouterInterfaceAttached(NeutronRouter router, NeutronRouter_Interface routerInterface) { INeutronSubnetCRUD neutronSubnetIf = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this); NeutronSubnet neutronSubnet = neutronSubnetIf.getSubnet(routerInterface.getSubnetUUID()); INeutronNetworkCRUD neutronNetworkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this); NeutronNetwork neutronNetwork = neutronNetworkIf.getNetwork(neutronSubnet.getNetworkUUID()); while (interfaceIterator.hasNext()) { NeutronRouter_Interface oldInterface = interfaceIterator.next(); NeutronSubnet oldNeutronSubnet = neutronSubnetIf.getSubnet(oldInterface.getSubnetUUID()); NeutronNetwork oldNeutronNetwork = neutronNetworkIf.getNetwork(oldNeutronSubnet.getNetworkUUID()); String oldNetworkUUID = "Neutron " + oldNeutronNetwork.getID();
throw new BadRequestException("subnet UUID must be specified"); if (!subnetInterface.subnetExists(ip.getSubnetUUID())) { throw new BadRequestException("subnet UUID doesn't exist."); NeutronSubnet subnet = subnetInterface.getSubnet(ip.getSubnetUUID()); if (!target.getNetworkUUID().equalsIgnoreCase(subnet.getNetworkUUID())) { throw new BadRequestException("network UUID must match that of subnet");
public void neutronRouterInterfaceDetached(NeutronRouter router, NeutronRouter_Interface routerInterface) { INeutronSubnetCRUD neutronSubnetIf = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this); NeutronSubnet neutronSubnet = neutronSubnetIf.getSubnet(routerInterface.getSubnetUUID()); INeutronNetworkCRUD neutronNetworkIf = NeutronCRUDInterfaces.getINeutronNetworkCRUD(this); NeutronNetwork neutronNetwork = neutronNetworkIf.getNetwork(neutronSubnet.getNetworkUUID()); NeutronSubnet oldNeutronSubnet = neutronSubnetIf.getSubnet(oldInterface.getSubnetUUID()); NeutronNetwork oldNeutronNetwork = neutronNetworkIf.getNetwork(oldNeutronSubnet.getNetworkUUID()); String oldNetworkUUID = "Neutron " + oldNeutronNetwork.getID();
throw new BadRequestException("subnet UUID not specified"); if (!subnetInterface.subnetExists(ip.getSubnetUUID())) { throw new BadRequestException("subnet UUID must exists"); NeutronSubnet subnet = subnetInterface.getSubnet(ip.getSubnetUUID()); if (!singleton.getNetworkUUID().equalsIgnoreCase(subnet.getNetworkUUID())) { throw new BadRequestException("network UUID must match that of subnet"); throw new BadRequestException("subnet UUID must be specified"); if (!subnetInterface.subnetExists(ip.getSubnetUUID())) { throw new BadRequestException("subnet UUID doesn't exists"); NeutronSubnet subnet = subnetInterface.getSubnet(ip.getSubnetUUID()); if (!test.getNetworkUUID().equalsIgnoreCase(subnet.getNetworkUUID())) { throw new BadRequestException("network UUID must match that of subnet");
NeutronSubnet targetSubnet = subnetInterface.getSubnet(input.getSubnetUUID()); if (targetSubnet == null) throw new BadRequestException("Subnet id doesn't exist");
if (externNetwork.getSubnets().size() != 1) throw new BadRequestException("external network doesn't have a subnet."); NeutronSubnet externSubnet = subnetInterface.getSubnet(externNetwork.getSubnets().get(0)); if (!externSubnet.isValidIP(floatingIP)) throw new BadRequestException("floating IP not valid for external subnet");
if (externNetwork.getSubnets().size() != 1) throw new BadRequestException("external network doesn't have a subnet"); NeutronSubnet externSubnet = subnetInterface.getSubnet(externNetwork.getSubnets().get(0)); if (!externSubnet.isValidIP(floatingIP)) throw new BadRequestException("external IP isn't valid for the specified subnet.");
NeutronNetwork neutronNetwork = neutronNetworkIf.getNetwork(port.getNetworkUUID()); INeutronSubnetCRUD neutronSubnetIf = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this); NeutronSubnet neutronSubnet = neutronSubnetIf.getSubnet(port.getFixedIPs().get(0).getSubnetUUID());
throw new ResourceNotFoundException("Port UUID has no fixed IPs"); NeutronSubnet subnet = subnetInterface.getSubnet(input.getSubnetUUID()); if (subnet == null) { throw new ResourceNotFoundException("Subnet UUID not found");
NeutronNetwork neutronNetwork = neutronNetworkIf.getNetwork(port.getNetworkUUID()); INeutronSubnetCRUD neutronSubnetIf = NeutronCRUDInterfaces.getINeutronSubnetCRUD(this); NeutronSubnet neutronSubnet = neutronSubnetIf.getSubnet(port.getFixedIPs().get(0).getSubnetUUID()); if (!neutronNetwork.isRouterExternal()) { if (neutronNetwork.isShared()) {