send vm down event and delete db.

        :param lb_id: vip id for v1 and lbaas_id for v2
175982
def delete_lbaas_port(self, lb_id):
        
        lb_id = lb_id.replace('-', '')
        req = dict(instance_id=lb_id)
        instances = self.get_vms_for_this_req(**req)
        for vm in instances:
            LOG.info("deleting lbaas vm %s " % vm.name)
            self.delete_vm_function(vm.port_id, vm)
269179
def close_db_connections(self, instance, db_key, db_name=None):
        
        conn_key = self._conn_key(instance, db_key, db_name)
        if conn_key not in self.connections:
            return

        try:
            self.connections[conn_key]['conn'].close()
            del self.connections[conn_key]
        except Exception as e:
            self.log.warning("Could not close adodbapi db connection\n{0}".format(e))
1360923
def drop_db(url):
    
    parsed_url = urlparse(url)
    db_name = parsed_url.path
    db_name = db_name.strip("/")
    db = connect("postgresql://" + parsed_url.netloc)
    # check that db exists
    q = """SELECT 1 as exists
           FROM pg_database
           WHERE datname = '{db_name}'""".format(
        db_name=db_name
    )
    if db.query(q).fetchone():
        # DROP DATABASE must be run outside of a transaction
        conn = db.engine.connect()
        conn.execute("commit")
        conn.execute("DROP DATABASE " + db_name)
        conn.close()
345006
async def disconnect(self, conn_id):
        

        self._ensure_connection(conn_id, True)

        msg = dict(connection_string=self._get_property(conn_id, "connection_string"))

        try:
            await self._send_command(OPERATIONS.DISCONNECT, msg, COMMANDS.DisconnectResponse)
        finally:
            self._teardown_connection(conn_id)
997853
function(connection, collection, relations, cb) {
      log.debug('drop:', collection);
      // Add in logic here to delete a collection (e.g. DROP TABLE logic)

      return connections[connection].drop(collection, relations, cb);
    }
864187
def drop_function(self, dbName, funcName):
    
    self.send_drop_function(dbName, funcName)
    self.recv_drop_function()
503044
def remove_lb_nodes(self, lb_id, node_ids):
        
        log.info("Removing load balancer nodes %s" % node_ids)
        for node_id in node_ids:
            self._request('delete', '/loadbalancers/%s/nodes/%s' % (lb_id, node_id))
1287996
public Object down(Event evt) {
        Object retval=super.down(evt);

        switch(evt.getType()) {
            case Event.CONNECT:
            case Event.CONNECT_WITH_STATE_TRANSFER:
            case Event.CONNECT_USE_FLUSH:
            case Event.CONNECT_WITH_STATE_TRANSFER_USE_FLUSH:
                register(cluster_name, local_addr, this);
                break;
            case Event.DISCONNECT:
                unregister(cluster_name, local_addr);
                break;
            case Event.SET_LOCAL_ADDRESS:
                local_addr=evt.getArg();
                break;
            case Event.BECOME_SERVER: // called after client has joined and is fully working group member
                is_server=true;
                break;
            case Event.VIEW_CHANGE:
            case Event.TMP_VIEW:
                curr_view=evt.getArg();
                Address[] mbrs=((View)evt.getArg()).getMembersRaw();
                is_coord=local_addr != null && mbrs != null && mbrs.length > 0 && local_addr.equals(mbrs[0]);
                break;
            case Event.GET_PING_DATA:
                return getDiscoveryResponsesFor(evt.getArg()); // don't pass further down
            case Event.GET_PHYSICAL_ADDRESS:
                if(cluster_name == null)
                    return retval;
                Address mbr=evt.getArg();
                Map<Address,SHARED_LOOPBACK> map=routing_table.get(cluster_name);
                SHARED_LOOPBACK lp=map != null? map.get(mbr) : null;
                return lp != null? lp.getPhysicalAddress() : null;
        }

        return retval;
    }
957922
def _downgrade_v2(op):
    
    # Drop indices before batch
    # This is to prevent index collision when creating the temp table
    op.drop_index('ix_equities_fuzzy_symbol')
    op.drop_index('ix_equities_company_symbol')

    # Execute batch op to allow column modification in SQLite
    with op.batch_alter_table('equities') as batch_op:
        batch_op.drop_column('auto_close_date')

    # Recreate indices after batch
    op.create_index('ix_equities_fuzzy_symbol',
                    table_name='equities',
                    columns=['fuzzy_symbol'])
    op.create_index('ix_equities_company_symbol',
                    table_name='equities',
                    columns=['company_symbol'])
880495
def flush_down_connections(self):
        
        self._get_db_attempts = 0
        for db_num in self._down_connections.keys():
            self.mark_connection_up(db_num)
485804
def dropdb():
    """"""
    manager.db.engine.echo = True
    if prompt_bool("Are you sure you want to lose all your data"):
        manager.db.drop_all()
        metadata, alembic_version = alembic_table_metadata()
        alembic_version.drop()
        manager.db.session.commit()
1031365
def down(force):
    
    try:
        cloud_config = CloudConfig()
        cloud_controller = CloudController(cloud_config)
        cloud_controller.down(force)
    except CloudComposeException as ex:
        print(ex)
1243925
public static base_response delete(nitro_service client, lbmonitor resource) throws Exception {
		lbmonitor deleteresource = new lbmonitor();
		deleteresource.monitorname = resource.monitorname;
		deleteresource.type = resource.type;
		deleteresource.respcode = resource.respcode;
		return deleteresource.delete_resource(client);
	}
920624
def destroy_ebs_volume(connection, region, volume_id, log=False):
    

    if ebs_volume_exists(connection, region, volume_id):
        if log:
            log_yellow('destroying EBS volume ...')
        try:
            connection.delete_volume(volume_id)
        except:
            # our EBS volume may be gone, but AWS info tables are stale
            # wait a bit and ask again
            sleep(5)
            if not ebs_volume_exists(connection, region, volume_id):
                pass
            else:
                raise("Couldn't delete EBS volume")
218486
def drop_db():
    """"""
    local_machine()
    with fab_settings(warn_only=True):
        local('psql {0} -c "DROP DATABASE {1}"'.format(
            USER_AND_HOST, env.db_name))
        local('psql {0} -c "DROP USER {1}"'.format(
            USER_AND_HOST, env.db_role))
1077041
def drop_connection(self, name, database=None):
        
        request_executor = self._store.get_request_executor(database)
        command = DropSubscriptionConnectionCommand(name)
        request_executor.execute(command)
378896
def db_remove(name, user=None, password=None, host=None, port=None, authdb=None):
    '''
    
    '''
    conn = _connect(user, password, host, port, authdb=authdb)
    if not conn:
        return 'Failed to connect to mongo database'

    try:
        log.info('Removing database %s', name)
        conn.drop_database(name)
    except pymongo.errors.PyMongoError as err:
        log.error('Removing database %s failed with error: %s', name, err)
        return six.text_type(err)

    return True