# Path: harnas/checker/heraclient.py
# def get_cluster(auth=None):
#     resp = requests.get(URL + 'cluster/', auth=get_auth(auth))
#     response_raise(resp)
#     return resp.json()['nodes']


from django.shortcuts import render
from django.views.decorators.http import require_safe
from harnas.checker.heraclient import get_cluster


@require_safe
def status(request):
    nodes = get_cluster()

# Path: harnas/checker/heraclient.py
# def get_cluster(auth=None):
#     resp = requests.get(URL + 'cluster/', auth=get_auth(auth))
#     response_raise(resp)
#     return resp.json()['nodes']


# Path: harnas/checker/views/cluster.py
from django.shortcuts import render
from django.views.decorators.http import require_safe
from harnas.checker.heraclient import get_cluster



@require_safe
def status(request):
    nodes = get_cluster()

    return render(request, 'checker/status.html', {'nodes': nodes})