def _create_bucket(self, name, auth_type='sasl', bucket_type='couchbase',
                       parallel_db_and_view_compaction=False,
                       ram_quota_mb="128", replica_index='0', replica_number='0',
                       sasl_password=None, flush_enabled=False, proxy_port=11211):
        payload = dict()
        payload['name'] = name
        payload['authType'] = auth_type
        payload['bucketType'] = bucket_type
        if flush_enabled:
            payload['flushEnabled'] = '1'
        if parallel_db_and_view_compaction:
            payload['parallelDBAndViewCompaction'] = parallel_db_and_view_compaction
            payload['proxyPort'] = proxy_port
        payload['ramQuotaMB'] = ram_quota_mb
        if replica_index:
            payload['replicaIndex'] = replica_index
        if replica_number:
            payload['replicaNumber'] = replica_number
        if sasl_password:
            payload['saslPassword'] = sasl_password

        response = requests.post('http://%s:%s/pools/default/buckets' % (self.host, self.port), auth=(self.username, self.password), data=payload)
        if response.status_code != 202:
            log.error('Unable to create bucket %s on %s' % (name, self.host))
            raise BadRequest ('Couchbase error %d: %s' %(response.status_code, response.content))

        gevent.sleep(2)

        # Wait until datastore exists
        # retries = 0
        # ds_exists = self.datastore_exists(name)
        # while not ds_exists and retries < 20:
        #     gevent.sleep(0.1)
        #     ds_exists = self.datastore_exists(name)
        #     retries += 1
        # if not ds_exists:
        #     raise BadRequest("Could not create datastore %s in time" % name)
Initializes the current instance of the object.
dataset/ETHPy150Open ooici/pyon/pyon/datastore/couchbase/base_store.py/CouchbaseDataStore._create_bucket--crossover with--dataset/ETHPy150Open Microsoft/ApplicationInsights-Python/applicationinsights/channel/contracts/Operation.py/Operation._initialize