当前位置: 首页>>代码示例>>Python>>正文


Python RestConnection.delete_bucket方法代码示例

本文整理汇总了Python中membase.api.rest_client.RestConnection.delete_bucket方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.delete_bucket方法的具体用法?Python RestConnection.delete_bucket怎么用?Python RestConnection.delete_bucket使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在membase.api.rest_client.RestConnection的用法示例。


在下文中一共展示了RestConnection.delete_bucket方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: cluster_xdcr_remote_clusters_write

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
    def cluster_xdcr_remote_clusters_write(self,username,password,host,port=8091, servers=None,cluster=None,httpCode=None,user_role=None):

        rest = RestConnection(servers[0])
        rest.remove_all_replications()
        rest.remove_all_remote_clusters()

        _cluster_xdcr_remove_cluster_write = {
            "remoteClusters":"pools/default/remoteClusters;POST",
            "remote_cluster_id":"pools/default/remoteClusters/<id>;PUT",
            "delete_remote":"pools/default/remoteClusters/<id>;DELETE"
        }

        params = {'hostname': "{0}:{1}".format(servers[1].ip, servers[1].port),'username': 'Administrator','password': 'password','name':'rbac_remote01'}
        add_node = {"remoteClusters":"pools/default/remoteClusters;POST;" + str(params)}
        result = self._return_http_code(add_node,username,password,host=host,port=port, httpCode=httpCode, user_role=user_role)

        rest.remove_all_replications()
        rest.remove_all_remote_clusters()

        remote_cluster_name = 'rbac_cluster'
        rest = RestConnection(servers[0])
        remote_server01 = servers[1]
        remote_server02 = servers[2]
        rest_remote01 = RestConnection(remote_server01)
        rest_remote01.delete_bucket()
        rest_remote01.create_bucket(bucket='default', ramQuotaMB=100)
        rest_remote02 = RestConnection(remote_server02)

        rest.remove_all_replications()
        rest.remove_all_remote_clusters()
        remote_id = rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',remote_cluster_name)
        time.sleep(20)
        delete_remote = {"delete_remote":"pools/default/remoteClusters/" + str(remote_cluster_name) + ";DELETE"}
        result = self._return_http_code(delete_remote,username,password,host=host,port=port, httpCode=httpCode, user_role=user_role)
开发者ID:mihirkamdarcouchbase,项目名称:testrunner,代码行数:36,代码来源:rbacPermissionList.py

示例2: test_basic_xdcr_with_cert_regenerate

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
    def test_basic_xdcr_with_cert_regenerate(self):

        cluster1 = self.servers[0:2]
        cluster2 = self.servers[2:4]
        remote_cluster_name = 'sslcluster'
        restCluster1 = RestConnection(cluster1[0])
        restCluster2 = RestConnection(cluster2[0])

        try:
            #Setup cluster1
            x509main(cluster1[0]).setup_master()
            x509main(cluster1[1])._setup_node_certificates(reload_cert=False)

            restCluster1.add_node('Administrator','password',cluster1[1].ip)
            known_nodes = ['[email protected]'+cluster1[0].ip,'[email protected]' + cluster1[1].ip]
            restCluster1.rebalance(known_nodes)
            self.assertTrue(self.check_rebalance_complete(restCluster1),"Issue with rebalance")
            restCluster1.create_bucket(bucket='default', ramQuotaMB=100)
            restCluster1.remove_all_replications()
            restCluster1.remove_all_remote_clusters()

            #Setup cluster2
            x509main(cluster2[0]).setup_master()
            x509main(cluster2[1])._setup_node_certificates(reload_cert=False)

            restCluster2.add_node('Administrator','password',cluster2[1].ip)
            known_nodes = ['[email protected]'+cluster2[0].ip,'[email protected]' + cluster2[1].ip]
            restCluster2.rebalance(known_nodes)
            self.assertTrue(self.check_rebalance_complete(restCluster2),"Issue with rebalance")
            restCluster2.create_bucket(bucket='default', ramQuotaMB=100)

            test = x509main.CACERTFILEPATH + x509main.CACERTFILE
            data  =  open(test, 'rb').read()
            restCluster1.add_remote_cluster(cluster2[0].ip,cluster2[0].port,'Administrator','password',remote_cluster_name,certificate=data)
            replication_id = restCluster1.start_replication('continuous','default',remote_cluster_name)

            #restCluster1.set_xdcr_param('default','default','pauseRequested',True)

            x509main(self.master)._delete_inbox_folder()
            x509main(self.master)._generate_cert(self.servers,root_cn="CB\ Authority")
            self.log.info ("Setting up the first cluster for new certificate")

            x509main(cluster1[0]).setup_master()
            x509main(cluster1[1])._setup_node_certificates(reload_cert=False)
            self.log.info ("Setting up the second cluster for new certificate")
            x509main(cluster2[0]).setup_master()
            x509main(cluster2[1])._setup_node_certificates(reload_cert=False)

            status = restCluster1.is_replication_paused('default','default')
            if not status:
                restCluster1.set_xdcr_param('default','default','pauseRequested',False)

            restCluster1.set_xdcr_param('default','default','pauseRequested',True)
            status = restCluster1.is_replication_paused('default','default')
            self.assertTrue(status,"Replication has not started after certificate upgrade")
        finally:
            known_nodes = ['[email protected]'+cluster2[0].ip,'[email protected]'+cluster2[1].ip]
            restCluster2.rebalance(known_nodes,['[email protected]' + cluster2[1].ip])
            self.assertTrue(self.check_rebalance_complete(restCluster2),"Issue with rebalance")
            restCluster2.delete_bucket()
