Deletes a connection in uBridge.

        :param port_number: adapter number
336599
def _delete_ubridge_connection(self, port_number):
        

        bridge_name = "{}-{}".format(self._id, port_number)
        yield from self._ubridge_send("bridge delete {name}".format(name=bridge_name))
68769
def remove_connection(self, connection):
        """"""
        if not self._closing:
            self.connections.remove(connection)
            logger.debug("removed connection")
1212952
async def delete_port_mapping(self, external_port: int, protocol: str) -> None:
        
        return await self.gateway.commands.DeletePortMapping(
            NewRemoteHost="", NewExternalPort=external_port, NewProtocol=protocol
        )
1184457
def delete_port_channel(self, nexus_host, vpc_nbr):
        """"""

        starttime = time.time()

        path_snip = snipp.PATH_ALL
        body_snip = snipp.BODY_DEL_PORT_CH % (vpc_nbr)

        self.send_edit_string(nexus_host, path_snip, body_snip)

        self.capture_and_print_timeshot(
            starttime, "delete_port_channel",
            switch=nexus_host)
312143
def deactivate(self, address):
        
        with self.lock:
            try:
                connections = self.connections[address]
            except KeyError: # already removed from the connection pool
                return
            for conn in list(connections):
                if not conn.in_use:
                    connections.remove(conn)
                    try:
                        conn.close()
                    except IOError:
                        pass
            if not connections:
                self.remove(address)
350241
def nic_remove(self, nic):
        

        args = {
            'nic': nic,
        }

        self._nic_remove_chk.check(args)

        return self._client.json('bridge.nic-remove', args)
363482
def stop_capture(self, port_number):
        

        if not self._ethernet_adapter.port_exists(port_number):
            raise VPCSError("Port {port_number} doesn't exist in adapter {adapter}".format(adapter=self._ethernet_adapter,
                                                                                           port_number=port_number))

        nio = self._ethernet_adapter.get_nio(0)

        if not nio:
            raise VPCSError("Port {} is not connected".format(port_number))

        nio.stopPacketCapture()

        if self.ubridge:
            yield from self._ubridge_send('bridge stop_capture {name}'.format(name="VPCS-{}".format(self._id)))

        log.info("VPCS '{name}' [{id}]: stopping packet capture on port {port_number}".format(name=self.name,
                                                                                              id=self.id,
                                                                                              port_number=port_number))
760708
def delete_floatingip(self, floatingip_id):
        '''
        
        '''
        ret = self.network_conn.delete_floatingip(floatingip_id)
        return ret if ret else True
1276605
def stop_capture(self, port_number):
        

        if not [port["port_number"] for port in self._ports_mapping if port_number == port["port_number"]]:
            raise NodeError("Port {port_number} doesn't exist on cloud '{name}'".format(name=self.name,
                                                                                        port_number=port_number))

        if port_number not in self._nios:
            raise NodeError("Port {} is not connected".format(port_number))

        nio = self._nios[port_number]
        nio.stopPacketCapture()
        bridge_name = "{}-{}".format(self._id, port_number)
        yield from self._ubridge_send("bridge stop_capture {name}".format(name=bridge_name))

        log.info("Cloud'{name}' [{id}]: stopping packet capture on port {port_number}".format(name=self.name,
                                                                                              id=self.id,
                                                                                              port_number=port_number))
747200
def _stop_ubridge_capture(self, adapter_number):
        

        vnet = "ethernet{}.vnet".format(adapter_number)
        if vnet not in self._vmx_pairs:
            raise VMwareError("vnet {} not in VMX file".format(vnet))
        if not self._ubridge_hypervisor:
            raise VMwareError("Cannot stop the packet capture: uBridge is not running")
        yield from self._ubridge_send("bridge stop_capture {name}".format(name=vnet))
706670
def destroy_floating_ip(self, ip_addr):
        
        if self.api_version == 2:
            self.request('/floating_ips/' + ip_addr, method='DELETE')
        else:
            raise DoError(v2_api_required_str)
394778
def delete_connection(self, name):
        
        name = quote(name, '')
        path = Client.urls['connections_by_name'] % name
        self._call(path, 'DELETE')
        return True
1152195
def delete_nic(self, instance_id, port_id):
        """"""
        self.client.servers.interface_detach(instance_id, port_id)
        return True
1302969
def remove_nexusport_binding(port_id, vlan_id, vni, switch_ip, instance_id):
    """"""
    LOG.debug("remove_nexusport_binding() called")
    session = bc.get_writer_session()
    binding = _lookup_all_nexus_bindings(session=session,
                                         vlan_id=vlan_id,
                                         vni=vni,
                                         switch_ip=switch_ip,
                                         port_id=port_id,
                                         instance_id=instance_id)
    for bind in binding:
        session.delete(bind)
    session.flush()
    return binding
788596
def remove(self, connection):
        ''''''
        key = (connection.host, connection.port)
        with self._lock:
            found = self._connections.pop(key, None)
        try:
            self.close_connection(found)
        except Exception as exc:
            logger.warn('Failed to close %s: %s', connection, exc)
        return found
719521
def delete(self):
        '''  '''
        self.down()
        fcntl.ioctl(ifconfig.sockfd, SIOCBRDELBR, self.name)
        return self
723169
def remove(self, connection):
        
        cid = id(connection)
        if cid not in self.connections:
            raise ConnectionNotFoundError(self.id, cid)
        self.connection_handle(connection).close()
        with self._lock:
            del self.connections[cid]
        LOGGER.debug('Pool %s removed connection %s', self.id, cid)