Ejemplo n.º 1
0
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),
        },
    })
Ejemplo n.º 2
0
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),
        },
    })
Ejemplo n.º 3
0
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])
Ejemplo n.º 4
0
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])