开发者ID:EricACooper,项目名称:testrunner,代码行数:62,代码来源:x509tests.py

示例3: test_default_moxi

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
    def test_default_moxi(self):
        name = 'default'
        for serverInfo in self.servers:
            rest = RestConnection(serverInfo)
            replicaNumber = 1
            proxyPort = rest.get_nodes_self().moxi
            rest.create_bucket(bucket=name,
                               ramQuotaMB=200,
                               replicaNumber=replicaNumber,
                               proxyPort=proxyPort)
            msg = 'create_bucket succeeded but bucket {0} does not exist'.format(name)
            self.assertTrue(BucketOperationHelper.wait_for_bucket_creation(name, rest), msg=msg)
            ready = BucketOperationHelper.wait_for_memcached(serverInfo, name)
            self.assertTrue(ready, "wait_for_memcached failed")
            inserted_keys = BucketOperationHelper.load_some_data(serverInfo, 1, name)
            self.assertTrue(inserted_keys, 'unable to insert any key to memcached')
            verified = BucketOperationHelper.verify_data(serverInfo, inserted_keys, True, False, self, bucket=name)
            self.assertTrue(verified, msg='verified all the keys stored')
            #verify keys
            rest.delete_bucket(name)
            msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(name)
            self.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(name, rest, timeout_in_seconds=60), msg=msg)

            rest.create_bucket(bucket=name,
                               ramQuotaMB=200,
                               replicaNumber=replicaNumber,
                               proxyPort=proxyPort)
            msg = 'create_bucket succeeded but bucket {0} does not exist'.format(name)
            self.assertTrue(BucketOperationHelper.wait_for_bucket_creation(name, rest), msg=msg)
            BucketOperationHelper.wait_for_memcached(serverInfo, name)
            #now let's recreate the bucket
            self.log.info('recreated the default bucket...')
            #loop over the keys make sure they dont exist
            self.assertTrue(BucketOperationHelper.keys_dont_exist(serverInfo, inserted_keys, name),
                            msg='at least one key found in the bucket')
开发者ID:steveyen,项目名称:testrunner,代码行数:37,代码来源:recreatebuckettests.py

