summaryrefslogtreecommitdiff
path: root/src/orchestration/views.py
blob: 4c3910c99da2dc2781c04a957c03e3ec2fca384c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from django.shortcuts import render
from django.core import serializers
from django.http import HttpResponse, JsonResponse
from .models import ImageSync, RemoteRegionSetup


def index(request):
    return HttpResponse("Hello world")


def count(request, count):
    data = {
        'name': 'Vitor',
        'location': 'Finland',
        'is_active': True,
        'count': count
    }
    return JsonResponse(data)


def imagesync(request):
    rec = ImageSync.objects.order_by('-remote_region_name')
    return JsonResponse(serializers.serialize('json', rec), safe=False)