def testConnstrFirstArg(self):
     info = self.cluster_info
     s = self.make_connargs()['connection_string']
     cb = Bucket(s)
     d = cb.connect().addCallback(lambda x: self.assertTrue(cb.connected))
     self.register_cleanup(cb)
     return d
예제 #2
0
 def testConnstrFirstArg(self):
     info = self.cluster_info
     s = self.make_connargs()['connection_string']
     cb = Bucket(s)
     d = cb.connect().addCallback(lambda x: self.assertTrue(cb.connected))
     self.register_cleanup(cb)
     return d
예제 #3
0
import cb_status
import settings

socket_list = []
bucket_name = settings.BUCKET_NAME
user = settings.USERNAME
password = settings.PASSWORD

if settings.AWS:
    node = settings.AWS_NODES[0]
else:
    node = settings.AZURE_NODES[0]

bucket = Bucket('couchbase://{0}/{1}'.format(node, bucket_name),
                username=user,
                password=password)
fts_nodes = None
fts_enabled = False
nodes = []
n1ql_enabled = False
xdcr_enabled = False


class NodeStatusHandler(tornado.web.RequestHandler):
    def get(self):
        self.render("www/index.html")


class CBStatusWebSocket(tornado.websocket.WebSocketHandler):
    def open(self):
예제 #4
0
from twisted.internet import reactor

from txcouchbase.bucket import Bucket


def on_view_rows(res):
    for row in res:
        print "Got row", row.key


cb = Bucket('couchbase://localhost/beer-sample')
d = cb.queryAll("beer", "brewery_beers", limit=20)
d.addCallback(on_view_rows)
reactor.run()
예제 #5
0
BUCKET_URL = "/pools/default/buckets"
NODE_URL = "/pools/default/serverGroups"
INDEX_URL = "/indexStatus"
SERVICE_URL = "/pools/default/nodeServices"
FTS_URL = "/api/index/cbex"
XDCR_URL = "/pools/default/remoteClusters"
USERNAME = settings.ADMIN_USER
PASSWORD = settings.ADMIN_PASS

bucket_name = settings.BUCKET_NAME
user = settings.USERNAME
password = settings.PASSWORD

aws = settings.AWS
bucket = Bucket('couchbase://{0}/{1}'.format(",".join(BOOTSTRAP_NODES),
                                             bucket_name),
                username=user,
                password=password)
http_client = AsyncHTTPClient()


def get_image_for_product(product):
    print("erm....get_image_for_product")
    return None


@tornado.gen.coroutine
def get_url(endpoint, host_list=bucket.server_nodes, raise_exception=False):
    exceptions = []
    while True:
        for host in host_list:
            host = "http://" + host
예제 #6
0
from twisted.internet import reactor

from txcouchbase.bucket import Bucket

def on_view_rows(res):
    for row in res:
        print "Got row", row.key

cb = Bucket('couchbase://localhost/beer-sample')
d = cb.queryAll("beer", "brewery_beers", limit=20)
d.addCallback(on_view_rows)
reactor.run()