示例4: cluster_xdcr_remote_clusters_read

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
    def cluster_xdcr_remote_clusters_read(self,username,password,host,port=8091, servers=None,cluster=None,httpCode=None,user_role=None):
        remote_cluster_name = 'rbac_cluster'
        rest = RestConnection(servers[0])
        remote_server01 = servers[1]
        remote_server02 = servers[2]
        rest_remote01 = RestConnection(remote_server01)
        rest_remote01.delete_bucket()
        rest_remote01.create_bucket(bucket='default', ramQuotaMB=100)
        rest_remote02 = RestConnection(remote_server02)

        #------ First Test the Get Requests for XDCR --------------#

        #Remove all remote cluster references
        rest.remove_all_replications()
        rest.remove_all_remote_clusters()

        #Add remote cluster reference and replications
        rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',remote_cluster_name)
        time.sleep(20)
        replication_id = rest.start_replication('continuous','default',remote_cluster_name)

        _cluster_xdcr_remote_clusters_read ={
            "remove_cluser_read":"/pools/default/remoteClusters;GET",
        }

        result = self._return_http_code(_cluster_xdcr_remote_clusters_read,username,password,host=host,port=8091, httpCode=httpCode, user_role=user_role)
开发者ID:mihirkamdarcouchbase,项目名称:testrunner,代码行数:28,代码来源:rbacPermissionList.py

示例5: cluster_xdcr_settings_read

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
    def cluster_xdcr_settings_read(self,username,password,host,port=8091,servers=None,cluster=None,httpCode=None,user_role=None):

        _cluster_xdcr_settings_read = {
            "replication_settings":"settings/replications;GET"
        }

        rest = RestConnection(servers[0])
        rest.remove_all_replications()
        rest.remove_all_remote_clusters()

        remote_cluster_name = 'rbac_cluster'
        rest = RestConnection(servers[0])
        remote_server01 = servers[1]
        remote_server02 = servers[2]
        rest_remote01 = RestConnection(remote_server01)
        rest_remote01.delete_bucket()
        rest_remote01.create_bucket(bucket='default', ramQuotaMB=100)
        rest_remote02 = RestConnection(remote_server02)
        remote_id = rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',remote_cluster_name)
        time.sleep(20)
        replication_id = rest.start_replication('continuous','default',remote_cluster_name)
        result = self._return_http_code(_cluster_xdcr_settings_read,username,password,host=host,port=port, httpCode=httpCode, user_role=user_role)
        rest.remove_all_replications()
        rest.remove_all_remote_clusters()
        rest_remote01.delete_bucket()
开发者ID:mihirkamdarcouchbase,项目名称:testrunner,代码行数:27,代码来源:rbacPermissionList.py

示例6: delete_all_buckets_or_assert

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
 def delete_all_buckets_or_assert(ips, test_case):
     log.info('deleting existing buckets on {0}'.format(ips))
     for ip in ips:
         rest = RestConnection(ip=ip)
         buckets = rest.get_buckets()
         for bucket in buckets:
             rest.delete_bucket(bucket.name)
             log.info('deleted bucket : {0}'.format(bucket.name))
             msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(bucket.name)
             test_case.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(bucket.name, rest, 200), msg=msg)
开发者ID:jchris,项目名称:testrunner,代码行数:12,代码来源:rebalance_helper.py

示例7: delete_bucket_or_assert

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
    def delete_bucket_or_assert(serverInfo, bucket='default', test_case=None):
        log = logger.Logger.get_logger()
        log.info('deleting existing buckets on {0}'.format(serverInfo))

        rest = RestConnection(serverInfo)
        if RestHelper(rest).bucket_exists(bucket):
            rest.delete_bucket(bucket)
            log.info('deleted bucket : {0} from {1}'.format(bucket, serverInfo.ip))
        msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(bucket)
        if test_case:
            test_case.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(bucket, rest, 200), msg=msg)
开发者ID:jchris,项目名称:testrunner,代码行数:13,代码来源:bucket_helper.py

