def get_bucket_json(self, bucket_name='default'): api = '{0}{1}{2}'.format(self.baseUrl, 'pools/default/buckets/', bucket_name) status, content, _ = self._http_request(api) if not status: self.log.error("Error while getting {0}. Please retry".format(api)) raise GetBucketInfoFailed(bucket_name, content) return json.loads(content)
def get_buckets_json(self): api = '{0}{1}'.format(self.baseUrl, 'pools/default/buckets?basic_stats=true') status, content, _ = self._http_request(api) if not status: self.log.error("Error while getting {0}. Please retry".format(api)) raise GetBucketInfoFailed("all_buckets", content) return json.loads(content)
def get_bucket_json(self, bucket='default'): api = '{0}{1}{2}'.format(self.baseUrl, 'pools/default/buckets/', bucket) if isinstance(bucket, Bucket): api = '{0}{1}{2}'.format(self.baseUrl, 'pools/default/buckets/', bucket.name) status, content, header = self._http_request(api) if not status: raise GetBucketInfoFailed(bucket, content) return json.loads(content)