コード例 #1
0
 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}
コード例 #2
0
    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))
コード例 #3
0
    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)
コード例 #4
0
 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))
コード例 #7
0
ファイル: database_stubs.py プロジェクト: soheilhy/quantum
 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))
コード例 #8
0
 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)
コード例 #9
0
    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)
コード例 #10
0
ファイル: SamplePlugin.py プロジェクト: pestrunk/quantum-1
 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))
コード例 #11
0
ファイル: SamplePlugin.py プロジェクト: hongbin/quantum
 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))
コード例 #12
0
 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)
コード例 #13
0
 def delete_port(self, tenant_id, net_id, port_id):
     port = db.port_destroy(port_id, net_id)
     return self._make_port_dict(port)
コード例 #14
0
 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)
コード例 #15
0
ファイル: ovs_quantum_plugin.py プロジェクト: Oneiroi/quantum
 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)
コード例 #16
0
ファイル: ovs_quantum_plugin.py プロジェクト: emonty/quantum
 def delete_port(self, tenant_id, net_id, port_id):
     port = db.port_destroy(port_id, net_id)
     return self._make_port_dict(port)