示例8: cluster_bucket_xdcr_write

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
    def cluster_bucket_xdcr_write(self,username,password,host,port=8091,servers=None,cluster=None,httpCode=None,user_role=None):
        _cluster_xdcr_settings_read = {
            "create_replication":"controller/createReplication;POST",
            "cancel_XDCR":"controller/cancelXDCR/<xid>;POST",
            "delete_XDCR":"controller/cancelXDCR/<xid>;DELETE"
        }

        rest = RestConnection(servers[0])
        rest.remove_all_replications()
        rest.remove_all_remote_clusters()

        remote_cluster_name = 'rbac_cluster'
        rest = RestConnection(servers[0])
        remote_server01 = servers[1]
        remote_server02 = servers[2]
        rest_remote01 = RestConnection(remote_server01)
        rest_remote01.delete_bucket()
        rest_remote01.create_bucket(bucket='default1', ramQuotaMB=100,proxyPort=11252)
        rest_remote02 = RestConnection(remote_server02)
        remote_id = rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',remote_cluster_name)
        time.sleep(10)
        #replication_id = rest.start_replication('continuous','default',remote_cluster_name)

        param_map = {'replicationType': 'continuous','toBucket': 'default1','fromBucket': 'default','toCluster': remote_cluster_name,
                     'type': 'capi'}
        create_replication = {"create_replication":"controller/createReplication;POST;"+str(param_map)}
        result = self._return_http_code(create_replication,username,password,host=host,port=port, httpCode=httpCode, user_role=user_role)


        rest.remove_all_replications()
        rest.remove_all_remote_clusters()

        remote_id = rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',remote_cluster_name)
        time.sleep(20)
        replication_id = rest.start_replication('continuous',fromBucket='default',toCluster=remote_cluster_name,toBucket='default1')
        replication_id = replication_id.replace("/","%2F")

        cancel_replication = {"cancel_XDCR":"controller/cancelXDCR/" + replication_id + ";POST"}
        result = self._return_http_code(cancel_replication,username,password,host=host,port=port, httpCode=httpCode, user_role=user_role)

        rest.remove_all_replications()
        rest.remove_all_remote_clusters()
        remote_id = rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',remote_cluster_name)
        time.sleep(20)
        replication_id = rest.start_replication('continuous',fromBucket='default',toCluster=remote_cluster_name,toBucket='default1')
        replication_id = replication_id.replace("/","%2F")

        cancel_replication = {"cancel_XDCR":"controller/cancelXDCR/" + replication_id + ";DELETE"}
        result = self._return_http_code(cancel_replication,username,password,host=host,port=port, httpCode=httpCode, user_role=user_role)

        rest.remove_all_replications()
        rest.remove_all_remote_clusters()
        rest_remote01.delete_bucket('default1')
开发者ID:mihirkamdarcouchbase,项目名称:testrunner,代码行数:55,代码来源:rbacPermissionList.py

示例9: delete_all_buckets_or_assert

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
 def delete_all_buckets_or_assert(ips,test_case):
     for ip in ips:
         rest = RestConnection(ip=ip,
                               username='Administrator',
                               password='password')
         buckets = rest.get_buckets()
         for bucket in buckets:
             print bucket.name
             rest.delete_bucket(bucket.name)
             log.info('deleted bucket : {0}'.format(bucket.name))
             msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(bucket.name)
             test_case.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(bucket.name, rest, 200)
                             , msg=msg)
开发者ID:farshidce,项目名称:nsuitests,代码行数:15,代码来源:bucket_helper.py

示例10: delete_all_buckets_or_assert

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
 def delete_all_buckets_or_assert(servers, test_case):
     log = logger.Logger.get_logger()
     log.info('deleting existing buckets on {0}'.format(servers))
     for serverInfo in servers:
         rest = RestConnection(serverInfo)
         buckets = []
         try:
             buckets = rest.get_buckets()
         except:
             log.info('15 seconds sleep before calling get_buckets again...')
             time.sleep(15)
             buckets = rest.get_buckets()
         for bucket in buckets:
             status = rest.delete_bucket(bucket.name)
             if not status:
                 try:
                     log.info(StatsCommon.get_stats([serverInfo], bucket.name, "timings"))
                 except:
                     log.error("Unable to get timings for bucket")
             log.info('deleted bucket : {0} from {1}'.format(bucket.name, serverInfo.ip))
             msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(bucket.name)
             if test_case:
                 if not BucketOperationHelper.wait_for_bucket_deletion(bucket.name, rest, 200):
                     try:
                         log.info(StatsCommon.get_stats([serverInfo], bucket.name, "timings"))
                     except:
                         log.error("Unable to get timings for bucket")
                     test_case.fail(msg)
开发者ID:mschoch,项目名称:testrunner,代码行数:30,代码来源:bucket_helper.py

