def cluster_status(self, cluster_key):
"""
Get the present status of the cluster
:param cluster_key: Key that identifies the cluster
:return: The status of the cluster
"""
arguments = {
'method': 'cluster_status',
'cluster': cluster_key
}
client = HTTPClient()
response = client.fetch('{}/cluster?{}'.format(
self.uri, parse.urlencode(arguments)),
headers={'Key': self.uk}
)
if response.code == 200:
if response.body:
return json.loads(response.body.decode('utf-8'))
else:
return "Empty"
else:
raise ValueError(response.body.decode('utf-8'))
评论列表
文章目录