labpack/databases/couchbase.py
def remove(self):

        '''
            a method to remove the entire bucket from the database 

        :return: string with confirmation message 
        '''

        # https://developer.couchbase.com/documentation/mobile/1.5/references/sync-gateway/admin-rest-api/index.html#/database/delete__db__

        title = '%s.remove' % self.__class__.__name__

    # validate admin access
        if not self.admin_access:
            raise Exception('%s requires admin access.' % title)

    # flush files on server
        if self.configs['server'].find('http:') > -1:
            flush_url = self.configs['server'] + '/pools/%s/buckets/%s/controller/doFlush' % (self.configs['pool'], self.bucket_name)
            response = requests.post(flush_url)
            try:
                print(response.json())
            except:
                print(response.status_code)
    
    # else (in dev) iterate over files and users and purge 
        elif self.configs['server'].find('walrus') > -1:
            for doc in self.list(purge_deleted=True):
                self.purge(doc['_id'])
            user_list = self.list_users()
            for uid in user_list:
                self.delete_user(uid)
            self.delete_view()

    # delete bucket from configs
        delete_url = self.bucket_url + '/'
        requests.delete(delete_url)
        
    # report outcome
        exit_msg = 'Bucket "%s" removed from database.' % self.bucket_name
        self.printer(exit_msg)
        
        return exit_msg

            a method to remove the entire bucket from the database 

        :return: string with confirmation message 
        
a method to remove the entire bucket from the database
a method to remove the entire bucket from the database
def remove(self):
        title = '%s.remove' % self.__class__.__name__
        if not self.admin_access:
            raise Exception('%s requires admin access.' % title)
        if self.configs['server'].find('http:') > -1:
            flush_url = self.configs['server'] + '/pools/%s/buckets/%s/controller/doFlush' % (self.configs['pool'], self.bucket_name)
            response = requests.post(flush_url)
            try:
                print(response.json())
            except:
                print(response.status_code)
        elif self.configs['server'].find('walrus') > -1:
            for doc in self.list(purge_deleted=True):
                self.purge(doc['_id'])
            user_list = self.list_users()
            for uid in user_list:
                self.delete_user(uid)
            self.delete_view()
        delete_url = self.bucket_url + '/'
        requests.delete(delete_url)
        exit_msg = 'Bucket "%s" removed from database.' % self.bucket_name
        self.printer(exit_msg)
        return exit_msg
def remove ( self ) : title = '%s.remove' % self . __class__ . __name__ if not self . admin_access : raise Exception ( '%s requires admin access.' % title ) if self . configs [ 'server' ] . find ( 'http:' ) > - 1 : flush_url = self . configs [ 'server' ] + '/pools/%s/buckets/%s/controller/doFlush' % ( self . configs [ 'pool' ] , self . bucket_name ) response = requests . post ( flush_url ) try : print ( response . json ( ) ) except : print ( response . status_code ) elif self . configs [ 'server' ] . find ( 'walrus' ) > - 1 : for doc in self . list ( purge_deleted = True ) : self . purge ( doc [ '_id' ] ) user_list = self . list_users ( ) for uid in user_list : self . delete_user ( uid ) self . delete_view ( ) delete_url = self . bucket_url + '/' requests . delete ( delete_url ) exit_msg = 'Bucket "%s" removed from database.' % self . bucket_name self . printer ( exit_msg ) return exit_msg
a method to remove the entire bucket from the database
a method to remove the entire bucket from the database
'''
            a method to remove the entire bucket from the database 

        :return: string with confirmation message 
        ''' # https://developer.couchbase.com/documentation/mobile/1.5/references/sync-gateway/admin-rest-api/index.html#/database/delete__db__ # validate admin access # flush files on server # else (in dev) iterate over files and users and purge  # delete bucket from configs # report outcome
string with confirmation message
string with confirmation message
self