def nodes_get_masters_info(request): masters, myself = utils.masters_detail( request.args['host'], int(request.args['port'])) return base.json_result({ 'masters': masters, 'myself': { 'role': myself.role_in_cluster, 'slots': len(myself.assigned_slots), }, })
def nodes_get_masters_info(request): masters, myself = utils.masters_detail(request.args['host'], int(request.args['port'])) return base.json_result({ 'masters': masters, 'myself': { 'role': myself.role_in_cluster, 'slots': len(myself.assigned_slots), }, })
def cluster_get_masters_info(request): c = models.cluster.get_by_id(request.args['id']) if c is None or len(c.nodes) == 0: return base.not_found() node = c.nodes[0] return base.json_result(utils.masters_detail(node.host, node.port)[0])