if (!portInterface.portExists(portUUID)) { throw new ResourceNotFoundException("port UUID does not exist."); NeutronPort port = portInterface.getPort(portUUID); if (port.getDeviceID() != null || port.getDeviceOwner() != null) { Response.status(403).build(); NeutronPort singleton = portInterface.getPort(portUUID); Object[] instances = ServiceHelper.getGlobalInstances(INeutronPortAware.class, this, null); if (instances != null) { throw new ServiceUnavailableException("Couldn't get providers list. Please try again later"); portInterface.removePort(portUUID); if (instances != null) { for (Object instance : instances) {
+ RestMessages.SERVICEUNAVAILABLE.toString()); List<NeutronPort> allPorts = portInterface.getAllPorts(); List<NeutronPort> ans = new ArrayList<NeutronPort>(); Iterator<NeutronPort> i = allPorts.iterator();
+ RestMessages.SERVICEUNAVAILABLE.toString()); if (!portInterface.portExists(portUUID)) { throw new ResourceNotFoundException("port UUID does not exist."); NeutronPort ans = portInterface.getPort(portUUID); return Response.status(200).entity( new NeutronPortRequest(extractFields(ans, fields))).build(); } else { return Response.status(200).entity( new NeutronPortRequest(portInterface.getPort(portUUID))).build();
if (!portInterface.portExists(portUUID)) { throw new ResourceNotFoundException("port UUID does not exist."); NeutronPort target = portInterface.getPort(portUUID); if (!input.isSingleton()) { throw new BadRequestException("only singleton edit suported"); NeutronPort original = portInterface.getPort(portUUID); portInterface.updatePort(portUUID, singleton); NeutronPort updatedPort = portInterface.getPort(portUUID); if (instances != null) { for (Object instance : instances) {
throw new BadRequestException("network UUID musy be specified"); if (portInterface.portExists(singleton.getID())) { throw new BadRequestException("port UUID already exists"); throw new BadRequestException("MAC address not properly formatted"); if (portInterface.macInUse(singleton.getMacAddress())) { throw new ResourceConflictException("MAC Address is in use."); portInterface.addPort(singleton); if (instances != null) { for (Object instance : instances) { if (portInterface.portExists(test.getID())) { throw new BadRequestException("port UUID already exists"); throw new BadRequestException("MAC address not properly formatted"); if (portInterface.macInUse(test.getMacAddress())) { throw new ResourceConflictException("MAC address in use"); while (i.hasNext()) { NeutronPort test = i.next(); portInterface.addPort(test); if (instances != null) { for (Object instance : instances) {
NeutronPort port = portInterface.getGatewayPort(input.getSubnetUUID()); if (port == null) throw new ResourceNotFoundException("Port UUID not found"); throw new ServiceUnavailableException("Couldn't get providers list. Please try again later"); NeutronPort port = portInterface.getPort(input.getPortUUID()); port.setDeviceID(null); port.setDeviceOwner(null); NeutronPort port = portInterface.getPort(input.getPortUUID()); if (port == null) { throw new ResourceNotFoundException("Port UUID not found");
NeutronPort port = neutronPortCRUDif.getPort(floatingIP.getPortUUID()); String neutronNetwork = port.getNetworkUUID(); INeutronNetworkCRUD neutronNetworkCRUDif = NeutronCRUDInterfaces.getINeutronNetworkCRUD(o);
if (port_id != null) { if (!portInterface.portExists(port_id)) throw new ResourceNotFoundException("Port UUID doesn't exist."); NeutronPort port = portInterface.getPort(port_id); if (port.getFixedIPs().size() < 1) throw new BadRequestException("port ID doesn't have a fixed IP address.");
if (targetSubnet == null) throw new BadRequestException("Subnet id doesn't exist"); NeutronPort targetPort = portInterface.getPort(input.getPortUUID()); if (targetPort == null) throw new BadRequestException("Port id doesn't exist");
if (port_id != null) { if (!portInterface.portExists(port_id)) throw new ResourceNotFoundException("Port UUID doesn't exist."); NeutronPort port = portInterface.getPort(port_id); if (port.getFixedIPs().size() < 1) throw new BadRequestException("port UUID doesn't have an IP address.");