uncloud-mravi/nicohack202002/uncloud/opennebula/views.py

14 lines
351 B
Python

from rest_framework import viewsets, generics
from .models import VM
from .serializers import VMSerializer
class VMList(generics.ListAPIView):
queryset = VM.objects.all()
serializer_class = VMSerializer
class VMDetail(generics.RetrieveAPIView):
lookup_field = 'vmid'
queryset = VM.objects.all()
serializer_class = VMSerializer