def delete_port(self, tenant_id, network_id, port_id): """ Deletes a port on a specified Virtual Network, if the port contains a remote interface attachment, the remote interface is first un-plugged and then the port is deleted. """ LOG.debug("delete_port() called") port = self._get_port(tenant_id, network_id, port_id) if port.interface_id: raise exc.PortInUse(net_id=network_id, port_id=port_id, att_id=port.interface_id) db.port_destroy(port_id, network_id) return {'port-id': port.uuid}
def delete_port(self, tenant_id, net_id, port_id): """ Deletes a port on a specified Virtual Network, if the port contains a remote interface attachment, the remote interface is first un-plugged and then the port is deleted. :returns: a mapping sequence with the following signature: {'port-id': uuid representing the deleted port on specified quantum network } :raises: exception.PortInUse :raises: exception.PortNotFound :raises: exception.NetworkNotFound """ LOG.debug("QuantumRestProxy: delete_port() called") net = self.get_network(tenant_id, net_id) port = self.get_port(tenant_id, net_id, port_id) if port['interface_id']: raise exc.PortInUse(net_id=net_id, port_id=port_id, att_id=port['interface_id']) # Delete from DB try: port = db.port_destroy(port_id, net_id) except Exception, e: raise Exception("Failed to delete port: %s" % str(e))
def delete_port(self, tenant_id, net_id, port_id): db.validate_port_ownership(tenant_id, net_id, port_id) port = db.port_destroy(port_id, net_id) #delete from port_properties neuca_db.remove_port_properties(port_id) return self._make_port_dict(port)
def delete_port(self, tenant_id, net_id, port_id): """ Deletes a port on a specified Virtual Network, if the port contains a remote interface attachment, the remote interface is first un-plugged and then the port is deleted. """ LOG.debug("LinuxBridgePlugin.delete_port() called") network = db.network_get(net_id) port = db.port_get(port_id, net_id) attachment_id = port[const.INTERFACEID] if not attachment_id: db.port_destroy(port_id, net_id) new_port_dict = cutil.make_port_dict(port) return new_port_dict else: raise exc.PortInUse(port_id=port_id, net_id=net_id, att_id=attachment_id)
def delete_port(self, net_id, port_id): """Delete a port""" try: port = db.port_destroy(net_id, port_id) LOG.debug("Deleted port %s" % port.uuid) port_dict = {} port_dict["port-id"] = str(port.uuid) return port_dict except Exception, exc: raise Exception("Failed to delete port: %s" % str(exc))
def delete_port(self, net_id, port_id): """Delete a port""" try: port = db.port_destroy(port_id, net_id) LOG.debug("Deleted port %s", port.uuid) port_dict = {} port_dict["id"] = str(port.uuid) return port_dict except Exception, exc: LOG.error("Failed to delete port: %s", str(exc))
def delete_port(self, net_id, port_id): """Delete a port.""" try: port = db.port_destroy(port_id, net_id) LOG.debug("Deleted port %s", port.uuid) port_dict = {} port_dict["id"] = str(port.uuid) return port_dict except Exception as exc: LOG.error("Failed to delete port: %s", str(exc))
def delete_port(self, tenant_id, net_id, port_id): """ Deletes a port on a specified Virtual Network, if the port contains a remote interface attachment, the remote interface is first un-plugged and then the port is deleted. """ LOG.debug("LinuxBridgePlugin.delete_port() called") db.validate_port_ownership(tenant_id, net_id, port_id) port = db.port_get(port_id, net_id) attachment_id = port[const.INTERFACEID] if not attachment_id: db.port_destroy(port_id, net_id) new_port_dict = cutil.make_port_dict(port) return new_port_dict else: raise exc.PortInUse(port_id=port_id, net_id=net_id, att_id=attachment_id)
def create_port(self, tenant_id, net_id, port_state=None, **kwargs): """ Creates a port on the specified Virtual Network. :returns: a mapping sequence with the following signature: {'port-id': uuid representing the created port on specified quantum network } :raises: exception.NetworkNotFound :raises: exception.StateInvalid """ LOG.debug("QuantumRestProxy: create_port() called") self.get_network(tenant_id, net_id) # Update DB port = db.port_create(net_id, port_state, op_status=OperationalStatus.DOWN) port_id = str(port.uuid) # create on networl ctrl try: resource = '/tenants/%s/networks/%s/ports' % ( tenant_id, net_id) data = { "port": { "id": port_id, "state": port_state, } } ret = self.servers.post(resource, data) if not self.servers.action_success(ret): raise RemoteRestError(ret[2]) except RemoteRestError as e: LOG.error( 'QuantumRestProxy: Unable to create remote port: %s' % e.message) db.port_destroy(port_id, net_id) raise return self.make_port_dict(port)
def delete_port(self, tenant_id, net_id, port_id): """ Deletes a port on a specified Virtual Network, if the port contains a remote interface attachment, the remote interface is first un-plugged and then the port is deleted. """ LOG.debug("FakePlugin.delete_port() called") net = self._get_network(tenant_id, net_id) port = self._get_port(tenant_id, net_id, port_id) if port["interface_id"]: raise exc.PortInUse(net_id=net_id, port_id=port_id, att_id=port["interface_id"]) try: port = db.port_destroy(port_id, net_id) except Exception, e: raise Exception("Failed to delete port: %s" % str(e))
def delete_port(self, tenant_id, net_id, port_id): """ Deletes a port on a specified Virtual Network, if the port contains a remote interface attachment, the remote interface is first un-plugged and then the port is deleted. """ LOG.debug("FakePlugin.delete_port() called") net = self._get_network(tenant_id, net_id) port = self._get_port(tenant_id, net_id, port_id) if port['interface_id']: raise exc.PortInUse(net_id=net_id, port_id=port_id, att_id=port['interface_id']) try: port = db.port_destroy(port_id, net_id) except Exception, e: raise Exception("Failed to delete port: %s" % str(e))
def delete_port(self, tenant_id, net_id, port_id): db.validate_port_ownership(tenant_id, net_id, port_id) port = db.port_destroy(port_id, net_id) return self._make_port_dict(port)
def delete_port(self, tenant_id, net_id, port_id): port = db.port_destroy(port_id, net_id) return self._make_port_dict(port)
def delete_port(self, tenant_id, net_id, port_id): port = db.port_destroy(port_id, net_id) return self._make_port_dict(str(port.uuid), port.state, port.network_id, port.interface_id)