async def get_buckets(self, bucket_type=None): req = riak_pb.RpbListBucketsReq() if bucket_type: self._add_bucket_type(req, bucket_type) code, res = await self._request(messages.MSG_CODE_LIST_BUCKETS_REQ, req, messages.MSG_CODE_LIST_BUCKETS_RESP) return res.buckets
def get_buckets(self, timeout=None): """ Serialize bucket listing request and deserialize response """ req = None if self.client_timeouts() and timeout: req = riak_pb.RpbListBucketsReq() req.timeout = timeout msg_code, resp = self._request(MSG_CODE_LIST_BUCKETS_REQ, req, MSG_CODE_LIST_BUCKETS_RESP) return resp.buckets
def stream_buckets(self, timeout=None): """ Stream list of buckets through an iterator """ if not self.bucket_stream(): raise NotImplementedError('Streaming list-buckets is not ' 'supported') req = riak_pb.RpbListBucketsReq() req.stream = True # Bucket streaming landed in the same release as timeouts, so # we don't need to check the capability. if timeout: req.timeout = timeout self._send_msg(MSG_CODE_LIST_BUCKETS_REQ, req) return RiakPbcBucketStream(self)