示例11: test_bucketEvents

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
    def test_bucketEvents(self):
        ops = self.input.param("ops", None)
        user = self.master.rest_username
        source = 'ns_server'
        rest = RestConnection(self.master)

        if (ops in ['create']):
            expectedResults = {'bucket_name':'TestBucket', 'ram_quota':104857600, 'num_replicas':1,
                               'replica_index':False, 'eviction_policy':'value_only', 'type':'membase', \
                               'auth_type':'sasl', "autocompaction":'false', "purge_interval":"undefined", \
                                "flush_enabled":False, "num_threads":3, "source":source, \
                               "user":user, "ip":self.ipAddress, "port":57457, 'sessionid':'', 'conflict_resolution_type':'seqno', \
                               'storage_mode':'couchstore','max_ttl':400,'compression_mode':'passive'}
            rest.create_bucket(expectedResults['bucket_name'], expectedResults['ram_quota'] / 1048576, expectedResults['auth_type'], 'password', expectedResults['num_replicas'], \
                               '11211', 'membase', 0, expectedResults['num_threads'], 0, 'valueOnly', maxTTL=expectedResults['max_ttl'])

        elif (ops in ['update']):
            expectedResults = {'bucket_name':'TestBucket', 'ram_quota':209715200, 'num_replicas':1, 'replica_index':False, 'eviction_policy':'value_only', 'type':'membase', \
                               'auth_type':'sasl', "autocompaction":'false', "purge_interval":"undefined", "flush_enabled":'true', "num_threads":3, "source":source, \
                               "user":user, "ip":self.ipAddress, "port":57457 , 'sessionid':'','storage_mode':'couchstore', 'max_ttl':400}
            rest.create_bucket(expectedResults['bucket_name'], expectedResults['ram_quota'] / 1048576, expectedResults['auth_type'], 'password', expectedResults['num_replicas'], '11211', 'membase', \
                               0, expectedResults['num_threads'], 0 , 'valueOnly', maxTTL=expectedResults['max_ttl'])
            expectedResults = {'bucket_name':'TestBucket', 'ram_quota':104857600, 'num_replicas':1, 'replica_index':True, 'eviction_policy':'value_only', 'type':'membase', \
                               'auth_type':'sasl', "autocompaction":'false', "purge_interval":"undefined", "flush_enabled":True, "num_threads":3, "source":source, \
                               "user":user, "ip":self.ipAddress, "port":57457,'storage_mode':'couchstore', 'max_ttl':200}
            rest.change_bucket_props(expectedResults['bucket_name'], expectedResults['ram_quota'] / 1048576, expectedResults['auth_type'], 'password', expectedResults['num_replicas'], \
                                     '11211', 1, 1, maxTTL=expectedResults['max_ttl'])

        elif (ops in ['delete']):
            expectedResults = {'bucket_name':'TestBucket', 'ram_quota':104857600, 'num_replicas':1, 'replica_index':True, 'eviction_policy':'value_only', 'type':'membase', \
                               'auth_type':'sasl', "autocompaction":'false', "purge_interval":"undefined", "flush_enabled":False, "num_threads":3, "source":source, \
                               "user":user, "ip":self.ipAddress, "port":57457}
            rest.create_bucket(expectedResults['bucket_name'], expectedResults['ram_quota'] / 1048576, expectedResults['auth_type'], 'password', expectedResults['num_replicas'], \
                               '11211', 'membase', 1, expectedResults['num_threads'], 0 , 'valueOnly')
            rest.delete_bucket(expectedResults['bucket_name'])

        elif (ops in ['flush']):
            expectedResults = {'bucket_name':'TestBucket', 'ram_quota':100, 'num_replicas':1, 'replica_index':True, 'eviction_policy':'value_only', 'type':'membase', \
			    'auth_type':'sasl', "autocompaction":'false', "purge_interval":"undefined", "flush_enabled":True, "num_threads":3, "source":source, \
                               "user":user, "ip":self.ipAddress, "port":57457,'storage_mode':'couchstore'}
            rest.create_bucket(expectedResults['bucket_name'], expectedResults['ram_quota'], expectedResults['auth_type'], 'password', expectedResults['num_replicas'], \
                               '11211', 'membase', 1, expectedResults['num_threads'], 1, 'valueOnly')
            self.sleep(10)
            rest.flush_bucket(expectedResults['bucket_name'])

        self.checkConfig(self.eventID, self.master, expectedResults)
