from .models import Backup, Host
from rest_framework import viewsets
from .serializers import BackupSerializer, HostSerializer


class BackupViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows users to be viewed or edited.
    """
    queryset = Backup.objects.all().order_by('-id')
    serializer_class = BackupSerializer


class HostViewSet(viewsets.ModelViewSet):
    """
    API endpoint that allows groups to be viewed or edited.
    """
    queryset = Host.objects.all()
    serializer_class = HostSerializer
