本文整理汇总了Python中membase.api.rest_client.RestConnection.remove_all_replications方法的典型用法代码示例。如果您正苦于以下问题:Python RestConnection.remove_all_replications方法的具体用法?Python RestConnection.remove_all_replications怎么用?Python RestConnection.remove_all_replications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类membase.api.rest_client.RestConnection
的用法示例。
在下文中一共展示了RestConnection.remove_all_replications方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: cluster_xdcr_settings_write
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def cluster_xdcr_settings_write(self,username,password,host,port=8091,servers=None,cluster=None,httpCode=None,user_role=None):
_cluster_xdcr_settings_read = {
"replication_settings":"settings/replications;POST;{'httpConnections': 20}"
}
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)
rest_remote02.delete_bucket()
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()
示例2: test_basic_xdcr_with_cert_regenerate
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [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()
示例3: tearDown
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def tearDown(self):
for server in self.servers:
rest = RestConnection(server)
rest.remove_all_remote_clusters()
rest.remove_all_replications()
rest.remove_all_recoveries()
super(XdcrCLITest, self).tearDown()
示例4: cluster_xdcr_remote_clusters_read
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [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)
示例5: tearDown
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def tearDown(self):
if not self.input.param("skip_cleanup", True):
if self.times_teardown_called > 1 :
self.shell.disconnect()
if self.input.param("skip_cleanup", True):
if self.case_number > 1 or self.times_teardown_called > 1:
self.shell.disconnect()
self.times_teardown_called += 1
serverInfo = self.servers[0]
rest = RestConnection(serverInfo)
zones = rest.get_zone_names()
for zone in zones:
if zone != "Group 1":
rest.delete_zone(zone)
self.clusters_dic = self.input.clusters
if self.clusters_dic:
if len(self.clusters_dic) > 1:
self.dest_nodes = self.clusters_dic[1]
self.dest_master = self.dest_nodes[0]
if self.dest_nodes and len(self.dest_nodes) > 1:
self.log.info("======== clean up destination cluster =======")
rest = RestConnection(self.dest_nodes[0])
rest.remove_all_remote_clusters()
rest.remove_all_replications()
BucketOperationHelper.delete_all_buckets_or_assert(self.dest_nodes, self)
ClusterOperationHelper.cleanup_cluster(self.dest_nodes)
elif len(self.clusters_dic) == 1:
self.log.error("=== need 2 cluster to setup xdcr in ini file ===")
else:
self.log.info("**** If run xdcr test, need cluster config is setup in ini file. ****")
super(CliBaseTest, self).tearDown()
示例6: cluster_bucket_xdcr_read
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def cluster_bucket_xdcr_read(self,username,password,host,port=8091,servers=None,cluster=None,httpCode=None,user_role=None):
_cluster_bucket_xdcr_read = {
"replication_settings":"settings/replications/<id>;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)
replication_id = rest.start_replication('continuous','default',remote_cluster_name)
replication_id = replication_id.replace("/","%2F")
bucket_xdcr_read = {"replication_settings":"settings/replications/" + replication_id + ";GET"}
result = self._return_http_code(bucket_xdcr_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()
示例7: _terminate_replications
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def _terminate_replications(self, master, cluster_name):
rest = RestConnection(master)
rest.remove_all_replications()
os.system(
"curl --user {0}:{1} -X DELETE http://{2}:{3}/pools/default/remoteClusters/{4}".format(
master.rest_username, master.rest_password, master.ip, master.port, cluster_name
)
)
示例8: _deinitialize_api
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def _deinitialize_api(self):
self.log.info("Cleaning up replications and remote clusters")
for server in self.servers:
rest = RestConnection(server)
rest.remove_all_replications()
rest.remove_all_remote_clusters()
self.log.info("Sleeping for 30 seconds after cleaning up replications and remote clusters")
time.sleep(30)
ClusterOperationHelper.cleanup_cluster(self.servers, master=self.master)
示例9: _XDCR_role_test
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def _XDCR_role_test(self):
params = {}
remote_cluster_name = 'rbac_cluster'
remote_server01 = self.servers[1]
remote_server02 = self.servers[2]
read_role = '_replication_admin_read'
write_role = '_replication_admin_write'
rest_remote01 = RestConnection(remote_server01)
rest_remote01.create_bucket(bucket='default', ramQuotaMB=100)
rest_remote02 = RestConnection(remote_server02)
rest_remote02.create_bucket(bucket='default', ramQuotaMB=100)
#------ First Test the Get Requests for XDCR --------------#
#Remove all remote cluster references
self.rest.remove_all_replications()
self.rest.remove_all_remote_clusters()
#Add remote cluster reference and replications
self.rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',remote_cluster_name)
replication_id = self.rest.start_replication('continuous','default',remote_cluster_name)
masDict,tc_status = self.rbac._iterate_role_mapping(read_role,"Administrator","password",{'replication_id':replication_id})
self.rest.remove_all_replications()
self.rest.remove_all_remote_clusters()
rest_remote01.remove_all_replications()
rest_remote01.remove_all_remote_clusters()
rest_remote02.remove_all_replications()
rest_remote02.remove_all_remote_clusters()
# ----------- Second Test for POST requests for XDCR ---------------#
self.rest.remove_all_replications()
self.rest.remove_all_remote_clusters()
rest_remote01.remove_all_replications()
rest_remote01.remove_all_remote_clusters()
rest_remote02.remove_all_replications()
rest_remote02.remove_all_remote_clusters()
self.rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',"onetotwo")
#self.rest.add_remote_cluster(remote_server02.ip,8091,'Administrator','password','onetothree')
#rest_remote01.add_remote_cluster(remote_server02.ip,8091,'Administrator','password',"twotothree")
rest_remote01.add_remote_cluster(self.master.ip,8091,'Administrator','password','twotoone')
rest_remote02.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',"threetotwo")
rest_remote02.add_remote_cluster(self.master.ip,8091,'Administrator','password','threetoone')
params['remote_cluster_name']='onetotwo'
params['remoteCluster01'] = {'username': 'Administrator', 'password': 'password', 'hostname': '192.168.46.103:8091', 'name': 'onetothree'}
params['create_replication'] = {'replicationType': 'continuous','toBucket': 'default','fromBucket': 'default','toCluster': 'twotoone','type': 'xmem'}
params['replication_id'] = rest_remote01.start_replication('continuous','default','twotoone')
masDict,tc_status = self.rbac._iterate_role_mapping('_replication_admin_write01',"Administrator","password",params)
masDict,tc_status = self.rbac._iterate_role_mapping('_replication_admin_write02',"Administrator","password",params,self.servers[1])
'''
示例10: cluster_bucket_xdcr_write
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [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')
示例11: test_basic_xdcr_with_cert
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def test_basic_xdcr_with_cert(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)
if replication_id is not None:
self.assertTrue(True,"Replication was not created successfully")
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()
示例12: cluster_xdcr_remote_clusters_write
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [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)
示例13: _teardown_xdcr
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def _teardown_xdcr(self):
for server in self.servers:
rest = RestConnection(server)
rest.remove_all_remote_clusters()
rest.remove_all_replications()
rest.remove_all_recoveries()
示例14: rbacTest
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
class rbacTest(ldaptest):
def setUp(self):
super(rbacTest, self).setUp()
self.rest = RestConnection(self.master)
self.userList = "bjons:password"
self.userList = self.returnUserList(self.userList)
#self._removeLdapUserRemote(self.userList)
#self._createLDAPUser(self.userList)
self.roleName = self.input.param("roleName")
self.rbac = rbacmain(self.master,'default')
#rest.ldapUserRestOperation(True, ROadminUser=self.userList, exclude=None)
def tearDown(self):
super(rbacTest, self).tearDown()
def _XDCR_role_test(self):
params = {}
remote_cluster_name = 'rbac_cluster'
remote_server01 = self.servers[1]
remote_server02 = self.servers[2]
read_role = '_replication_admin_read'
write_role = '_replication_admin_write'
rest_remote01 = RestConnection(remote_server01)
rest_remote01.create_bucket(bucket='default', ramQuotaMB=100)
rest_remote02 = RestConnection(remote_server02)
rest_remote02.create_bucket(bucket='default', ramQuotaMB=100)
#------ First Test the Get Requests for XDCR --------------#
#Remove all remote cluster references
self.rest.remove_all_replications()
self.rest.remove_all_remote_clusters()
#Add remote cluster reference and replications
self.rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',remote_cluster_name)
replication_id = self.rest.start_replication('continuous','default',remote_cluster_name)
masDict,tc_status = self.rbac._iterate_role_mapping(read_role,"Administrator","password",{'replication_id':replication_id})
self.rest.remove_all_replications()
self.rest.remove_all_remote_clusters()
rest_remote01.remove_all_replications()
rest_remote01.remove_all_remote_clusters()
rest_remote02.remove_all_replications()
rest_remote02.remove_all_remote_clusters()
# ----------- Second Test for POST requests for XDCR ---------------#
self.rest.remove_all_replications()
self.rest.remove_all_remote_clusters()
rest_remote01.remove_all_replications()
rest_remote01.remove_all_remote_clusters()
rest_remote02.remove_all_replications()
rest_remote02.remove_all_remote_clusters()
self.rest.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',"onetotwo")
#self.rest.add_remote_cluster(remote_server02.ip,8091,'Administrator','password','onetothree')
#rest_remote01.add_remote_cluster(remote_server02.ip,8091,'Administrator','password',"twotothree")
rest_remote01.add_remote_cluster(self.master.ip,8091,'Administrator','password','twotoone')
rest_remote02.add_remote_cluster(remote_server01.ip,8091,'Administrator','password',"threetotwo")
rest_remote02.add_remote_cluster(self.master.ip,8091,'Administrator','password','threetoone')
params['remote_cluster_name']='onetotwo'
params['remoteCluster01'] = {'username': 'Administrator', 'password': 'password', 'hostname': '192.168.46.103:8091', 'name': 'onetothree'}
params['create_replication'] = {'replicationType': 'continuous','toBucket': 'default','fromBucket': 'default','toCluster': 'twotoone','type': 'xmem'}
params['replication_id'] = rest_remote01.start_replication('continuous','default','twotoone')
masDict,tc_status = self.rbac._iterate_role_mapping('_replication_admin_write01',"Administrator","password",params)
masDict,tc_status = self.rbac._iterate_role_mapping('_replication_admin_write02',"Administrator","password",params,self.servers[1])
'''
self.rest.remove_all_replications()
self.rest.remove_all_remote_clusters()
rest_remote01.remove_all_replications()
rest_remote01.remove_all_remote_clusters()
rest_remote02.remove_all_replications()
rest_remote02.remove_all_remote_clusters()
'''
def _raw_urllib(self):
api = "http://192.168.46.101:8092/" + "default/_design/test1"
header = {'Content-Type': 'application/json'}
params = '{"views":{"test1":{"map":"function (doc, meta) {emit(meta.id, null);}"}}}'
http = httplib2.Http()
status, content = http.request(api, 'PUT', headers=header,body=params)
print status
print content
def _view_admin_role_test(self):
#----------------Get ddocs -----------#
view = ['abcd']
default_design_doc_name = "Doc1"
default_map_func = 'function (doc) { emit(doc.age, doc.first_name);}'
#.........这里部分代码省略.........
示例15: _stop_es_replication
# 需要导入模块: from membase.api.rest_client import RestConnection [as 别名]
# 或者: from membase.api.rest_client.RestConnection import remove_all_replications [as 别名]
def _stop_es_replication(self):
rest_conn_src = RestConnection(self.master)
rest_conn_src.remove_all_replications()