开发者ID:mihirkamdarcouchbase,项目名称:testrunner,代码行数:48,代码来源:audittest.py

示例12: test_bucket_delete

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
 def test_bucket_delete(self):
     rest = RestConnection(ip=TestInput.master(),
                           username=TestInput.get_username(),
                           password=TestInput.get_password())
     #create two buckets
     bucket1 = uuid.uuid4()
     bucket2 = uuid.uuid4()
     rest.create_bucket(bucket=bucket1,replicaNumber=1,ramQuotaMB=128,proxyPort=11220)
     rest.create_bucket(bucket=bucket2,replicaNumber=1,ramQuotaMB=128,proxyPort=11221)
     self.navigator.login(username=TestInput.get_username(),
                          password=TestInput.get_password())
     buckets = rest.get_buckets()
     expected_names = [bucket.name for bucket in buckets]
     assert Verifier(self.navigator).verify_sect_buckets(expected_names)
     rest.delete_bucket(bucket=bucket1)
     expected_names = [bucket.name for bucket in buckets]
     assert Verifier(self.navigator).verify_sect_buckets(expected_names)
开发者ID:farshidce,项目名称:nsuitests,代码行数:19,代码来源:manage_buckets.py

示例13: execute

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
 def execute(self, task_manager):
     rest = RestConnection(self.server)
     if rest.delete_bucket(self.bucket):
         self.state = CHECKING
         task_manager.schedule(self)
     else:
         self.state = FINISHED
         self.set_result(False)
开发者ID:paul-guo-,项目名称:appstack,代码行数:10,代码来源:task.py

示例14: delete_all_buckets_or_assert

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
 def delete_all_buckets_or_assert(servers, test_case):
     log = logger.Logger.get_logger()
     log.info('deleting existing buckets on {0}'.format(servers))
     for serverInfo in servers:
         rest = RestConnection(serverInfo)
         buckets = []
         try:
             buckets = rest.get_buckets()
         except:
             log.info('15 seconds sleep before calling get_buckets again...')
             time.sleep(15)
             buckets = rest.get_buckets()
         for bucket in buckets:
             rest.delete_bucket(bucket.name)
             log.info('deleted bucket : {0} from {1}'.format(bucket.name, serverInfo.ip))
             msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(bucket.name)
             if test_case:
                 test_case.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(bucket.name, rest, 200), msg=msg)
开发者ID:jchris,项目名称:testrunner,代码行数:20,代码来源:bucket_helper.py

示例15: test_default_moxi_sasl

# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import delete_bucket [as 别名]
 def test_default_moxi_sasl(self):
     name = 'new-bucket-{0}'.format(uuid.uuid4())
     for serverInfo in self.servers:
         rest = RestConnection(serverInfo)
         replicaNumber = 1
         proxyPort = rest.get_nodes_self().moxi
         rest.create_bucket(bucket=name,
                            ramQuotaMB=200,
                            replicaNumber=replicaNumber,
                            proxyPort=proxyPort,
                            authType="sasl",
                            saslPassword='password')
         msg = 'create_bucket succeeded but bucket {0} does not exist'.format(name)
         self.assertTrue(BucketOperationHelper.wait_for_bucket_creation(name, rest), msg=msg)
         ready = BucketOperationHelper.wait_for_memcached(serverInfo, name)
         self.assertTrue(ready, "wait_for_memcached failed")
         rest.delete_bucket(name)
         msg = 'bucket "{0}" was not deleted even after waiting for two minutes'.format(name)
         self.assertTrue(BucketOperationHelper.wait_for_bucket_deletion(name, rest, timeout_in_seconds=30), msg=msg)
开发者ID:steveyen,项目名称:testrunner,代码行数:21,代码来源:recreatebuckettests.py


注:本文中的membase.api.rest_client.RestConnection.delete_bucket方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。